What is SCAN in RAC

What is SCAN in Oracle 11g R2 RAC?


Single client access name (SCAN) is meant to facilitate single name for all Oracle clients to connect to the cluster database, irrespective of number of nodes and node location. Until now, we have to keep adding multiple address records in all clients tnsnames.ora, when a new node gets added to or deleted from the cluster.

Other Hand

Oracle 11g R1 RAC, client connection to RAC Cluster will use each node VIP (virtual IP) address. So each time a node is added to the cluster, the client tnsnames.ora file needs to be updated with the new VIP addition.
Oracle 11g R2 RAC introduces SCAN (Single Client Access Name) to handle that problem. SCAN provides single name from clients to access the database running in the cluster.
This is also very beneficial for client connecting using JDBC thin URLs and EZCONNECT to cluster with single hostname.
SCAN components in a cluster:
  • SCAN Name
  • SCAN IP, Oracle recommends 3 IP addresses for SCAN for a cluster
  • SCAN Listener
SCAN Name will represent the cluster in the network. SCAN Name needs to be registered in DNS and resolved using round-robin algorithm. To test the round-robin algorithm, perform nslookup on the SCAN Name. The DNS server should return those 3 set of IP Address in different order each time
Note: SCAN feature will not work with ip addresses resolved using /etc/hosts file. You would only get SCAN components online on one of the node in the cluster.

Updating SCAN Configuration in RAC

I have a 2 node Linux RAC setup on virtual box. I initially configure the SCAN using /etc/hosts file and that’s why I only see the SCAN Listener only up in one of the nodes. If that node fail, my client would not be able to connect to the database in the cluster.
So to have SCAN Listener running on more than one node, I asked my DNS admin to register the SCAN Name in the DNS server with the round-robin algorithm.
To test the round-robin algorithm, I did an nslookup command twice.
C:\Users>nslookup lasrac-scan
Server: dns.localdomain.com
Address: 172.28.85.42
Name: lasrac-scan.localdomain.com
Addresses: 172.28.172.18
172.28.172.17
172.28.172.19
Doing it again…
C:\Users>nslookup lasrac-scan
Server: dns.localdomain.com
Address: 172.28.85.42
Name: lasrac-scan.localdomain.com
Addresses: 172.28.172.17
172.28.172.19
172.28.172.18
See that ip address .18 appeared as the first ip address and then become the last (second nslookup output)
Going back to one of the node
Check the SCAN IP config
[root@lasrac01 ~]# srvctl config scan
SCAN name: lasrac-scan, Network: 1/172.28.172.0/255.255.252.0/eth0
SCAN VIP name: scan1, IP: /lasrac-scan.localdomain.com/172.28.172.17
To add the SCAN IP to the cluster
[root@lasrac01 ~]# srvctl modify scan -n lasrac-scan
Check the SCAN IP config again
[root@lasrac01 ~]# srvctl config scan
SCAN name: lasrac-scan, Network: 1/172.28.172.0/255.255.252.0/eth0
SCAN VIP name: scan1, IP: /lasrac-scan.localdomain.com/172.28.172.17
SCAN VIP name: scan2, IP: /lasrac-scan.localdomain.com/172.28.172.19
SCAN VIP name: scan3, IP: /lasrac-scan.localdomain.com/172.28.172.18
You have 3 SCAN IP now…this is good.
Check the status of SCAN IP
[root@lasrac01 ~]# srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node lasrac01
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node lasrac02
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node lasrac01
Now we need to update the SCAN Listener config too.
Check SCAN Listener Config
-bash-3.2$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
Modify SCAN Listener config
[root@lasrac01 ~]# srvctl modify scan_listener -u
Check the SCAN Listener again
[root@lasrac01 ~]# 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
You get 3 SCAN Listener now

No comments:

ORA-08004: sequence IEX_DEL_BUFFERS_S.NEXTVAL exceeds MAXVALUE

 Error:- IEX: Scoring Engine Harness Error - ORA-08004: sequence IEX_DEL_BUFFERS_S.NEXTVAL exceeds MAXVALUE (Doc ID 2056754.1) SYMPTOMS:- Yo...