My 11gR2 grid infrastructure completed with only one scan listener. The following log shows that ....
...
...
The above session data clearly shows there is only one scan listener configured. When we use scan name in tnsnames.ora, the client connections will be established to database only when the scan name resolves to valid IP address.
But with the above configurations, the client connections some times may fail when the SCAN is resolving to 133.22.67.193 or 133.22.67.194. It establishes connection only when the SCAN resolves to 133.22.67.192.
...
...
My 11gR2 grid infrastructure completed with only one scan listener. The following log shows that ....
[grid@rac01 grid]$ srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192
[grid@rac01 grid]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
[grid@rac01 grid]$
[grid@rac01 grid]$ ping rac-scan.example.com
PING rac-scan.example.com (133.22.67.193) 56(84) bytes of data.
From rac01.seo.int (133.22.38.50) icmp_seq=2 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=3 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=4 Destination Host Unreachable
--- rac-scan.example.com ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5000ms
, pipe 3
[grid@rac01 grid]$ ping rac-scan
PING rac-scan.example.com (133.22.67.194) 56(84) bytes of data.
From rac01.seo.int (133.22.38.50) icmp_seq=2 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=3 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=4 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=6 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=7 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=8 Destination Host Unreachable
--- rac-scan.example.com ping statistics ---
11 packets transmitted, 0 received, +6 errors, 100% packet loss, time 10000ms
, pipe 3
[grid@rac01 grid]$ ping rac-scan
PING rac-scan.example.com (133.22.67.192) 56(84) bytes of data.
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=2 ttl=64 time=0.054 ms
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=3 ttl=64 time=0.049 ms
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=4 ttl=64 time=0.063 ms
--- rac-scan.example.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.039/0.051/0.063/0.010 ms
[grid@rac01 grid]$
[grid@rac01 grid]$ host rac-scan
rac-scan.example.com has address 133.22.67.194
rac-scan.example.com has address 133.22.67.193
rac-scan.example.com has address 133.22.67.192
[grid@rac01 grid]$ nslookup rac-scan
Server: 133.22.5.53
Address: 133.22.5.53#53
Name: rac-scan.example.com
Address: 133.22.67.194
Name: rac-scan.example.com
Address: 133.22.67.192
Name: rac-scan.example.com
Address: 133.22.67.193
[grid@rac01 grid]$
[root@rac01 network-scripts]# host rac-scan
rac-scan.example.com has address 133.22.67.194
rac-scan.example.com has address 133.22.67.193
rac-scan.example.com has address 133.22.67.192
[root@rac01 network-scripts]#
rac-scan.example.com IN A 133.22.67.194
IN A 133.22.67.193
IN A 133.22.67.192
[grid@rac02 grid]$ Check_CRS.txt
HA Resource Target State
----------- ------ -----
ora.CRS.dg ONLINE ONLINE on rac01
ora.FRA.dg ONLINE ONLINE on rac01
ora.LISTENER.lsnr ONLINE ONLINE on rac01
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE on rac01
ora.RACDB_DATA.dg ONLINE ONLINE on rac01
ora.asm ONLINE ONLINE on rac01
ora.eons ONLINE ONLINE on rac01
ora.gsd OFFLINE OFFLINE
ora.net1.network ONLINE ONLINE on rac01
ora.oc4j OFFLINE OFFLINE
ora.ons ONLINE ONLINE on rac01
...
...
ora.rac02.vip ONLINE ONLINE on rac02
ora.rac10g.db ONLINE ONLINE on rac02
ora.rac10g.rac10g1.inst ONLINE ONLINE on rac01
ora.rac10g.rac10g2.inst ONLINE OFFLINE
ora.racpoc.askm1.svc ONLINE ONLINE on rac01
ora.racpoc.db ONLINE ONLINE on rac01
ora.registry.acfs ONLINE ONLINE on rac01
ora.scan1.vip ONLINE ONLINE on rac01
ora.testdb.db ONLINE ONLINE on rac01
TESTDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testdb.example.com)
)
)
The above session data clearly shows there is only one scan listener configured. When we use scan name in tnsnames.ora, the client connections will be established to database only when the scan name resolves to valid IP address.
But with the above configurations, the client connections some times may fail when the SCAN is resolving to 133.22.67.193 or 133.22.67.194. It establishes connection only when the SCAN resolves to 133.22.67.192.
SQL> conn test/test@testdb ==> Connection failed. rac-scan resolves either to 133.22.67.193 or 133.22.67.194
ERROR:
ORA-12543: TNS:destination host unreachable
SQL>conn test/test@testdb ==> Connection established.rac-scan resolves to 133.22.67.192.
connected
SQL>
Now to avoid this , we need to create two more scan listeners.
[grid@rac01 grid]$ srvctl stop scan_listener
[grid@rac01 grid]$ srvctl stop scan
[grid@rac01 grid]$ srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192
[grid@rac01 grid]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
[grid@rac01 grid]$ which srvctl
/u01/home/11.2.0/grid/bin/srvctl
[grid@rac01 grid]$
[grid@rac01 ~]$ srvctl status scanSCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac01
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node rac02
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node rac02
[grid@rac01 ~]$ srvctl status scan_listenerSCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac01
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac02
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac02
[grid@rac01 ~]$
[grid@rac01 ~]$ ps -ef | grep -i tnsgrid 9052 1 0 Aug09 ? 00:00:01 /o001/home/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid 9098 1 0 Aug09 ? 00:00:01 /o001/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 tnsgrid 1323 1292 0 05:07 pts/0 00:00:00 grep -i tns
grid 9110 1 0 Aug09 ? 00:00:02 /o001/home/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid 17278 1 0 Aug09 ? 00:00:01 /o001/home/11.2.0/grid/bin/tnslsnr
LISTENER_SCAN2 -inherit
grid 17285 1 0 Aug09 ? 00:00:01 /o001/home/11.2.0/grid/bin/tnslsnr
LISTENER_SCAN3 -inherit
[grid@rac02 ~]$
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan -h
Modifies the SCAN name.
Usage: srvctl modify scan -n <scan_name>
-n <scan_name> Domain name qualified SCAN name
-h Print usage
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan -n rac-scan
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.193
SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194
SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.192
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan_listener -u
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/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
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl start scan_listener
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.193
SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194
SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.192
[root@rac01 network-scripts]#
[grid@rac02 grid]$ Check_CRS.txt
HA Resource Target State
----------- ------ -----
ora.CRS.dg ONLINE ONLINE on rac01
ora.FRA.dg ONLINE ONLINE on rac01
ora.LISTENER.lsnr ONLINE ONLINE on rac01
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE on rac01
ora.LISTENER_SCAN2.lsnr ONLINE ONLINE on rac02
ora.LISTENER_SCAN3.lsnr ONLINE ONLINE on rac02
ora.RACDB_DATA.dg ONLINE ONLINE on rac01
ora.asm ONLINE ONLINE on rac01
ora.eons ONLINE ONLINE on rac01
ora.gsd OFFLINE OFFLINE
ora.net1.network ONLINE ONLINE on rac01
ora.oc4j OFFLINE OFFLINE
ora.ons ONLINE ONLINE on rac01
...
...
ora.rac02.vip ONLINE ONLINE on rac02
ora.rac10g.db ONLINE ONLINE on rac02
ora.rac10g.rac10g1.inst ONLINE ONLINE on rac01
ora.rac10g.rac10g2.inst ONLINE OFFLINE
ora.racpoc.askm1.svc ONLINE ONLINE on rac01
ora.racpoc.db ONLINE ONLINE on rac01
ora.registry.acfs ONLINE ONLINE on rac01
ora.scan1.vip ONLINE ONLINE on rac01
ora.scan2.vip ONLINE ONLINE on rac02
ora.scan3.vip ONLINE ONLINE on rac02
ora.testdb.db ONLINE ONLINE on rac01
[grid@rac02 grid]$
Hope it helps
SRI