I will explain SCAN Listener in Oracle RAC in this post.
SCAN Listener in Oracle RAC
SCAN (Single Client Access Name ) is very critical feature ( High Availability ) in Oracle Real Application Clusters (Oracle RAC) architecture that provides a single name for clients to access Oracle Databases running in a cluster.
The SCAN name is a domain name registered to at least one and up to three IP addresses, either in Domain Naming Service (DNS) or Grid Naming Service (GNS).
If you used the SCAN Listener, Clients don’t need to change any TNS configuration after any nodes are down or adding,removing new nodes in the Cluster. This provides a High Availability for applications.
tnsnames.ora file for 3 nodes RAC is as follows prior to Oracle 11.2 version. You should add all nodes vip adress to TNS as follows.
ORCL = (DESCRIPTION = (ADDRESS_LIST = (LOAD_BALANCE = ON) (FAILOVER = ON) (ADDRESS = (PROTOCOL = tcp)(HOST = rac-node-01-vip.localdomain)(PORT =1521)) (ADDRESS = (PROTOCOL = tcp)(HOST = rac-node-02-vip.localdomain)(PORT =1521)) (ADDRESS = (PROTOCOL = tcp)(HOST = rac-node-03-vip.localdomain)(PORT =1521)) ) (CONNECT_DATA = (SERVICE_NAME = ORCLDB) ) )
ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcp)(HOST = rac-cluster-scan.localdomain)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = ORCLDB) ) )
[oracle@rac-node01 ~]$ srvctl config scan SCAN name: rac-scan, Network: 1 Subnet IPv4: 192.168.63.0/255.255.255.0/bondeth0, static Subnet IPv6: SCAN 0 IPv4 VIP: 192.168.63.12 SCAN VIP is enabled. SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes: SCAN 1 IPv4 VIP: 192.168.63.13 SCAN VIP is enabled. SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes: SCAN 2 IPv4 VIP: 192.168.63.14 SCAN VIP is enabled. SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes: [oracle@rac-node01 ~]$ [oracle@rac-node01 ~]$ [oracle@rac-node01 ~]$ srvctl config scan_listener SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521 Registration invited nodes: Registration invited subnets: SCAN Listener is enabled. SCAN Listener is individually enabled on nodes: SCAN Listener is individually disabled on nodes: SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521 Registration invited nodes: Registration invited subnets: SCAN Listener is enabled. SCAN Listener is individually enabled on nodes: SCAN Listener is individually disabled on nodes: SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521 Registration invited nodes: Registration invited subnets: SCAN Listener is enabled. SCAN Listener is individually enabled on nodes: SCAN Listener is individually disabled on nodes: [oracle@rac-node01 ~]$ [oracle@rac-node01 ~]$ [oracle@rac-node01 ~]$ srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is running on node rac-node01 SCAN Listener LISTENER_SCAN2 is enabled SCAN listener LISTENER_SCAN2 is running on node rac-node02 SCAN Listener LISTENER_SCAN3 is enabled SCAN listener LISTENER_SCAN3 is running on node rac-node02 [oracle@rac-node01 ~]$ [oracle@rac-node01 ~]$ [oracle@rac-node01 ~]$ srvctl status scan SCAN VIP scan1 is enabled SCAN VIP scan1 is running on node rac-node01 SCAN VIP scan2 is enabled SCAN VIP scan2 is running on node rac-node02 SCAN VIP scan3 is enabled SCAN VIP scan3 is running on node rac-node02 [oracle@rac-node01 ~]$
What is the Oracle RAC and Architecture of Real Application Cluster
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )