Friday, May 17, 2013

Database - About SCAN --11GR2

Scan is introduced in 11G2 Grid infrastructe distributed with Oracle Database.
Scan is configured in the installation of the Grid Infrastructure, which is an Oracle Home that contains Oracle ASM and Oracle Clusterware.
SCAN stands for Single Client Access Name. It s a RAC feature and provides single hostname for the client to access databases in the cluster.
By using scan, Clients will use one and only hostname (scan name) to connect databases in the cluster. This also means, even if a new node is added to the cluster or a node removed from the cluster, client's connection strings (for example: tns entries in tnsnames.ora) will not need to be changed or modified.
So one simple connection string (like EZConnect) will provide cluster access.
SCAN provides Failover and load balancing for the connections, through its integrated conceptual design.

Scan concepts works like below;

  • Tree associated scan name and ip's are registered in DNS.
  • DNS query, issued by Client, will return 3 ip address like a list. ( The order of the ip address in the list are determined by the Round Robin algorithm used in DNS)
  • Client will use one of the ip addresses returned from server, and send a connection request. If first ip address returns an error, client will continue with the second one, and so on.
  • Connection request will be sent to the associated Scan listener.(Specified by the REMOTE_LISTENER parameter like : remote_listener=test.host.com:1521)
  • Scan listener will take the request and direct it to the least crowded Instance through the Local listener of that Instance.   (specified by the LOCAL_LISTENER parameter like local_listener=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.9)(PORT=1521))))   
  • Local listener will be listening the requests for the instance registered to it. Local listener will be listening on the Vip configured on its node. Vip configuration is needed because, it is an important concept for being redundant.So the actual connection to the database will be made by the local listener.. 
  • If  a node fails, related vip's will be migrated to surviving nodes. Clients will encounter an error immeditely. They will be aware of this failover, and reconnect to the surviving nodes without making any changes.





This process works if Client and Db versions are 11GR2. For older versions; scan can not be used -- for example client will not be able to handle 3 ip addresses returned from DNS.)

For oder versions something like the following tns should be used;


TEST =(DESCRIPTION=
(ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON)
 (ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.10)(PORT=1521))
 (ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.11)(PORT=1521))
 (ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.12)(PORT=1521)))
 (CONNECT_DATA=(SERVICE_NAME= test.host.com)))

The table in following picture shows the scan connectivity ...




Note that, failover process have different types like preconnect or base. I will explain these methods and their sub types in my next post. Failover process that I will explain in my next POST will be TAF (Transparent Application Failover). It can be configured on client or server sid.

No comments :

Post a Comment