[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
- oracle ENABLE=BROKENOracle
- [20200218]連線串與專用模式.txt模式
- Oracle ENABLE=broken引數與TCP KeepAliveOracleTCP
- [zt] JDBC連線Oracle RAC的連線串配置JDBCOracle
- 資料庫的連線串資料庫
- 在命令列中連線mysql命令列MySql
- oracle連線串的一種寫法Oracle
- 【OSX】解決Terminal ssh連線"Write failed Broken pipe"問題AI
- PostgreSQL連線串URI配置(libpq相容配置)SQL
- Oracle 11gR2 RAC的JDBC連線串OracleJDBC
- 在Weblogic9.2.3中建立連線池Web
- 【LISTENER】資料庫連線串的幾種寫法資料庫
- Oracle 11g RAC通過SCAN IP連線資料庫 - JDBC連線串問題Oracle資料庫JDBC
- [20200219]strace跟蹤設定ENABLE=BROKEN的情況.txt
- 貪心-國王的遊戲(大數乘除)、連線子串遊戲
- java連線池解決連線中斷Java
- SQL中的左連線和右連線SQL
- 在 SQL Server 中查詢活動連線和死鎖SQLServer
- 在微信小程式中打造 MQTT 連線測試工具微信小程式MQQT
- JMeter MQTT 在連線測試場景中的使用JMeterMQQT
- 在scrapy的pipelines中連線資料庫資料庫
- Broken pipe
- Python連線兩個字串並去除首尾重複子串Python字串
- oracle中的連線Oracle
- 在Oracle網路結構中解決連線問題Oracle
- ArcSDE for SQL Server安裝及在ArcMap中建立ArcSDE連線SQLServer
- Spring中Enable*功能的使用Spring
- [20190102]連線串不配置服務名能連線資料庫嗎.txt資料庫
- 12、Swoole 中 TCP、UDP 和長連線、短連線TCPUDP
- [20200220]關於SQLNET.EXPIRE_TIME and ENABLE=BROKEN的總結.txtSQL
- 配置檔案中的資料庫連線串加密了,你以為我就挖不出來嗎?資料庫加密
- 記在 Hyperf 中多庫連線操作事務注意事項
- 在Deepin Linux作業系統中如何連線Microsoft OneDriveLinux作業系統ROS
- ASPNET中連線字串字串
- Shell 中的連線符:&&、||