【Oracle】lsnrctl reload 命令操作

楊奇龍發表於2011-09-13
上一篇簡單介紹了lsnrctl reload的原理!這篇文章實驗一下給資料庫增加靜態監聽,reload 監聽並檢視監聽器的日誌:
oracle@rac1:/opt/oracle/11.2.0/yangdb/network/admin>lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 13-SEP-2011 14:21:41
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                07-SEP-2011 10:29:51
Uptime                    6 days 3 hr. 51 min. 49 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/11.2.0/yangdb/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/patdb3/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))
The listener supports no services
The command completed successfully
編輯listener.ora 之後,reload 操作:
oracle@rac1:/opt/oracle/11.2.0/yangdb/network/admin>lsnrctl reload
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 13-SEP-2011 14:22:44
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1)(PORT=1521)))
The command completed successfully
再次檢視:
oracle@rac1:/opt/oracle/11.2.0/yangdb/network/admin>lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 13-SEP-2011 14:23:07
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                07-SEP-2011 10:29:51
Uptime                    6 days 3 hr. 53 min. 15 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/11.2.0/yangdb/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/patdb3/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "yangdb" has 1 instance(s).
  Instance "yangdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

另一個視窗檢視監聽日誌:
oracle@rac1:/home/oracle>tail -f  /opt/oracle/diag/tnslsnr/patdb3/listener/alert/log.xml
 type='UNKNOWN' level='16' host_id='rac1'
 host_addr='172.18.87.197'>
 13-SEP-2011 14:22:44 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=rac1)(USER=oracle))(COMMAND=reload)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=186647040)) * reload * 0
 

 type='UNKNOWN' level='16' host_id='rac1'
 host_addr='172.18.87.197'>
 WARNING: Subscription for node down event still pending
 

 type='UNKNOWN' level='16' host_id='rac1'
 host_addr='172.18.87.197'>
 13-SEP-2011 14:23:07 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=rac1)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=186647040)) * status * 0
 

PS:還做了一個對reload操作進行trace的跟蹤檔案,但是看不懂其天書般的內容,於是作罷!!!
對於 Subscription for node down event still pending
Oracle稱在較大壓力下,監聽程式可能出現間歇性停止服務,此時Oracle會spaw出另外一個監聽程式,進而導致兩個監聽程式互相影響的故障。
對於RAC 環境,一個是監聽SCAN的,另外一個則是本地的。
grid@rac1:/opt/11202/11.2.0/grid/network/trace>ps -ef | grep tnsl | grep -v grep
grid     18527     1  0 Sep07 ?        00:00:32 /opt/11202/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit
grid     31647     1  0 Sep08 ?        00:00:57 /opt/11202/11.2.0/grid/bin/tnslsnr LISTENER -inherit
下面是 oracle 官方的解釋:
Listener Subscription for ONS Node Down Event Information
Listener will subscribe to the Oracle Notification Service (ONS) node down event on startup if ONS configuration file is available. This subscription enables the listener to remove the affected service when it receives node down event notification from ONS. The listener uses asynchronous subscription for the event notification. The following warning message will be recorded to listener log file on each STATUS command if the subscription has not completed; for example if the ONS daemon is not running on the host.
WARNING: Subscription for node down event still pending
Listener will not be able to receive the ONS event while subscription is pending. Other than that, no other listener functionality is affected.

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

相關文章