11gR2 new features: SCAN


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.

, , ,

  1. #1 by Anonymous on November 26th, 2009

    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 )

  2. #2 by Jay Caviness on November 30th, 2009

    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.

  3. #3 by Mike on December 7th, 2009

    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?

  4. #4 by Nrsun on January 6th, 2010

    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 ?

  5. #5 by Sri on February 9th, 2010

    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?

  6. #6 by tim carroll on February 23rd, 2010

    Yes – you can still use scan for specific instance – just use instance_name in tnsnames.ora

(will not be published)

  1. No trackbacks yet.