资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

【RAC】srvctl管理工具添加新监听和静态注册

srvctl 添加监听的语法如下:
grid@rac1:/home/grid>srvctl add listener -h
将监听程序配置添加到 Oracle Clusterware。
用法: srvctl add listener [-l ] [-s] [-p "[TCP:][, ...][/IPC:][/NMP:][/TCPS:] [/SDP:]"] [-o ] [-k ]
    -l           监听程序名称 (默认名称为 LISTENER)
    -o         ORACLE_HOME 路径 (默认值为 CRS_HOME)
    -k             网络编号 (默认编号为 1)
    -s                       跳过端口检查
    -p "[TCP:][, ...][/IPC:][/NMP:][/TCPS:] [/SDP:]"       逗号分隔的 TCP 端口或监听程序端点
    -h                       输出用法
加入新的监听YANGQL
grid@rac1:/home/grid>srvctl add listener -l YANGQL -p 1524  -o $ORACLE_HOME 
grid@rac1:/home/grid>cat /opt/11202/11.2.0/grid/network/admin/listener.ora 
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
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>srvctl add listener -l YANGQL -p 1524  -o $ORACLE_HOME -k 1
PRCN-3004 : 监听程序YANGQL已存在
k 值在加入的时候,不做指定也是可以的!默认为1!
grid@rac1:/home/grid>
grid@rac1:/home/grid>
启动新加入的监听YANGQL ,
grid@rac1:/home/grid>srvctl start listener -l YANGQL
listener.ora ,endpoints_listener.ora 两个文件会多出 新加入的监听信息:
grid@rac1:/home/grid>cat /opt/11202/11.2.0/grid/network/admin/listener.ora      
YANGQL=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=YANGQL))))                # line added by Agent
grid@rac1:/home/grid>cat /opt/11202/11.2.0/grid/network/admin/endpoints_listener.ora 
YANGQL_RAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1524))(ADDRESS=(PROTOCOL=TCP)(HOST=10.250.7.225)(PORT=1524)(IP=FIRST))))         # line added by Agent
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))))               # line added by Agent
手工修改listener.ora 加入静态监听! 
grid@rac1:/home/grid>vim /opt/11202/11.2.0/grid/network/admin/listener.ora                   
SID_LIST_YANGQL =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = rac)
      (ORACLE_HOME = /opt/11202/11.2.0/grid)
      (SID_NAME =rac1)
    )
  )

YANGQL=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=YANGQL))))                # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
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
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_YANGQL=ON                # line added by Agent                                                                                                                                          
"/opt/11202/11.2.0/grid/network/admin/listener.ora" 15L, 665C 已写入                                                              
重新启动监听YANGQL
grid@rac1:/home/grid>srvctl stop listener -l YANGQL
grid@rac1:/home/grid>srvctl start  listener -l YANGQL 
查看其状态:   
grid@rac1:/home/grid>lsnrctl status YANGQL
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 04-DEC-2011 22:32:08
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=YANGQL)))
STATUS of the LISTENER
------------------------
Alias                     YANGQL
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                04-DEC-2011 22:31:59
Uptime                    0 days 0 hr. 0 min. 9 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/11202/11.2.0/grid/log/diag/tnslsnr/rac1/yangql/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=YANGQL)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.250.7.225)(PORT=1524)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.250.7.111)(PORT=1524)))
Services Summary...
Service "rac" has 1 instance(s).
  Instance "rac1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
grid@rac1:/home/grid>
至此,操作完毕,当然也可以使用图形界面工具来操作,但是个人觉得手工使用srvctl 工具更加方便!

当前题目:【RAC】srvctl管理工具添加新监听和静态注册
标题链接:http://cdkjz.cn/article/gijdcg.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220