Manage SCAN Listeners in Oracle RAC Environment
Scan Listener is Single Client Access Name which is introduced in Oracle RAC Environment in 11gR2 version.
Benefits: It provide the single name for client to access any database running in cluster environment.If you add or remove the node from the cluster then no need to modified the client network connectivity.
You can use scan listener feature with two connectivity ways:
EZConnect and Thin JDBC Connect Strings
EZconnet: sqlplus system/manager@rac-scan:1521/orcl
JDBC connect: jdbc:oracle:thin:@rac-scan:1521/orcl
If you face any issue in Scan Listener. you need to check first that scan name is resolved at network level with following command:
nslookup rac-scan
Check the configuration of Scan Listener
srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
srvctl config scan
SCAN name: sales1-scan, Network: 1/10.60.60.0/255.255.255.0/
SCAN VIP name: scan1, IP: /rac-scan.oracle.com/10.60.60.11
SCAN VIP name: scan2, IP: /rac-scan.oracle.com/10.60.60.12
SCAN VIP name: scan3, IP: /rac-scan.oracle.com/10.60.60.13
Check the status of scan listener
srvctl status scan_listener
Start the scan listener
srvctl start scan_listener
Stop the scan listener
srvctl stop scan_listener
Verify on both RAC nodes it working:
[grid@rac01 ~]$ ps -ef | grep -i tns
grid 9052 1 0 Aug09 ? 00:00:01 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid 9098 1 0 Aug09 ? 00:00:01 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit
grid 21388 20424 0 05:06 pts/1 00:00:00 grep -i tns
[grid@rac01 ~]$
[grid@rac02 ~]$ ps -ef | grep -i tns
grid 1323 1292 0 05:07 pts/0 00:00:00 grep -i tns
grid 9110 1 0 Aug09 ? 00:00:02 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid 17278 1 0 Aug09 ? 00:00:01 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN2 -inherit
grid 17285 1 0 Aug09 ? 00:00:01 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN3 -inherit