檢查我們的一台ORACLE數據庫的監聽日志發現有不少TNS-12502錯誤信息。如下所示
TNS-12502: TNS:listener received no CONNECT_DATA from client
09-DEC-2014 15:47:06 * (CONNECT_DATA=(SERVICE_NAME=epps)(CID=(PROGRAM=D:\Tasks\FGIS2MES\CEG\gmt_auto.exe)(HOST=CEGWEB1)(USER=cegadmin))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.163.21.14)(PORT=2312)) * establish * epps * 0
$ oerr tns 12502
12502, 00000, "TNS:listener received no CONNECT_DATA from client"
// *Cause: No CONNECT_DATA was passed to the listener.
// *Action: Check that the service name resolved from TNSNAMES.ORA has
// the CONNECT_DATA component of the connect descriptor.
一般出現這個錯誤是因為客戶端tnsnames.ora中沒有包含CONNECT_DATA導致,但是如上所示,客戶端tnsnames.ora中已經包含了CONNECT_DATA數據,大部分時候正常,但是偶爾又會在listener.log裡面發現該錯誤信息,而且完全沒有規律可言,最後在Oracle的TNS-12502 錯誤原因及解決這篇文章中了解到,客戶端通過telnet數據庫服務器的1521端口測試連通性,也會出現如下錯誤。如下所示:
telnet 192.168.20.11 1521
查看/u01/app/oracle/product/10.2.0/db_1/network/log/listener.log 如下所示,你會看到TNS-12525錯誤信息。
12-DEC-2014 20:40:33 * <unknown connect data> * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.125.113)(PORT=52651)) * establish * <unknown sid> * 12525
TNS-12525: TNS:listener has not received client's request in time allowed
TNS-12535: TNS:operation timed out
TNS-12606: TNS: Application timeout occurred
12-DEC-2014 20:40:37 * service_update * epps * 0
但是這個跟在監聽日志中發現的錯誤信息有所區別:TNS-12502: TNS:listener received no CONNECT_DATA from client,我統計了TNS-12502錯誤出現的時間點也很難發現什麼規律。很奇怪的是這個錯誤也不影響用戶的使用。到目前為止,也一直沒有弄明白為什麼會出現這個錯誤。暫且做個記錄,留待以後研究解決!
參考資料:
http://www.eygle.com/archives/2006/08/oracle_tns_12502.html