【故障處理】【LISTENER】主機名修改為IP地址後LISTENER無法監聽到例項
1.【環境資訊】
作業系統
ora10g@testdb /home/oracle$ uname -a
Linux testdb 2.6.18-53.el5xen #1 SMP Wed Oct 10 16:48:44 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
資料庫
sys@ora10g> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
2.【問題現象】
一句話描述:將listener.ora和tnsnames.ora檔案中的HOST資訊從原來的主機名字修改為IP地址後,監聽可以啟動,但是無論如何也監聽不到資料庫例項的資訊(即使反覆重啟資料庫)。
問題展開描述:
修改前的listener.ora內容如下:
ora10g@testdb /oracle/app/oracle/product/10.2.0/db_1/network/admin$ cat listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testdb)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
修改後的listener.ora內容如下:
ora10g@testdb /oracle/app/oracle/product/10.2.0/db_1/network/admin$ cat listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 144.194.192.183)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
對應的tnsnames.ora檔案中也同樣的將主機名testdb修改為IP地址144.194.192.183。
修改後重新啟動監聽,但是監聽一直保持在如下的狀態
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.194.192.183)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 21-JUL-2009 14:34:20
Uptime 0 days 0 hr. 0 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=144.194.192.183)(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.【問題原因】
罪魁禍首在/etc/hosts檔案!!
先看一下在我處理之前該檔案的內容:
[root@testdb ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 testdb localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
先提示到這裡,停一停,想一想,這到底是為什麼呢?如果您也遇到了這個問題,處理思路是什麼呢?
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
好了,不賣關子了,問題出在,在這種預設配置下(作業系統安裝後的狀態),主機名字和本機的IP地址沒有對應起來.
換一種好理解的方式講,在這種情況下如果您ping主機名testdb的話:
ora10g@testdb /home/oracle$ ping testdb
PING testdb (127.0.0.1) 56(84) bytes of data.
64 bytes from testdb (127.0.0.1): icmp_seq=1 ttl=64 time=0.076 ms
64 bytes from testdb (127.0.0.1): icmp_seq=2 ttl=64 time=0.052 ms
64 bytes from testdb (127.0.0.1): icmp_seq=3 ttl=64 time=0.053 ms
結果是主機名testdb直接對應到了127.0.0.1地址,沒有對應到正確的144.194.192.183地址!!
4.【問題解決】
(1)將/etc/hosts內容修改為:
[root@testdb ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
144.194.192.183 testdb
比較一下與之前檔案的不同,這裡修改的內容如下:
1)將127.0.0.1後面的testdb主機名刪除
2)新增IP地址和主機名對應關係144.194.192.183 testdb
透過ping主機名testdb的方式驗證一下修改後的效果:
ora10g@testdb /home/oracle$ ping testdb
PING testdb (144.194.192.183) 56(84) bytes of data.
64 bytes from testdb (144.194.192.183): icmp_seq=1 ttl=64 time=0.082 ms
64 bytes from testdb (144.194.192.183): icmp_seq=2 ttl=64 time=0.047 ms
64 bytes from testdb (144.194.192.183): icmp_seq=3 ttl=64 time=0.050 ms
到此,主機名testdb與IP地址144.194.192.183建立起了對應關係。
(2)重新啟動監聽
LSNRCTL> stop
LSNRCTL> start
Starting /oracle/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=144.194.192.183)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.194.192.183)(PORT=1521)(IP=FIRST)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 21-JUL-2009 15:05:08
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=144.194.192.183)(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
LSNRCTL>
過大概半分鐘的樣子,LISTENER即可監聽到資料庫的例項ora10g:
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.194.192.183)(PORT=1521)(IP=FIRST)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 21-JUL-2009 15:05:08
Uptime 0 days 0 hr. 0 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=144.194.192.183)(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 "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
The command completed successfully
5.總結
資料庫的任何修改都是存在風險的,即使您“覺得”沒有問題,永遠記得“墨菲定律”--Anything that can go wrong will go wrong!
(1)任何事都沒有表面看起來那麼簡單;
(2)所有的事都會比你預計的時間長;
(3)會出錯的事總會出錯;
(4)如果你擔心某種情況發生,那麼它就更有可能發生。
所以,在做任何事情之前都要充分的測試,否則就有可能被“墨菲”到!
-- The End --
作業系統
ora10g@testdb /home/oracle$ uname -a
Linux testdb 2.6.18-53.el5xen #1 SMP Wed Oct 10 16:48:44 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
資料庫
sys@ora10g> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
2.【問題現象】
一句話描述:將listener.ora和tnsnames.ora檔案中的HOST資訊從原來的主機名字修改為IP地址後,監聽可以啟動,但是無論如何也監聽不到資料庫例項的資訊(即使反覆重啟資料庫)。
問題展開描述:
修改前的listener.ora內容如下:
ora10g@testdb /oracle/app/oracle/product/10.2.0/db_1/network/admin$ cat listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testdb)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
修改後的listener.ora內容如下:
ora10g@testdb /oracle/app/oracle/product/10.2.0/db_1/network/admin$ cat listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 144.194.192.183)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
對應的tnsnames.ora檔案中也同樣的將主機名testdb修改為IP地址144.194.192.183。
修改後重新啟動監聽,但是監聽一直保持在如下的狀態
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.194.192.183)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 21-JUL-2009 14:34:20
Uptime 0 days 0 hr. 0 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=144.194.192.183)(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.【問題原因】
罪魁禍首在/etc/hosts檔案!!
先看一下在我處理之前該檔案的內容:
[root@testdb ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 testdb localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
先提示到這裡,停一停,想一想,這到底是為什麼呢?如果您也遇到了這個問題,處理思路是什麼呢?
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
思考ing ……
好了,不賣關子了,問題出在,在這種預設配置下(作業系統安裝後的狀態),主機名字和本機的IP地址沒有對應起來.
換一種好理解的方式講,在這種情況下如果您ping主機名testdb的話:
ora10g@testdb /home/oracle$ ping testdb
PING testdb (127.0.0.1) 56(84) bytes of data.
64 bytes from testdb (127.0.0.1): icmp_seq=1 ttl=64 time=0.076 ms
64 bytes from testdb (127.0.0.1): icmp_seq=2 ttl=64 time=0.052 ms
64 bytes from testdb (127.0.0.1): icmp_seq=3 ttl=64 time=0.053 ms
結果是主機名testdb直接對應到了127.0.0.1地址,沒有對應到正確的144.194.192.183地址!!
4.【問題解決】
(1)將/etc/hosts內容修改為:
[root@testdb ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
144.194.192.183 testdb
比較一下與之前檔案的不同,這裡修改的內容如下:
1)將127.0.0.1後面的testdb主機名刪除
2)新增IP地址和主機名對應關係144.194.192.183 testdb
透過ping主機名testdb的方式驗證一下修改後的效果:
ora10g@testdb /home/oracle$ ping testdb
PING testdb (144.194.192.183) 56(84) bytes of data.
64 bytes from testdb (144.194.192.183): icmp_seq=1 ttl=64 time=0.082 ms
64 bytes from testdb (144.194.192.183): icmp_seq=2 ttl=64 time=0.047 ms
64 bytes from testdb (144.194.192.183): icmp_seq=3 ttl=64 time=0.050 ms
到此,主機名testdb與IP地址144.194.192.183建立起了對應關係。
(2)重新啟動監聽
LSNRCTL> stop
LSNRCTL> start
Starting /oracle/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=144.194.192.183)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.194.192.183)(PORT=1521)(IP=FIRST)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 21-JUL-2009 15:05:08
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=144.194.192.183)(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
LSNRCTL>
過大概半分鐘的樣子,LISTENER即可監聽到資料庫的例項ora10g:
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=144.194.192.183)(PORT=1521)(IP=FIRST)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 21-JUL-2009 15:05:08
Uptime 0 days 0 hr. 0 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=144.194.192.183)(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 "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
The command completed successfully
5.總結
資料庫的任何修改都是存在風險的,即使您“覺得”沒有問題,永遠記得“墨菲定律”--Anything that can go wrong will go wrong!
(1)任何事都沒有表面看起來那麼簡單;
(2)所有的事都會比你預計的時間長;
(3)會出錯的事總會出錯;
(4)如果你擔心某種情況發生,那麼它就更有可能發生。
所以,在做任何事情之前都要充分的測試,否則就有可能被“墨菲”到!
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-609799/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 主機名修改為IP地址後LISTENER無法監聽到例項
- 【故障處理】修改主機名導致oracle例項無法啟動暨如何修改hostnameOracle
- 【LISTENER】修改 LISTENER的監聽埠為1526(動態註冊)
- 【LISTENER】修改 LISTENER的監聽埠為1526(靜態註冊)
- 【LISTENER】謹防相同的 IPC key導致多監聽無法啟動--TNS-1106故障處理
- Oracle資料庫修改LISTENER的監聽埠Oracle資料庫
- solaris 主機修改主機名 ip地址 步驟
- Web中的監聽器【Listener】與過濾器【Filter】 例項Web過濾器Filter
- listener監聽監控指令碼指令碼
- 改主機名後Oracle OEM無法使用處理方法Oracle
- oracle listener 監聽啟動不起來處理案例一則Oracle
- Web中的監聽器【Listener】Web
- 動態註冊監聽Listener
- listener_scan1.log、listener.log監聽日誌清理
- oracle一個listener偵聽多個例項的配置Oracle
- 【LISTENER】Oracle監聽TNS-12545及TNS-00515錯誤處理一例Oracle
- 【監聽】listener.ora檔案理解
- ORACLE listener監聽設定密碼Oracle密碼
- 【listener】oracle靜態監聽和動態監聽 【轉載】Oracle
- 【監聽】配置服務端靜態(動態)監聽/修改監聽埠及引數local_listener作用服務端
- 設定 Oracle 監聽器密碼(LISTENER)Oracle密碼
- 管理監聽器日誌listener.log
- oracle動態和靜態監聽listenerOracle
- 【LISTENER】實現將資料庫例項同時動態註冊到兩個非預設監聽埠資料庫
- ORACLE之手動註冊監聽listener。alter system set local_listener="XXX"Oracle
- Solaris - 修改IP和主機名
- rac scan listener log 清理監聽日誌 oracleOracle
- 同一Server上兩個資料庫例項共用listener.ora ,監聽多個埠Server資料庫
- HP-UX修改主機IP地址UX
- 識別主機名和IP地址
- 14IP地址、主機名、域名
- 【Solaris】Solaris10作業系統 修改ip地址、主機名作業系統
- oracle之 單例項監聽修改埠Oracle單例
- 【Oracle】11gR2 grid單機使用asm儲存修改主機名後導致的故障處理OracleASM
- 【LISTENER】Oracle分析連線監聽情況,判斷客戶端IP分佈Oracle客戶端
- oracle listener 靜態監聽與動態監聽的一些小事Oracle
- 2.5.2. 監聽程式(listener)配置——2.5.2.2. netmgr
- 【LISTENER】Oracle通過監聽連線緩慢分析Oracle