[RAC] srvctl management tools add new monitoring and static registration
The syntax for srvctl to add listeners is as follows: grid@rac1:/home/grid > srvctl add listener-h adds listener configuration to Oracle Clusterware. Usage: srvctl add listener [- l] [- s] [- p "[TCP:] [ [/ IPC:] [/ NMP:] [/ TCPS:] [/ SDP:] "] [- o] [- k]-l listener name (default name is LISTENER)-o ORACLE_HOME path (default is CRS_HOME)-k network number (default number is 1)-s skip port check-p" [TCP:] [ [/ IPC:] [/ NMP:] [/ TCPS:] [/ SDP:] "Comma-separated TCP ports or listener endpoint-h output usage add a new listener YANGQLgrid@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= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=IPC) (KEY=LISTENER)) )) # line added by AgentLISTENER_SCAN1= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=IPC) (KEY=LISTENER_SCAN1) # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agentgrid@rac1:/home/grid > srvctl add listener-l YANGQL-p 1524-o $ORACLE_HOME-k 1PRCN-3004: the listener YANGQL already has a k value when it is added It's okay not to make a specification! The default is 1! Grid@rac1:/home/grid > grid@rac1:/home/grid > start the newly added listening YANGQL, grid@rac1:/home/grid > srvctl start listener-l YANGQLlistener.ora The new listening information will be added to the two files of 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 Agentgrid@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 AgentLISTENER_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 manually modify listener.ora to add static monitoring! 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 AgentLISTENER= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=IPC) (KEY=LISTENER) # line added by AgentLISTENER_SCAN1= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=IPC) (KEY=LISTENER_SCAN1) # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_YANGQL=ON # line added by Agent "/ opt/11202 / 11.2.0/grid/network/admin/listener.ora "15L 665C has been written to restart listening YANGQLgrid@rac1:/home/grid > srvctl stop listener-l YANGQLgrid@rac1:/home/grid > srvctl start listener-l YANGQL to check its status: grid@rac1:/home/grid > lsnrctl status YANGQLLSNRCTL for Linux: Version 11.2.0.2.0-Production on 04-DEC-2011 22:32:08Copyright (c) 1991, 2010, Oracle. All rights reserved.Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=YANGQL)) STATUS of the LISTENER----Alias YANGQLVersion TNSLSNR for Linux: Version 11.2.0.2.0-ProductionStart Date 04-DEC-2011 22:31:59Uptime 0 days 0 hr. 0 min. 9 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File / opt/11202/11.2.0/grid/network/admin/listener.oraListener Log File / opt/11202/11.2.0/grid/log/diag/tnslsnr/rac1/yangql/alert/log.xmlListening 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 successfullygrid@rac1:/home/grid > so far, after the operation, of course, you can also use graphical interface tools to operate, but I think it is more convenient to use srvctl tools by hand!