天天看點

【RAC】lsnrctl 工具不适合管理監聽

oracle 11gr2 不應使用lsnrctl管理LISTENER,而需使用srvctl或crsctl工具管理,<b>否則lsnrctl将不會識别endpoints_listener.ora中的資訊</b>,造成監聽沒有在必要位址、端口上工作。

grid@rac1:/home/grid&gt;<b>cat /opt/11202/11.2.0/grid/network/admin/endpoints_listener.ora </b>

LISTENER_RAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=10.250.7.225)(PORT=1521)(IP=FIRST))))        <b> # line added by Agent</b>

grid@rac1:/home/grid&gt;<b>cat /opt/11202/11.2.0/grid/network/admin/listener.ora </b>          

LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))           <b> # line added by Agent</b>

LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent

grid@rac1:/home/grid&gt;

<b>grid@rac1:/home/grid&gt;lsnrctl status</b>

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 04-DEC-2011 22:15:09

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production

Start Date                03-DEC-2011 22:55:26

Uptime                    0 days 23 hr. 19 min. 42 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/11202/11.2.0/grid/network/admin/listener.ora

Listener Log File         /opt/rac/grid/diag/tnslsnr/rac1/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.250.7.225)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.250.7.111)(PORT=1521)))

Services Summary...

Service "rac" has 1 instance(s).

  Instance "rac1", status READY, has 1 handler(s) for this service...

Service "racXDB" has 1 instance(s).

The command completed successfully

grid@rac1:/home/grid&gt;lsnrctl reload

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 04-DEC-2011 22:15:36

grid@rac1:/home/grid&gt;lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 04-DEC-2011 22:15:38

Uptime                    0 days 23 hr. 20 min. 12 sec

The listener supports no services

使用srvctl 工具重新啟動監聽

grid@rac1:/home/grid&gt;<b>srvctl stop listener</b>

grid@rac1:/home/grid&gt;<b>srvctl status listener</b>

監聽程式 LISTENER 已啟用

監聽程式 LISTENER 未運作

grid@rac1:/home/grid&gt;srvctl start listener 

grid@rac1:/home/grid&gt;srvctl status listener

監聽程式 LISTENER 正在節點上運作: rac2,rac1

grid@rac1:/home/grid&gt;lsnrctl status         

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 04-DEC-2011 22:16:52

Start Date                04-DEC-2011 22:16:40

Uptime                    0 days 0 hr. 0 min. 11 sec

繼續閱讀