11G R2 RAC add listen, 11gr2rac listen
The procedure is as follows:
Check the network number of the default network, in the red font of 1. It will be used to add a listener later:
[grid@rac121 admin]$ srvctl config networkNetwork exists: 1/10.1.252.0/255.255.255.0/eth0, type static
View the syntax for adding a listener to srvctl:
[Grid @ rac121 admin] $ srvctl add listener-hAdds a listener configuration to the Oracle Clusterware. usage: srvctl add listener [-l <lsnr_name>] [-s] [-p "[TCP:] <port> [,...] [/IPC: <key>] [/NMP: <pipe_name>] [/TCPS: <s_port>] [/SDP: <port>] "] [-o <oracle_home>] [-k <net_num>]-l <lsnr_name> Listener name (default name is LISTENER) # listener name-o <oracle_home> ORACLE_HOME path (default value is CRS_HOME) # HOME-k of grid <net_num> network number (default number is 1) # the first check of the network number-s Skip the checking of ports-p "[TCP:] <port> [,...] [/IPC: <key>] [/NMP: <pipe_name>] [/TCPS: <s_port>] [/SDP: <port>] "Comma separated tcp ports or listener endpoints # port number to be added-h Print usage
Add a listener: Name: LISTENER4 port: 1524
[grid@rac121 ~]$ srvctl add listener -l LISTENER4 -o $ORACLE_HOME -p 1524 -k 1[grid@rac121 ~]$ srvctl start listener -l LISTENER4
After creation, record information will be added to the configuration file endpoints_listener.ora and listener. ora:
[grid@rac121 admin]$ ls endpoints_listener.ora listener1206183PM1248.bak listener.ora samples sqlnet1206199AM0038.bakendpoints_listener.ora.bak.rac121 listener1206199AM0038.bak listener.ora.bak.rac121 shrept.lst sqlnet.ora
View the added information: The red font of the two files
[grid@rac121 admin]$ cat listener.ora LISTENER4=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER4)))) # line added by Agent NEW_RACDB_LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=NEW_RACDB_LISTENER)))) # line added by Agent# listener.ora Network Configuration File: /oradata/oracleapp/11.2.0/grid/network/admin/listener.ora# Generated by Oracle configuration tools. [grid@rac121 admin]$ cat endpoints_listener.ora LISTENER4_RAC121=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac121-vip)(PORT=1524))(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.252.121)(PORT=1524)(IP=FIRST)))) # line added by Agent NEW_RACDB_LISTENER_RAC121=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac121-vip)(PORT=1523))(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.252.121)(PORT=1523)(IP=FIRST)))) # line added by AgentRACDB_LISTENER_RAC121=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac121-vip)(PORT=1522))(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.252.121)(PORT=1522)(IP=FIRST)))) # line added by AgentLISTENER_RAC121=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac121-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.252.121)(PORT=1521)(IP=FIRST)))) # line added by Agent
Now you have added the listener and added the static registration information. Add the following content to the vi listener. ora file:
SID_LIST_LISTENER4 = # listener name (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = RACDB) (ORACLE_HOME =/oradata/oracleapp/11.2.0/grid) (SID_NAME = RACDB1) # SID corresponding to the node ))
Restart the listener to complete static registration:
[grid@rac121 admin]$ srvctl stop listener -l LISTENER4[grid@rac121 admin]$ srvctl start listener -l LISTENER4[grid@rac121 admin]$ lsnrctl status LISTENER4LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 19-JUN-2012 15:48:47Copyright (c) 1991, 2011, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER4)))STATUS of the LISTENER------------------------Alias LISTENER4Version TNSLSNR for Linux: Version 11.2.0.3.0 - ProductionStart Date 19-JUN-2012 15:48:35Uptime 0 days 0 hr. 0 min. 11 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /oradata/oracleapp/11.2.0/grid/network/admin/listener.oraListener Log File /oradata/oracleapp/11.2.0/grid/log/diag/tnslsnr/rac121/listener4/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER4))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.252.121)(PORT=1524))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.252.75)(PORT=1524)))Services Summary...Service "RACDB" has 1 instance(s). Instance "RACDB1", status UNKNOWN, has 1 handler(s) for this service...The command completed successfully[grid@rac121 admin]$
View the status of all listeners:
grid@rac121 admin]$ srvctl status listenerListener LISTENER is enabled Listener LISTENER is running on node(s): rac121,rac122Listener LISTENER4 is enabled Listener LISTENER4 is running on node(s): rac121,rac122Listener NEW_RACDB_LISTENER is enabled Listener NEW_RACDB_LISTENER is running on node(s): rac121,rac122Listener RACDB_LISTENER is enabled Listener RACDB_LISTENER is running on node(s): rac121,rac122
View the configurations of each listener:
[grid@rac121 admin]$ srvctl config listener -a Name: LISTENERNetwork: 1, Owner: gridHome: <CRS home> /oradata/oracleapp/11.2.0/grid on node(s) rac122,rac121End points: TCP:1521Name: LISTENER4Network: 1, Owner: gridHome: <CRS home> /oradata/oracleapp/11.2.0/grid on node(s) rac122,rac121End points: TCP:1524Name: NEW_RACDB_LISTENERNetwork: 1, Owner: gridHome: <CRS home> /oradata/oracleapp/11.2.0/grid on node(s) rac122,rac121End points: TCP:1523Name: RACDB_LISTENERNetwork: 1, Owner: gridHome: <CRS home> /oradata/oracleapp/11.2.0/grid on node(s) rac122,rac121End points: TCP:1522
Now, the srvctl management tool is used to add new listeners and static registration tasks.