【LISTENER】Oracle監聽TNS-12545及TNS-00515錯誤處理一例
Oracle的監聽程式與作業系統的設定資訊結合的很緊密,稍有不慎便會遇到無法啟動的問題。
本文就監聽的TNS-12560及TNS-00515錯誤給出分析及處理方法。
1.TNS-12560及TNS-00515報錯現象
1)使用監聽status命令獲取到的報錯資訊
ora10g@secdb /home/oracle$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-MAR-2011 21:18:03
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=secdb)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
2)使用監聽start命令獲取到的報錯資訊
LSNRCTL> start
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=secdb)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
Listener failed to start. See the error message(s) above...
注意這裡連續丟擲TNS-12545和TNS-00515資訊均給出同樣的報錯內容“Connect failed because target host or object does not exist”。
2.問題原因
/etc/hosts檔案內容設定不正確是本例問題的所在。
1)/etc/hosts檔案內容如下
[root@secdb ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
2)獲取主機名資訊
[root@secdb ~]# hostname
secdb
導致監聽無法正常啟動的原因便在這裡:hosts檔案內容與主機名設定的不一致!
3.問題處理
1)修改hosts檔案內容
確保hosts檔案中的內容與主機名保持一致。否則便會出現監聽無法啟動的問題。
[root@secdb ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 secdb localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
~
~
2)嘗試啟動監聽
LSNRCTL> start
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=secdb)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 25-MAR-2011 21:20:55
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
3)檢視監聽狀態
稍等片刻,等待資料庫例項動態註冊到監聽中。
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=secdb)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 25-MAR-2011 21:52:51
Uptime 0 days 0 hr. 3 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ora10g" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10gXDB" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora11g" has 1 instance(s).
Instance "ora11g", status READY, has 1 handler(s) for this service...
The command completed successfully
可見,此時監聽已經成功啟動並執行正常。
4.小結
處理有關監聽方面的故障時,多注意觀察錯誤提示資訊的內容,60%的情況下錯誤提示資訊本身包含了比較有意義的資訊。例如本例中,錯誤提示反覆提到“target host”目標主機這個關鍵字,可以由此深入進去進行問題排查。
Good luck.
secooler
11.03.25
-- The End --
本文就監聽的TNS-12560及TNS-00515錯誤給出分析及處理方法。
1.TNS-12560及TNS-00515報錯現象
1)使用監聽status命令獲取到的報錯資訊
ora10g@secdb /home/oracle$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-MAR-2011 21:18:03
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=secdb)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
2)使用監聽start命令獲取到的報錯資訊
LSNRCTL> start
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=secdb)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
Listener failed to start. See the error message(s) above...
注意這裡連續丟擲TNS-12545和TNS-00515資訊均給出同樣的報錯內容“Connect failed because target host or object does not exist”。
2.問題原因
/etc/hosts檔案內容設定不正確是本例問題的所在。
1)/etc/hosts檔案內容如下
[root@secdb ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
2)獲取主機名資訊
[root@secdb ~]# hostname
secdb
導致監聽無法正常啟動的原因便在這裡:hosts檔案內容與主機名設定的不一致!
3.問題處理
1)修改hosts檔案內容
確保hosts檔案中的內容與主機名保持一致。否則便會出現監聽無法啟動的問題。
[root@secdb ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 secdb localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
~
~
2)嘗試啟動監聽
LSNRCTL> start
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=secdb)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 25-MAR-2011 21:20:55
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
3)檢視監聽狀態
稍等片刻,等待資料庫例項動態註冊到監聽中。
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=secdb)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 25-MAR-2011 21:52:51
Uptime 0 days 0 hr. 3 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ora10g" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10gXDB" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora11g" has 1 instance(s).
Instance "ora11g", status READY, has 1 handler(s) for this service...
The command completed successfully
可見,此時監聽已經成功啟動並執行正常。
4.小結
處理有關監聽方面的故障時,多注意觀察錯誤提示資訊的內容,60%的情況下錯誤提示資訊本身包含了比較有意義的資訊。例如本例中,錯誤提示反覆提到“target host”目標主機這個關鍵字,可以由此深入進去進行問題排查。
Good luck.
secooler
11.03.25
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-690480/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle listener 監聽啟動不起來處理案例一則Oracle
- oracle 10g rac當監聽程式監聽對方vip時啟動監聽報錯TNS-12545Oracle 10g
- Oracle 監聽異常處理Oracle
- TNS-12541: TNS:no listener錯誤處理
- 【故障|監聽】TNS-12545、TNS-12560、TNS-00515和Linux Error: 111LinuxError
- 啟動監聽報TNS-01150錯誤處理
- ORACLE listener監聽設定密碼Oracle密碼
- 【listener】oracle靜態監聽和動態監聽 【轉載】Oracle
- 設定 Oracle 監聽器密碼(LISTENER)Oracle密碼
- oracle動態和靜態監聽listenerOracle
- 【故障處理】【LISTENER】主機名修改為IP地址後LISTENER無法監聽到例項
- Oracle異常錯誤處理Oracle
- ORACLE 異常錯誤處理Oracle
- Oracle錯誤處理思路(一)Oracle
- listener監聽監控指令碼指令碼
- OGG-00751錯誤處理一例
- Oracle LISTENER監聽檔案引數詳解及Lsnrctl命令綜述Oracle
- rac scan listener log 清理監聽日誌 oracleOracle
- Oracle資料庫修改LISTENER的監聽埠Oracle資料庫
- oracle listener 靜態監聽與動態監聽的一些小事Oracle
- Oracle_CDC整理3-參考及錯誤處理Oracle
- oracle ora-00054錯誤處理Oracle
- OGG-01031錯誤處理一例
- 【LISTENER】修改監聽密碼導致NL-00051錯誤的分析與總結密碼
- npm 安裝錯誤及處理方法NPM
- Oracle監聽配置(ora-12514錯誤)Oracle
- 【監聽】配置服務端靜態(動態)監聽/修改監聽埠及引數local_listener作用服務端
- 【LISTENER】Oracle通過監聽連線緩慢分析Oracle
- 錯誤處理
- oracle ORA-14452錯誤處理Oracle
- oracle監聽器日誌過大-處理辦法Oracle
- Web中的監聽器【Listener】Web
- 動態註冊監聽Listener
- hadoop常見錯誤及處理方法Hadoop
- ORACLE監聽器 The listener supports no services 問題解決方法Oracle
- ORACLE之手動註冊監聽listener。alter system set local_listener="XXX"Oracle
- PHP 錯誤處理PHP
- php錯誤處理PHP