loading
hello dummmy text

Understanding SCAN listener functionality has become tough to Oracle DBA’s because of multi layered listeners introduced in Oracle 11gR2 RAC. I have met an Oracle DBA with almost 4 years of experience and working actively on RAC setup for 1 year but lack of knowledge on how SCAN listener works. People often get confused as listeners on VIP addresses which existed prior to 11R2 are still available. This blog will focus in explaining the concepts involved in and around SCAN listener.

Terminologies:

  • Let us understand the components related to SCAN individually and then relate them together to understand SCAN in COMPLETE.

SCAN VIP:

SCAN VIP is one of the resources you find in the output of “crsctl status resource –t” command. Number of SCAN VIP’s you notice will be the same as the number of SCAN LISTENERS in the setup.

SCAN VIP’s are physical IP addresses that you allocate to SCAN listeners. In the example that I use later in this blog, 192.168.122.5, 192.168.122.6, 192.168.122.7 are SCAN VIP’s. If you identify that SCAN VIP’s are online in the output of “crsctl status resource –t” command then IP addresses are online on the physical network ports. Only when SCAN VIP’s are online we can start the SCAN listeners.

SCAN LISTENER:

SCAN Listener is the oracle component which starts running a service on the port (by default its 1521) using the SCAN VIP (IP address). So SCAN listener doesn’t start if SCAN VIP is not online. This is the major difference between a SCAN listener and SCAN VIP. The number of SCAN listeners you notice in the output will be the same as number of SCAN VIP’s ONLINE. Name that is given to SCAN LISTENER is referred as SCAN NAME and it is registered in DNS server. In our example which you will find next, the SCAN name is “SCAN_LISTENER”.

So in short, always SCAN LISTENER and SCAN VIP are related to each other.

Node VIP:

Node VIP is the IP address which has capability of relocating to local listener of other node when the current node goes down. Drawback of using only node VIP is TNS entry of application server should have all node VIP addresses updated. You can identify the IP address assigned to node VIP will be a part of LOCAL listener. Test it yourself, run “lsnrctl status” on every node and you will find that local listener has two IP addresses – 1 node IP and 2 node VIP.

The challenge of having multiple VIP addresses in TNS entry is addressed in 11gR2 introducing SCAN.
  • Let us now understand the architecture of SCAN with the help of below image that serves the user requests from application server.
    Untitled_567

Assumptions:

  • 4 Node RAC setup
  • 3 SCAN listeners
  • DNS server in use
  • TNS of application uses SCAN_LISTENER as hostname
  • Database is new and no connections

Explanation for each stage numbered in the image:

  1. 0 sec: User1 when tries to establish a session on database with connection request C1, it hits DNS server first.
  2. DNS server will then resolve the name “SCAN_LISTENER” to the first IP 192.168.122.5
  3. C1 request reaches the first scan listener SCAN1 mostly the default name will be “LISTENER_SCAN1” which is running on 192.168.122.5 SCAN VIP.
  4. SCAN1 using details from LBA, identifies the load on each node in the setup and routes the request C1 to node which has least load.
  5. In this case it happened to be NODE 2 with least load or no load and the C1 request is addressed by local listener on this node which helps C1 to establish a session on instance on NODE 2.
  6. 5th sec: User2 when tries to establish a session on database with connection request C2, it hits DNS serer first.
  7. DNS server will now use Round-Robin algorithm and resolves the name “SCAN_LISTENER” to second IP 192.168.122.6
  8. C2 request reaches the second scan listener SCAN2 mostly the default name will be “LISTENER_SCAN2” which is running on 192.168.122.6 SCAN VIP.
  9. SCAN2 using details from LBA, identifies the load on each node in the setup and routes the request C2 to node which has least load.
  10. In this case it happened to be NODE 1 with least load or no load and the C2 request is addressed by local listener on this node which helps C2 to establish a session on instance on NODE 1.

— The same cycle and principles are applicable for other 3 connection requests C3, C4 and C5 —

50 Comment

  1. BOLLA

    VERY NICE EXPLANATION,
    VERY USEFUL INFORMATION.

    THANK YOU.

      1. venkatesh

        Hello Pawan,

        Nice Explanation, I was stuck at how to handle inbound connection timed out (ORA-3136)? errors
        We have two node RAC environment and all the application connections are increasing and database is very slow even we touch for single commend,it is taking very too much time to execute. Normally our load on RAC1 and RAC2 takes load average 4,,but yesterday it took 500 ,

        What happend to it and it which cases it would be like that.

  2. Ankit Chanpuria

    Nice explanation , looking for some examples on administering cluster services…

    1. Pawan Kumar Yaddanapudi

      Sure, Keep in touch with us.

  3. Anil Bhardwaj

    Great description of concepts !!!!!

    Further looking for some more concepts description like cache coherence , node evictions , performance tuning etc.

    Heartily thanks for this post !!!!

  4. srikanth reddy

    thanks nice post

    1. Pawan Kumar Yaddanapudi

      My pleasure Srikanth

  5. Yuvaraj

    Really nice one

  6. Raj Kumar

    Pawan This is very nice description.

    I am looking for some more concepts description like cache coherence , node evictions , performance tuning etc

    Thanks for this post.

    1. Pawan Kumar Yaddanapudi

      Thank you !!! Made a note, I will do the needful when ever i see some tricky stuff 🙂

    2. Jorge Lallemand

      You read my mind. I am doing some testing on my VB RAC cluster on the effect of session reallocation.
      And resolution speed between actual host (10g) vs Scan (11g+).

  7. Rakesh

    Pawan, very extensive and excellent explanation. waiting for more concepts from you.

    Thank you

    1. Pawan Kumar Yaddanapudi

      Thanks Rakesh !!!

  8. sanjay

    Nice explanation -question I have, if there can be multiple databases in in cluster (CRP , DEV) ,
    1. Example cluster1 – has three databases ( CRP , TEST, DEV)
    2. Scan is defined at cluster level
    3. how does client – connecting through scan listener connect to particular database ?
    4. Also u said SCAN IP – physical IP , where NIC for this – how does SCAN relocate if IP is physical

    Thanks
    Sanjay

    1. Pawan Kumar Yaddanapudi

      Hi Sanjay,

      SCAN will differentiate the connections between the databases on the same cluster using unique service names that you create which are dedicated to a database. By default it will be the database name, but you are free to create custom service names.

      SCAN IP sits on the physical PUBLIC network adapter, It is still virtual IP only then it has the capability to relocate.

      Thanks,
      Pawan

  9. Bala.S

    Good document … expecting explanation for many RAC concept.

    1. Mallikarjuna Sharma

      Can you please share RAC architecture in detailed manner

  10. Mohammed

    Why we use DNS server , Cant we use host file for resolving SCAN, if use host file what could be the problem.

  11. Vineesh

    Excellent!
    Hi can I get same way RAC startup sequence ?

    1. Pawan Kumar Yaddanapudi

      Sure… I will try to do it soon !!!

  12. ADAM MULLA

    Very Nice Explanation …….i this help for me to understand the ground concept of ORACLE DBA and RAC DBA…. i want to know sir Data-guard modes please explain ….thanks for sharing Knowledge..

  13. karthik

    Hi,

    Very good explanation on the above.

    I have couple of doubts.

    1.The scan vip is the physical ip address which means its a physical server?
    2.Difference between scan vip and node vip
    3.What is the physical ip refers to?
    Please give the answers for the above questions. Thanks in Advance!!

    1. Pawan Kumar Yaddanapudi

      1.The scan vip is the physical ip address which means its a physical server?
      Ans: SCAN IP sits on the physical PUBLIC network adapter, It is still virtual IP only then it has the capability to relocate.
      2.Difference between scan vip and node vip
      Ans: SCAN VIP and NODE VIP purpose is logically same. But Node VIP is dedicated to a node and SCAN is not. SCAN can float between any nodes and not always dedicated to a node, but NODE VIP is always dedicated to a node and each NODE VIP has its unique name. All SCANs will have a common name.
      3.What is the physical ip refers to?
      Physical IP is the address that you give to physical NIC card.
      Ans:

  14. Dilli R. Maharjan

    Very nice explanation. Thank You Pawan.

    1. Pawan Kumar Yaddanapudi

      Cheers 🙂

  15. Kishore

    HI Pavan,

    Nice document. But I have a doubt. The above explanation is for a service whcih is running on both instances of the database. But suppose I have a database service whcihs is running on single instance only. Inthis case how the connection establish ?
    Scenario is database ORCL running on node 1 (ORCL1) & Node2 (ORCL2). . Scan listeners running as listener 1 & 2 runing on node 2 and Listener 3 runing on node 3. In this situation as per round robbin method if a connection paases to scan listener 2 whihs is ruuning on node 2. through service name whihs is running on node 1.
    could you please explain the process how scan transafer the connection from node 2 to node1 and connect to instance 1

    Thanks
    Kishore

    1. Pawan Kumar Yaddanapudi

      Kishore,
      SCAN is a virtual network layer which is primary contact to the application. When it is virtual it establishes connection routes to all the VIP listeners in the complete RAC environment. To answer your question, as it hits SCAN in node2, it already have the details of the service name ORCL1 and it is only allowed to connect to NODE1, then immediately SCAN will use network routing protocol to pass on the request to the local VIP on node 1. It works this way. SCAN is just a routing listener as per my experience and understanding.

  16. Anand Haridass

    Really a fantastic explanation .. thanks

    1. Pawan Kumar Yaddanapudi

      Thanks Anand !!!

  17. Rajesh

    Good Document – which covers and explain about SCAN with Image and step by step process – Easily anyone can understand – Thanks

  18. Anil Nettikoppula

    Thanks much !!! Pawan
    Very Nice Info about SCAN with clear cut explaination.

  19. Pratik

    It is very helpful Pavan. Good Work.

  20. Murali

    Basu ni BRAIN ekkada tayaru chepinchav??

    1. Pawan Kumar Yaddanapudi

      Lol 🙂 Nice that you are loving it.

  21. firdos

    Mr pawan Kumar I love u … The way u explained it …. I wasted much of my time in understanding the whole concept but u blow my eyes .. u really thaaaaaaankuuuu..

    1. Pawan Kumar Yaddanapudi

      Cheers !!!

  22. Prashant

    Very Nice Explanation Pawan

    Thanks,
    Prashant

    1. Pawan Kumar Yaddanapudi

      Thanks

  23. thangaraju

    good post..nice.

  24. Abhishek Abde

    Very nice explanation … very helpful to understand the concept. Thanks Pawan 🙂

  25. Meka

    Pawan

    Thanks so much for the simple explanation spend so many time in understanding the scan listener and your explanation is so easy to understand.Thanks much..

  26. KNS

    good explanation. good work. thanks…..

  27. Dathu

    Hi Pavan,

    Nice explanation..
    waiting for OEM13c console explanation from you ….

  28. Sreedhar Kondapi

    Why i didn’t seen this blog before ?
    Awesome stuff bro..Impressed with your explanations..

  29. Sreedhar Kondapi

    Why i didn’t seen this blog before ?
    Awesome Stuff bro..Impressed with your explanations.

  30. ramachandra

    Thank you for this post.

    how many ports are used in 2 nodes rac cluster for the database.
    I deployed exadata with port 5001, but I see 1521 port is also configured with local listener,.
    Please could you explain
    Regards
    Ramachandra

  31. Niranjan

    hi brother nice information,,but here where is the remote_listener

  32. Vivek

    Hi Pawan,

    As I know, SCAN LISTENER works in ROUND – ROBIN fashion.
    If I am having 16 nodes RAC than how it will work.
    After three nodes are occupied with three scan IPs how it will work for next connection and so on.

    Please clarify my doubt.

    Regards
    Vivek

    1. Pawan Kumar Yaddanapudi

      Hey Vivek,

      Why will you have only 3 SCAN listeners when you have 16 node RAC, instead you can have more?

      SCAN listeners are logical listeners and you configure them to forward the request to any of the nodes. But a scan listener can be associated with only one IP. So you have to take a call of whether increasing SCAN and utilise other nodes in the setup.

      Hope it helped.

Leave a Reply to Vineesh Cancel reply

Your email address will not be published. Required fields are marked *

Knowledge That Can Always Keep Your Inbox Informed