[20200218]ENABLE=BROKEN在連線串中4.txt
[20200218]ENABLE=BROKEN在連線串中4.txt
--//上午測試在連線串中加入與不加入ENABLE=BROKEN的情況,測試有點亂,我下午換1個角度測試:
1.環境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
# echo /proc/sys/net/ipv4/tcp_keepalive* | xargs -n 1 strings -1 -f
/proc/sys/net/ipv4/tcp_keepalive_intvl: 10
/proc/sys/net/ipv4/tcp_keepalive_probes: 4
/proc/sys/net/ipv4/tcp_keepalive_time: 20
2.測試連線串有ENABLE=BROKEN的情況:
$ rlwrap sqlplus scott/book@"(DESCRIPTION=(ENABLE=BROKEN)(CONNECT_DATA=(SERVICE_NAME=book)(SERVER = DEDICATED))(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))"
SCOTT@book> @ spid
SID SERIAL# PROCESS SERVER SPID PID P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
3 919 58548 DEDICATED 58550 24 52 alter system kill session '3,919' immediate;
--//可以從這裡確定sqlplus程式號=58548(對應顯示PROCESS),oraclebook程式號=58550(對應顯示SPID).
$ seq 1000 | xargs -IQ bash -c "netstat -npo 2>/dev/null | egrep '58550|58548'| egrep 'oraclebook|sqlplus'| ts.awk ;sleep 1"
[2020-02-18 16:44:37] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (3.64/0/0)
[2020-02-18 16:44:37] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (3.61/0/0)
[2020-02-18 16:44:38] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (2.62/0/0)
[2020-02-18 16:44:38] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (2.59/0/0)
[2020-02-18 16:44:39] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (1.60/0/0)
[2020-02-18 16:44:39] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (1.56/0/0)
[2020-02-18 16:44:41] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (0.58/0/0)
[2020-02-18 16:44:41] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (0.54/0/0)
[2020-02-18 16:44:42] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (9.57/0/0)
[2020-02-18 16:44:42] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (9.53/0/0)
[2020-02-18 16:44:43] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (8.54/0/0)
[2020-02-18 16:44:43] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (8.51/0/0)
[2020-02-18 16:44:44] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (7.52/0/0)
[2020-02-18 16:44:44] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (7.49/0/0)
[2020-02-18 16:44:45] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (6.50/0/0)
[2020-02-18 16:44:45] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (6.47/0/0)
[2020-02-18 16:44:46] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (5.48/0/0)
[2020-02-18 16:44:46] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (5.44/0/0)
--//注意最後1列。伺服器程式對應的是keepalive,而客戶端程式對應的是keepalive。我的理解就是雙向檢測。
[2020-02-18 16:46:11] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (0.70/0/0)
[2020-02-18 16:46:11] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (0.67/0/0)
# iptables -I INPUT 1 -p tcp --dport 6750 -j REJECT
[2020-02-18 16:46:12] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (9.69/0/1)
[2020-02-18 16:46:12] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (9.66/0/1)
[2020-02-18 16:46:13] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (8.67/0/1)
[2020-02-18 16:46:13] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (8.64/0/1)
[2020-02-18 16:46:14] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (7.65/0/1)
[2020-02-18 16:46:14] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (7.62/0/1)
[2020-02-18 16:46:15] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (6.63/0/1)
[2020-02-18 16:46:15] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (6.59/0/1)
[2020-02-18 16:46:16] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (5.60/0/1)
[2020-02-18 16:46:16] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (5.57/0/1)
[2020-02-18 16:46:17] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (4.58/0/1)
[2020-02-18 16:46:17] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (4.55/0/1)
[2020-02-18 16:46:18] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (3.56/0/1)
[2020-02-18 16:46:18] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (3.53/0/1)
[2020-02-18 16:46:19] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (2.54/0/1)
[2020-02-18 16:46:19] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (2.50/0/1)
[2020-02-18 16:46:20] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (1.51/0/1)
[2020-02-18 16:46:20] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (1.48/0/1)
[2020-02-18 16:46:21] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (0.49/0/1)
[2020-02-18 16:46:21] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (0.46/0/1)
[2020-02-18 16:46:22] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (9.48/0/2)
[2020-02-18 16:46:22] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (9.45/0/2)
[2020-02-18 16:46:23] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (8.46/0/2)
[2020-02-18 16:46:23] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (8.43/0/2)
[2020-02-18 16:46:24] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (7.44/0/2)
[2020-02-18 16:46:24] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (7.40/0/2)
[2020-02-18 16:46:25] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (6.41/0/2)
[2020-02-18 16:46:25] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (6.38/0/2)
[2020-02-18 16:46:26] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (5.39/0/2)
[2020-02-18 16:46:26] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (5.36/0/2)
[2020-02-18 16:46:27] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (4.37/0/2)
[2020-02-18 16:46:27] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (4.34/0/2)
[2020-02-18 16:46:28] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (3.35/0/2)
[2020-02-18 16:46:28] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (3.31/0/2)
[2020-02-18 16:46:29] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (2.32/0/2)
[2020-02-18 16:46:29] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (2.29/0/2)
[2020-02-18 16:46:30] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (1.30/0/2)
[2020-02-18 16:46:30] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (1.27/0/2)
[2020-02-18 16:46:31] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (0.28/0/2)
[2020-02-18 16:46:31] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (0.24/0/2)
[2020-02-18 16:46:32] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (9.27/0/3)
[2020-02-18 16:46:32] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (9.24/0/3)
[2020-02-18 16:46:33] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (8.25/0/3)
[2020-02-18 16:46:33] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (8.21/0/3)
[2020-02-18 16:46:34] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (7.22/0/3)
[2020-02-18 16:46:34] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (7.19/0/3)
[2020-02-18 16:46:35] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (6.20/0/3)
[2020-02-18 16:46:35] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (6.17/0/3)
[2020-02-18 16:46:36] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (5.18/0/3)
[2020-02-18 16:46:36] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (5.14/0/3)
[2020-02-18 16:46:37] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (4.15/0/3)
[2020-02-18 16:46:37] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (4.12/0/3)
[2020-02-18 16:46:38] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (3.13/0/3)
[2020-02-18 16:46:38] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (3.10/0/3)
[2020-02-18 16:46:39] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (2.11/0/3)
[2020-02-18 16:46:39] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (2.08/0/3)
[2020-02-18 16:46:40] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (1.09/0/3)
[2020-02-18 16:46:40] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (1.05/0/3)
[2020-02-18 16:46:41] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (0.06/0/3)
[2020-02-18 16:46:41] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (0.03/0/3)
[2020-02-18 16:46:42] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (9.06/0/4)
[2020-02-18 16:46:42] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (9.02/0/4)
[2020-02-18 16:46:43] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (8.03/0/4)
[2020-02-18 16:46:43] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (8.00/0/4)
[2020-02-18 16:46:44] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (7.01/0/4)
[2020-02-18 16:46:44] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (6.98/0/4)
[2020-02-18 16:46:45] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (5.99/0/4)
[2020-02-18 16:46:45] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (5.95/0/4)
[2020-02-18 16:46:46] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (4.96/0/4)
[2020-02-18 16:46:46] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (4.93/0/4)
[2020-02-18 16:46:47] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (3.94/0/4)
[2020-02-18 16:46:47] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (3.91/0/4)
[2020-02-18 16:46:48] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (2.92/0/4)
[2020-02-18 16:46:48] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (2.89/0/4)
[2020-02-18 16:46:49] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (1.90/0/4)
[2020-02-18 16:46:49] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (1.86/0/4)
[2020-02-18 16:46:50] tcp 0 0 127.0.0.1:1521 127.0.0.1:6750 ESTABLISHED 58550/oraclebook keepalive (0.87/0/4)
[2020-02-18 16:46:50] tcp 0 0 127.0.0.1:6750 127.0.0.1:1521 ESTABLISHED 58548/sqlplus keepalive (0.84/0/4)
--//16:46:12 - 16:46:50 = 38秒,兩個程式同時消失。
SCOTT@book> select sysdate from dual ;
select sysdate from dual
*
ERROR at line 1:
ORA-03135: connection lost contact
Process ID: 58550
Session ID: 3 Serial number: 919
總結:
可以看出在連線串中加入ENABLE=BROKEN是不錯的選擇。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2676093/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20200218]ENABLE=BROKEN在連線串中.txt
- [20200218]無ENABLE=BROKEN在連線串中3.txt
- [20210201]dblink建立連線串使用ENABLE=BROKEN.txt
- [20200218]連線串與專用模式.txt模式
- oracle ENABLE=BROKENOracle
- Oracle ENABLE=broken引數與TCP KeepAliveOracleTCP
- [20200219]strace跟蹤設定ENABLE=BROKEN的情況.txt
- [20200220]關於SQLNET.EXPIRE_TIME and ENABLE=BROKEN的總結.txtSQL
- 在命令列中連線mysql命令列MySql
- [20200219]strace跟蹤設定ENABLE=BROKEN的情況(網路的情況).txt
- [20190102]連線串不配置服務名能連線資料庫嗎.txt資料庫
- 在scrapy的pipelines中連線資料庫資料庫
- Spring中Enable*功能的使用Spring
- Python連線兩個字串並去除首尾重複子串Python字串
- 在Ubuntu 19.10中使用mongoose來連線mongoDBUbuntuMongoDB
- 20200218 - 路徑知識
- 貪心-國王的遊戲(大數乘除)、連線子串遊戲
- JMeter MQTT 在連線測試場景中的使用JMeterMQQT
- 在Deepin Linux作業系統中如何連線Microsoft OneDriveLinux作業系統ROS
- 在微信小程式中打造 MQTT 連線測試工具微信小程式MQQT
- 在 SQL Server 中查詢活動連線和死鎖SQLServer
- 配置檔案中的資料庫連線串加密了,你以為我就挖不出來嗎?資料庫加密
- 12、Swoole 中 TCP、UDP 和長連線、短連線TCPUDP
- 滑鼠怎麼連線在電腦上 滑鼠連線在電腦上的方法步驟
- 在Linux中,如何分析網路連線和埠占用情況?Linux
- 記在 Hyperf 中多庫連線操作事務注意事項
- 在容器外部連線kafka失敗Kafka
- 智慧指標相關:enable_shared_from_this()在開發中的常見應用指標
- 長連線及在Node中的應用——HTTP/1.1 keep-aliveHTTPKeep-Alive
- 內連線、左連線、右連線
- 在 Spring Boot 中使用 HikariCP 連線池Spring Boot
- IDEA中資料庫連線Idea資料庫
- 關於在執行java連線MongoDB時遇到的連線超時問題JavaMongoDB
- Oracle 19c中連線RMAN客戶端的連線方法Oracle客戶端
- enable_index_filterIndexFilter
- FSM:Enable shift register
- 線性dp:最長公共子串
- MYSQL語法:左連線、右連線、內連線、全外連線MySql