TNS-12518: TNS:listener could not hand off client connection

ultradb發表於2016-09-23



幾日前生產環境遇到一問題,經查證,問題解決,大體過程如下:
現場反饋程式無法正常連線資料庫,但登入系統後,監聽正常。
1.alert告警日誌無報錯資訊
2.監聽日誌資訊錯誤資訊如下:
(CONNECT_DATA=(SID=uflowcb1)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=**)(PORT=42961)) * establish * udc * 12518
TNS-12518: TNS:listener could not hand off client connection
TNS-12536: TNS:operation would block
TNS-12560: TNS:protocol adapter error
TNS-00506: Operation would block
Linux Error: 11: Resource temporarily unavailable
3.錯誤核對官方文件顯示:
ORA-12536: TNS:operation would block Cause: An internal operation did not commence because to do so would block the current process and the user has requested that operations be non-blocking. Action: None needed; this is an information message 

TNS-12560: TNS:protocol adapter error Cause: A generic protocol adapter error occurred. Action: Check addresses used for proper protocol specification. Before reporting this error, look at the error stack and check for lower level transport errors. For further details, turn on tracing

TNS-00506: Operation would block Cause: An internal operation did not commence because to do so would block the current process and the user has requested that operations be non-blocking. Action: None needed; this is an information message.

前三個錯誤的action均什麼也不需要,那麼我們就看最後一個linux error:
Linux Error: 11: Resource temporarily unavailable

經查詢,是系統連線程式的顯示:


[oracle@* ~]$ grep nproc /etc/security/limits.conf 
#        - nproc - max number of processes
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
grid                soft    nproc   2048
grid                hard    nproc   16384
oracle              soft    nproc   2048
oracle              hard    nproc   16384
[oracle@itsm-uflow-db2 ~]$ 

而資料庫內部的process是5000,這裡的2048明顯小於5000,這也是系統限制而不是資料庫內部限制報錯的一個原因

資料庫內部的process5000,這裡的2048明顯小於5000,這也是系統限制而不是資料庫內部限制報錯的一個原因,(如果是資料庫內部程式限制,那麼告警日誌將直接報,程式引數不足類似告警)。目前常規使用者在2000-2500之間,高峰在4000左右,因此目前資料庫5000*2=10000,系統8192*2=16384

能滿足近期的需要。



vi /etc/security/limits.conf
grid                soft    nproc   8092
grid                hard    nproc   16384
oracle              soft    nproc   8092
oracle              hard    nproc   16384

儲存即可,該限制檔案修改後就生效,不需要系統重啟。




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

相關文章