Thursday, March 29, 2018

Scan Listener of Oracle RAC

SCAN: (Single Client Access Name) -- It allows clients to access whole cluster/grid through one name, rather specifying all VIP addresses individually. It is an automatic load balancing tool that uses a relatively primitive least-recently-loaded algorithm. 

Basically SCAN Listeners are introduced to create another connection handler on top of existing node listeners to overcome the failover and load balancing issues till 11gR1 architecture for RAC. Till 11gR1 Node listeners were defined on VIPs to facilitate NACK (Negative Acknowledgement) to resolve the issue of TCP timeouts.

SCAN Requirement: To be able to get SCAN Functionality, We need some service through which one name is resolved to multiple IPs/hosts. This is what we often call "DNS", Domain name service or if you don't have DNS in your environment then you can use Oracle's "GNS (Grid Naming Service)"

SCAN Implementation/Configuration: In Our DNS We defined a ScanName and assigned three Virtual IPs e.g (OraDbScan=X.X.X.7, X.X.X.8 and X.X.X.9), Now when we do nslookup OraDbScan from our client it will give us list of three IPs specified as above and important thing, every time you do nslookup it will give you the IP addresses in round robin, So every request to resolve the OraDbScan name will give different IP every time. One kind of load balancing at first place to reach to SCAN Listener so requests will be distributed on available SCAN Listeners.

SCAN Usage: During Oracle Grid Installation, Specify mentioned IPs, Each VIP Listener on each node will register itself will Every SCAN Listener on whatever node the SCAN Listener is running.


Number of RAC Nodes: 4 
Physical IPs: 4, One for each node 
Private IPs: at least 4, One for each node (You can have two for each for redundancy) 
Virtual IPs: 4, One assigned to each node [Word "assigned" is important] 
Number of VIP Listeners: 4, Each Bound to certain Node [word "bound"/"assigned"] 
Number of SCAN Listeners: 3[ Still if you feel that default 3 SCAN listeners are not enough for your environment then you have an option to add few more scan listeners.], Grid will decide which nodes SCAN Listeners will be Allocated 

Client Connection String: Mentioning the name of SCAN "OraDbScan"


Connection Establishment: Client sends request to DNS using SCAN Name "OraDbScan", DNS will return one of three IPs, Client Sends request on that IP to the SCAN Listener, the SCAN Listener will route the request to one of the VIP Listeners among 4 VIP listeners in this case because each VIP listener has already registered itself with every SCAN Listener. Finally direct connection is established between client and one of the VIP Listeners. 
You see flexibility, adding/removing as many nodes in Grid/RAC doesn't require any change. 



No comments: