Adds a listener to every node in a cluster.
Use the srvctl add listener
command with one of the following syntax models:
To create an Oracle Database listener:
srvctl add listener [-listener listener_name] [-netnum network_number] [-oraclehome Oracle_home] -user user_name [-endpoints "[TCP:]port_list[/IPC:key] [/NMP:pipe_name][/TCPS:s_port][/SDP:port]"] [-skip]
To create an Oracle ASM listener:
srvctl add listener [-listener listener_name] -asmlistener [-subnet subnet] [-endpoints "[TCP:]port_list[/IPC:key][/NMP:pipe_name][/TCPS:s_port][/SDP:port]"] [-skip]
To create a Leaf listener:
srvctl add listener [-listener listener_name] -leaflistener [-subnet subnet] [-endpoints "[TCP:]port_list[/IPC:key][/NMP:pipe_name][/TCPS:s_port][/SDP:port]"] [-skip]
To create a SCAN listener, use the srvctl add scan_listener
command. To create a management listener (for the CHM repository), use the srvctl add mgmtlsnr
command.
Table A-11 srvctl add listener Parameters
Parameter | Description |
---|---|
-listener listener_name |
Specify a listener name. This parameter is optional. If you do not specify this parameter, then the name of the listener defaults to |
-netnum network_number |
The optional network number from which VIPs are obtained. If not specified, the VIPs are obtained from the same default network from which the Note: Use this parameter when you add an Oracle Database listener. |
-oraclehome oracle_home |
Specify an Oracle home for the cluster database. If you do not include this parameter, then SRVCTL uses the Grid home by default. Note: Use this parameter when you add an Oracle Database listener. |
-user user_name |
Use this parameter to set the user that will run the listener to a less privileged user. Oracle recommends using this parameter to increase security. Notes:
|
-endpoints "[TCP:]port_list[/IPC:key] [/NMP:pipe_name][/TCPS:s_port] [/SDP:port] |
Protocol specifications for the listener. If you do not specify the Note: You can modify this attribute using Online Resource Attribute Modification. |
-skip |
Indicates you want to skip the checking of ports. |
-asmlistener |
Specifies the listener type as an Oracle ASM listener. If you do not specify the Note: You can only use this parameter with Oracle Clusterware. |
-leaflistener |
Specifies the listener type is a Leaf Node listener. If you do not specify the Note: You can only use this parameter with Oracle Clusterware. |
-subnet subnet |
Specifies the subnet to use for an Oracle ASM or Leaf Node listener. Note: You can only use this parameter with Oracle Clusterware. |
You must run this command as root
user on Linux and UNIX platforms when you specify the -user
parameter.
The following command adds a listener named listener112
that is listening on ports 1341, 1342, and 1345 and runs from the Oracle home directory on every node in the cluster:
$ srvctl add listener -listener listener112 -endpoints "1341,1342,1345" -oraclehome /u01/app/oracle/product/12.1.0/db1