SQLNET.EXPIRE_TIME引數—之防火牆短連線

swq618發表於2017-01-06

DCD: Dead Connection Detection ,可以用於檢測、標記僵死而沒有斷開會session,再由PMON進行清理,釋放資源。
開啟DCD,只需要在服務端的sqlnet.ora檔案中新增SQLNET.EXPIRE_TIME引數,單位為分鐘:

SQLNET.EXPIRE_TIME = 10

如果時間達到這個值,server端就是發出一個”probe” packet 給客戶端,如要客戶斷是正常的,這個packet就被忽略,timer重新計時;如果客戶端異常中斷,則server端就會收到一個訊息,用以釋放連線。

DCD還可以用於防止防火牆的timeout,例如:

某個系統RMAN備份,在結束時,報:

released channel: dev_0
released channel: dev_1
released channel: dev_2
released channel: dev_3
released channel: dev_4
released channel: dev_5
released channel: dev_6
released channel: dev_7
released channel: dev_8
released channel: dev_9
released channel: dev_10
released channel: dev_11
RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-06004: ORACLE error from recovery catalog database
ORA-03135: connection lost contact
ORACLE error from recovery catalog database
ORA-03114: not connected to ORACLE

參考文章(ID 729811.1):

+ Is the rman catalog Database running on a different system than the Target Database?
If so, verify with the System Administrators what the TCP/IP timeout is set to.
If there is any firewall between two systems, set the value of SQLNET.EXPIRE_TIME 
to less than the TCP timeout value of the firewall. 
 
+ Increase the value of SQLNET.EXPIRE_TIME in the sqlnet.ora file on both 
target servers if no firewall exists between two systems.
 
+ Increase the value of keepalive interval.

以上這個RMAN報錯例子就是由於防火牆設定timeout原因,當client和server在timeout時間內沒有資料傳輸的時候,會話就會被防火牆斷開。而設定SQLNET.EXPIRE_TIME引數,使其小於防火牆的timeout時間,就可以避免這一情況的發生。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29674916/viewspace-2132016/,如需轉載,請註明出處,否則將追究法律責任。

相關文章