SCAN-11.2.0 – What You Need to Know

I saw that many problems with feature Oracle SCAN occur due to improper configuration of the environment because of to lack of knowledge on the issue.

Here I’ll post what you should be aware that things work well.

If I ask you to read the concept, maybe you’re not willing to read … then I’ll post the main questions that give us an overview.

What’s SCAN?
Single client access name (SCAN) is the virtual hostname to provide for all clients connecting to the cluster (as opposed to the vip hostnames in 10g and 11gR1).
The feature SCAN is a new “layer” network (oracle) with high availability that allows you to change the characteristics of your cluster (i.e add/remove nodes) without the need to make configuration changes in their clients “Grid concept”.
The IP SCAN and VIP have different goals, therefore working together.
The VIP IP provides high availability at the “tier” of the Cluster.
The SCAN IP provides high availability at the “tier” of the Clients.
No matter if we are adding or removing nodes in a cluster or if the nodes are active or inactive, SCAN IP is always available for clients (Managing Connections-Failover) since one node of cluster is active.
How does SCAN work?
“When a client submits a request, the SCAN listener listening on a SCAN IP address and the SCAN port is contracted on a client’s behalf. Because all services on the cluster are registered with the SCAN listener, the SCAN listener replies with the address of the local listener on the least-loaded node (Each scan listener keeps updated cluster load statistics) where the service is currently being offered. Finally, the client establishes connection to the service through the listener on the node where service is offered.All of these actions take place transparently to the client without any explicit configuration required in the client.”
Requirements to set up SCAN?

SCAN is a domain name registered to at least one and up to three IP addresses, either in the domain name service (DNS) or the Grid Naming Service (GNS), only DNS can resolve more than one IP addresses on the same hostname. That’s possible because only DNS have feature Round-Robim.  

SCAN VIP addresses must be on the same subnet as virtual IP addresses and public IP addresses.

By default, the name used as the SCAN is also the name of the cluster and must be globally unique throughout your enterprise. SCAN name must be at least one character long and no more than 15 characters in length, must be alphanumeric – cannot begin with a numeral and may contain hyphens (-).

Can I use HOSTS files to resolve SCAN?
Technically works because Oracle requires that this virtual hostname be resolved and using HOSTS this is possible.
It’s very important…
Use host file ONLY if you are creating a test environment or if will not use the SCAN feature. My recommendation is: NEVER use the HOSTS file to resolve SCAN in a production environment. This will cause a lot issues.
Oracle strongly recommends that you do not configure SCAN VIP addresses in the hosts file. But if you use the hosts file to resolve SCAN name, you can have only one SCAN IP address.
The HOSTS file does not resolve more than one entry with the same hostname, only the first entry is resolved.
 
See this example:
http://forums.oracle.com/forums/message.jspa?messageID=8392421#8392421
Requirements to set up clients to use SCAN?
It is highly recommended you have a DNS.
You should always use the hostname (e.g node1-vip) never use IP (e.g 192.168.0.5).
This is necessary because Oracle try connect using hostname (not IP) configured on LOCAL/REMOTE Listener on Database.
The client MUST resolve and access the following  hostname and ports:
 
  • The Virtual hostname of SCAN  (e.g  host-scan)
  • Port of Listener SCAN  must be open.
  • ALL hostname from Virtual IP of clusterware (e.g node1-vip,node2-vip and so on). This will be necessary because the conection is estabilished by VIP not by SCANIP.
  • Port of Local Listener must be open.
 
e.g  Check connection on Client 
nslookup host-scan
ping -c node1-vip
ping -c node2-vip
ping -c host-scan
tnsping node1-vip
tnsping node2-vip
tnsping host-scan
#  First test througth VIP
sqlplus scott/tiger@node1-vip:1521/testsvc
sqlplus scott/tiger@node2-vip:1521/testsvc
 # So test througth SCAN
sqlplus scott/tiger@host-scan:1521/testsvc
 
Why not setup only one SCANIP to SCAN?

Sebastian Wrote:

if you only use one, then you only have 1 SCAN VIP and 1 SCAN listener. One scan vip and listener can only be active on one node at a time, and will failover to another.
So there are some things to know
1.) What happens, if you only have one listener instead of 3, regarding connections:
Connections will not be distributed on multiple SCAN listener, but always end up on the same. So be carefull, that this is not a bottleneck.
Connection storms on 1 listener is simply more likely to happen, than if you have 3. But this can be avoided, in setting up the clients in a manner they don’t open 100rds of connections at the same time – and with some listener.ora parameters.
2.) What happens, if the listener is not available (because it’s in the process of failing over):
With 3 scans, the client will simply switch to the next one and get a connection. With only 1 scan, the client will get an error (No listener).
So for the time of the failover with only 1 scan, there will be unsuccessful connection attempts. However relocation of the SCAN VIP and listener is normally quite fast…
However the listener registration by the database (from PMON) is only done every 60 seconds. So if listener is up (after failover), but no service registered (yet), the clients mayl recieve an error (No service).
3.) What happens, if for any reason this one scan listener fails and cannot be restarted.
While very unlikely to happen, because the clusterware tries to avoid this, this would result in a complete “inavailability” of the cluster. With 3 scans, while not good that one listener isn’t running, it does not matter.
 
http://forums.oracle.com/forums/message.jspa?messageID=9554024#9554024
 
 Why not use VIP or Public ?
Because for us to have the concept of GRID we must configure the feature only one time and it will self manage and make cluster transparent to yours clients.
If you add or remove an NODE it’s require to modify the connections of yours all clients (VIP/PUBLIC IP) you broke the concept of GRID. (This makes a big difference when you have many clients i.e.: Over 20 clients.)
If we remove or add node we must configure the clients to use/or not this node. Using SCAN he do this automatically.
Do we still need to configure local listeners on each node?
Yes, you would need to configure independent local listeners for each node.  SCAN listeners are not replacements for the node listeners.
A new set of cluster processes called scan listeners will run on three nodes in a cluster (or all nodes if there are less than 3).  If you have more than three nodes, regardless of the number of nodes you have, there will be at most three scan listeners.  The database registers with the SCAN listener through the remote listener parameter in the init.ora/spfile.  If any of these clustered processes fail, they are automatically restarted on a new node.
 
Can we use the previous method (Using VIP) for client connection?
Clients can continue to access the cluster in the same way as with previous releases. Vips are still used internally, and can still be used for connections. But Oracle strongly recommends that clients accessing the cluster use the SCAN. Clients using the SCAN can also access the cluster using EZCONNECT.
 
Is it mandatory to use SCAN?
It’s highly recommended to use SCAN unless there’s strong business reason preventing it from being used.
 
Is it supported to remove SCAN?
SCAN is an elementary part of 11gR2 Grid Infrastructure, it’s not supported to remove SCAN.
 
 

Advertisements

10 Comments on “SCAN-11.2.0 – What You Need to Know”

  1. Rajesh D R says:

    very nice…keep posting like this which is simply superb…..

    Like

  2. john says:

    Hi Levi,
    Any suggestion for this question.
    Appreciate your assistance.

    You have a four node cluster with four node VIPS and three scan VIPS already in use after Grid infrastructure installation
    You plan to manage a customer-developed, web based application with the Oracle Grid Infrastructure to provide high availability.
    Which two statements are true about the vip application resource that must be created ?

    a-)The vip application must be active on the same subnet and ethernet adaptor as the interconnect
    b-)The vip application must be active on the same subnet and ethernet adaptor as the public ip address
    c-)The vip application must not be online on the same node as any of the scan vips.
    d-)The vip application must be active on a different node than the application depending on Che
    by using the dispersion start dependecy in the resource definition
    e-) The vip application must be enabled to run as the root user

    Like

  3. Tiran says:

    Hi Levi, thanks for article about SCAN it very helpful and interesting, I want to ask you maybe you know what if I see 10 SCAN IP’s ?. Initially there was only 3 SCAN but now I see 10 and nslookup also show 10 but 7 of them not working they are dead. Can you help me with advice.

    ./thanks

    Outsider

    https://forums.oracle.com/forums/thread.jspa?messageID=10119952#10119952

    Like

  4. Me says:

    Can you have multiple SCAN names on a Single GI Home?

    Like

    • Levi Pereira says:

      No, Is not possible clusterware does not allow do that.
      If you try do it. You will see : PRCS-1037 : Single Client Access Name VIPs already exist

      Levi Pereira

      Like

  5. […] file does not resolve more than one entry with the same hostname, only the first entry is resolved. SCAN-11.2.0 – What You Need to Know Regards, Reply With […]

    Like

  6. […] the cluster use the SCAN. Clients using the SCAN can also access the cluster using EZCONNECT. SCAN-11.2.0 – What You Need to Know SINGLE CLIENT ACCESS NAME (SCAN) by Barb Lundhild, Markus Michalewicz Regards, Reply […]

    Like

  7. Pretty great post. I simply stumbled upon your blog and wanted to mention that I’ve really loved surfing around yoir blog posts.

    In any case I’ll be subscribinng on your fee and I hope you write once mor very soon!

    Like

  8. Harish Poojary says:

    How SCAN listener registration works?

    Like


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s