jump to navigation

SCAN Reconfiguration July 30, 2010

Posted by tamnau in 11g, General, RAC.
Tags: , , , , ,
trackback

As you may know, SCAN (Single Client Access Name) is a new feature that has been introduced in 11.2 Oracle RAC. To put it simply, the SCAN is actually a single name alias which can be configured for clients to connect to the cluster database. In addition it will also handle the load balancing and failover for client connections. When the nodes in the cluster changes (eg. added or removed), the benefits of SCAN can be realised, as there is no requirement for the client to be reconfigured.

A good example on configuring SCAN for clients, Pas from Oracle has written an article which explains how this can be achieved. Just visit his blog entry Using SCAN – Single Client Access Name to Connect to 11g R2 RAC from JDeveloper 11g.

Configuring your clients to used SCAN in 11.2 or later is optional, however when you install the Grid Infrastructure software for RAC, the SCAN is still required to be configured for setup of the cluster.

It is recommended that the SCAN is resolvable to 3 IP addresses. However a minimum of 1 IP Address may be configured. It should also be registered in DNS for round robin resolution.

Reconfiguration of SCAN

There may be situations where reconfiguration of the SCAN for the cluster is required.
Some examples are:

  • Allocation of IP addresses has changed for SCAN
  • Adding additional IP addresses for SCAN
  • DNS Changes associated with SCAN addressing
  • SCAN name change^

NOTE: ^ SCAN name change may be required if there is conflicting name for another cluster on same network or in DNS, however this would mean that client reference to old SCAN is required be updated. Hence caution should be taken to ensure that SCAN name is unique in DNS and network.

In the below scenario, the following steps will show how SCAN addressing can be reconfigured for a cluster.

At the time of the installation, the DNS registration had not been setup. As a workaround, one of the IP addresses allocated for the SCAN was referenced in the /etc/hosts file. Once the installation was completed and DNS registration updated, the SCAN was then reconfigured to be resolvable through DNS for all 3 IP addresses.

Below is the summary of the current and new configuration for SCAN.

Current New
SCAN Name myscan myscan
SCAN IP Address 172.43.22.89 172.43.22.89
172.43.22.90
172.43.22.91
SCAN entry in /etc/hosts file Yes* No
Registered in DNS and configured for round robin No Yes

 

NOTE: SCAN entry in the /etc/hosts file is not recommended, hence the reconfiguration to the NEW is required.

1. Verify Current Configuration for SCAN VIP

oracle@lnx01[GRID]:/app/oracle> srvctl config scan
SCAN name: myscan, Network: 1/172.43.22.0/255.255.255.0/bge0:nxge0
SCAN VIP name: scan1, IP: /myscan.earth.com/172.43.22.89

2. Verify Status for SCAN VIP

oracle@lnx01[GRID]:/app/oracle> srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node lnx02

3. Verify Current Configuration for SCAN Listener

oracle@lnx01[GRID]:/app/oracle> srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

4. Verify Status for SCAN Listener

oracle@lnx01[GRID]:/app/oracle> srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node lnx02

5. Stop the SCAN Listener

oracle@lnx01[GRID]:/app/oracle> srvctl stop scan_listener

6. Stop the SCAN VIPs

oracle@lnx01[GRID]:/app/oracle> srvctl stop scan

7. Verify Status for SCAN Listener has stopped

oracle@lnx01[GRID]:/app/oracle> srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running

8. Verify Status for SCAN VIP has stopped

oracle@lnx01[GRID]:/app/oracle> srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running

9. Update SCAN in DNS and associated IPs as required

10. Verify that resolv.conf is configured to search DNS domain that SCAN was registered for

oracle@lnx01[GRID]:/app/oracle> cat /etc/resolv.conf
search        earth.com
nameserver      172.43.7.1
nameserver      172.44.7.1

11. Verify that in DNS that that the SCAN is resolvable against all three IP Addresses

oracle@lnx01[GRID]:/app/oracle> nslookup myscan
Server:         172.43.7.1
Address:        172.43.7.1#53
Name:   myscan.earth.com
Address: 172.43.22.89
Name:   myscan.earth.com
Address: 172.43.22.90
Name:   myscan.earth.com
Address: 172.43.22.91

12. Verify that the scan IP and address name has been removed or commented out from the /etc/hosts file:

oracle@lnx01[GRID]:/app/oracle> grep myscan /etc/hosts

NOTE: In this example no rows are returned as IP and address name has been removed for scan

13. Modify the SCAN resource so that it update all SCAN VIPs resolvable by DNS

oracle@lnx01[GRID]:/app/oracle> sudo srvctl modify scan -n myscan

14. If the SCAN name was changed as well, run the following to update in Cluster Resource Control

oracle@lnx01[GRID]:/app/oracle> sudo crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=myscan"

15. Verify that all SCAN VIPs are now resolvable and registered with the SCAN resource

oracle@lnx01[GRID]:/app/oracle> srvctl config scan
SCAN name: myscan, Network: 1/172.43.22.0/255.255.255.0/bge0:nxge0
SCAN VIP name: scan1, IP: /myscan.earth.com/172.43.22.90
SCAN VIP name: scan2, IP: /myscan.earth.com/172.43.22.91
SCAN VIP name: scan3, IP: /myscan.earth.com/172.43.22.89

16. Update the SCAN Listener with new SCAN VIPs identified from DNS

oracle@lnx01[GRID]:/app/oracle> srvctl modify scan_listener -u

17. Verify new SCAN Listeners registered for new SCAN VIPs

oracle@lnx01[GRID]:/app/oracle> srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

18. Start SCAN Listener

NOTE: This will also start the SCAN VIPs

oracle@lnx01[GRID]:/app/oracle> srvctl start scan_listener

19. Verify Status of all three SCAN VIPs have been enabled and are running.

oracle@lnx01[GRID]:/app/oracle> srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node lnx02
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node lnx01
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node lnx01

20. Verify Status of all three SCAN Listeners have been enabled and are running.

oracle@lnx01[GRID]:/app/oracle> srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node lnx02
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node lnx01
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node lnx01
About these ads

Comments»

1. Craig - September 1, 2010

This is EXACTLY what I was looking for. I had mis-configured the scan during install and this fixed it perfectly. Thank you!

2. sosdba - September 2, 2010

Thanks Craig. I welcome the feedback. I look forward to posting more on the 11gR2 RAC in the future as it seems to be a topic of great interest.

3. Tiru - April 17, 2012

Fantastic, excellent note. This saved my million dollar time.
Thanks

4. Martin - May 29, 2012

I only wish I’d found this article before I spent ages trying to work out what was going wrong. I installed grid with a single IP for the scan and then changed it in DNS but could not work out how to make it see the change. Thanks.

5. Kamal - September 6, 2012

Amazing really it amazing article thank you for the effort -kamal / Dubai

6. Swamy - December 19, 2012

This is an excellent article. But I still have a question regarding the SCAN lister. Lsnrctl service shows the database does exists where as when checked with lsnrctl service listener_scan1 from node 2 OR lsnrctl service listener_scan2 from node 1, the database service does not show up even after registering the remote_listener. Any suggestions on how to get the database service using the scan listener?

7. Swamy - December 19, 2012

I mean SCAN listener. Sorry for the typo

8. Alan - March 7, 2013

A Doubt… A SCAN configuration can substitute, for example, the normal VIP configuration? I thought SCAN was linked to the VIPS, but in this article it appears to work alone…

sosdba - April 5, 2013

Hi Alan, Thanks for your comment. Let me clarify. The article is more for a workaround that was used in 11.2.0.1 when you didn’t have it configured in DNS and needed to get the cluster up and running it was never intended to run as a permanent solution. I believe from 11.2.0.2 onwards you must have SCAN configured in DNS regardless so this option would not be appropriate.
To answer your question, SCAN is not a substitute. The SCAN does redirect the incoming connections to the VIPS.

9. jcnars - May 10, 2013

Terrific ! Going to be my single stop bookmark for all thing SCAN in 11gr2

10. sean - August 14, 2013

brilliant!


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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: