11gR2 new features: SCAN September 22, 2009
Posted by grumpydba in 11gR2, RAC.Tags: 11gR2, SCAN, single client access name, VIP
trackback
One really nice new feature of 11gR2 is the SCAN (single client access name). A scan is the single point of access for all applications connecting to an 11gR2 RAC cluster and allows consistent connections without the need to know how many nodes are in a cluster. Vips are still used internally, and can still be used for connections, but the initial connection to the cluster is made via a scan. Connections to any database in a cluster will be made via the scan. No longer will a DBA need to create those large, complicated tnsnames.ora or jdbc (thin) connection strings. All can be accessed by a scan:
sqlplus joeuser/joespasswd@dodge-scan:1521/proddb or jdbc:oracle:thin:@dodge-scan:1521/proddb
One scan is needed for each cluster, it is a single DNS entry with three IP addresses attached to the name and set to round-robin (unless using GNS, but that is another post). The IP addresses must be unused (similar to a VIP). A good naming technique would be to name the scan after the cluster it is created for. For example, one of the clusters I use regularly contains three nodes, caravan, stratus and durango, affectionately called the Dodge cluster thus the name of the scan to be used. Once the networking folks have created the DNS entry it is ready to use. The scan is created in the cluster at installation. Note that VIPs are still needed and must still reside in DNS.
Anatomy of a SCAN
How does it all work? A new set of cluster processes called scan listeners will run on three nodes in a cluster. If you have more than three nodes, that is ok, regardless of the number of nodes you have, there will be at most three scan listeners. If any of these clustered processes fail, they are automatically restarted on a new node. When a new connection request is made, the request hits DNS on the scan name, DNS will round robin and choose one of the three IP addresses assigned to that scan name and route it to the correct scan listener. Each scan listener keeps updated cluster load statistics and will then route the request to the appropriate VIP IP which is returned to the requesting service. The requesting service will then connect directly to the returned VIP as in previous versions and the connection is made through a standard listener.
Can connections still be made directly to through the VIPs? Yes, connections via the virtual IP addresses are still supported, though I cannot see a reason to use the old method as yet. Will RAC services work with the scan? Yes, there is no difference in that functionality. SCANs are a layer on top of the old method of connecting to a RAC database and do not interfere with any current methods.
The SCAN provides a simple and effective mean to connect to any and all instances in a cluster without the need to hard code connection information which can change. This has been needed for years and is one of the best new features of 11gR2 to prevent headaches for DBAs in the future.
Hi,
Thx for the nice explaination about SCAN.
I want to know, on a 2 node RAC, whether i should have separate SCAN IP for both nodes ?
Also, can i use /etc/hosts file to defince SCAN. ( Because i am trying this on Vmware )
No, you should only have one SCAN per cluster, the round-robin IPs will resolve to whichever nodes is least loaded. I don’t believe you can create a round-robin SCAN withing /etc/hosts as there is no way that I know of to have three IP addresses point to the same hostname. You can still use the VIPs to connect to your databases, though it is not recommended because it will not give the same HA functionality as the SCAN.
I’m still a little confused on how to setup the SCAN.
For example, I’ve got a 2 node cluster
oradb-0a
oradb-0b
each of those has a public IP, a private IP, and a VIP
When I go to define the SCAN in dns, do i just point it to 2 arbitrary IP’s on the same subnet, or do I give it the public or VIP’s of the 2 nodes?
I am not sure what we get by using scan. in a real world production , you want to be able to control where connections are heading. The main advantage of RAC is applicaiton partitioning and with SCAN you can not achive it. So why make it mandatory.. ? How can I bypass the 11GR2 installation with out SCAN ?
Can you add additional SCAN vips after initial installation. Initially we used only 2 vips say. Now we want to add a third SCAN listener. Can it be done?
Yes – you can still use scan for specific instance – just use instance_name in tnsnames.ora
Hello,
I have the same query as #3 by Mike on December 7th, 2009.
Answers anyone? Do we need to reserve new IPs or can existing VIPs be used?
Thanks!
Suhas
Yes, reserving the three new IP addresses (on tip of the VIPs) is necessary. The SCAN is a layer of abstraction above the VIPs. The round-robin connections will send a connection request to a specific node (if available), the clusterware will then route the the appropriate VIP based on availability and load balancing. If the host to which one of the SCAN IPs fails, the clusterware will reset the IP to another host in the cluster.
Do you have to use a SCAN? no, it is not absolutely required, however, it is a better load balancing process than prior versions, and makes it much simpler to add or remove a node from the cluster.
Dear Jay,
Thanks very much for the kind reply.
I intend to use recommended procedures so I do want to implement SCAN.
I have some more queries: Would an entry in DNS suffice (with DHCP) or GNS is mandatory? Going by documents, I think either of them should suffice, right?
What about the administration bit? Which method would be more easier to manage?
Thanks again for the inputs.
Regards,
Suhas
Hi,
what is the difference b/w clustering using GNS and DNS