Guenadi N Jilevski's Oracle BLOG

Oracle RAC, DG, EBS, DR and HA DBA BLOG

Oracle SCAN and converting from a single entry SCAN to DNS SCAN

Oracle SCAN and converting from a single entry SCAN to DNS SCAN

In the article you will have a look at the steps to modify SCAN configuration while converting your SCAN from a single entry residing in /etc/hosts to a SCAN based on 3 DNS entries. SCAN was introduced in 11.2 and allows a single name to be used for the clients to connect to the RAC cluster. SCAN load balances across the node listeners to connect to the instance that provides the best quality of service for a service. SCAN provides a transparency of the cluster structure as follows:

  1. You can add remove cluster nodes without modifying SCAN
  2. You can connect to a database without prior information on which cluster nodes the database is running

In the article an assumption is made that Oracle GI 11.2.0.X is installed and running using SCAN defined in /etc/hosts as shown below.

192.168.2.71 oel-cluster.gj.com oel-cluster

Oracle 11.2.0.3 is used for the testing the steps.

With a SCAN configured as a single entry the configuration is as shown below and there is only one SCAN listener corresponding to the single entry SCAN.

[grid@oel61 ~]$ srvctl config scan

SCAN name: oel-cluster, Network: 1/192.168.2.0/255.255.255.0/eth1

SCAN VIP name: scan1, IP: /oel-cluster/192.168.2.71

[grid@oel61 ~]$

The SCAN listener is configured as show below.

[grid@oel61 ~]$ srvctl config scan_listener

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

[grid@oel61 ~]$

I will replace the single entry SCAN with the SCAN having the following configuration in DNS. For details related to the DNS setup click here.

oel-cluster    IN A 192.168.2.71

oel-cluster    IN A 192.168.2.72

oel-cluster    IN A 192.168.2.73

I verified the DNS SCAN setup.

[root@oel61 named]# nslookup oel-cluster

Server:        192.168.2.11

Address:    192.168.2.11#53

Name:    oel-cluster.gj.com

Address: 192.168.2.72

Name:    oel-cluster.gj.com

Address: 192.168.2.73

Name:    oel-cluster.gj.com

Address: 192.168.2.71

[root@oel61 named]# nslookup 192.168.2.71

Server:        192.168.2.11

Address:    192.168.2.11#53

71.2.168.192.in-addr.arpa    name = oel-cluster.gj.com.

[root@oel61 named]# nslookup 192.168.2.72

Server:        192.168.2.11

Address:    192.168.2.11#53

72.2.168.192.in-addr.arpa    name = oel-cluster.gj.com.

[root@oel61 named]# nslookup 192.168.2.73

Server:        192.168.2.11

Address:    192.168.2.11#53

73.2.168.192.in-addr.arpa    name = oel-cluster.gj.com.

[root@oel61 named]#

To modify the Oracle GI SCAN settings perform the following tasks. Note that the order of the tasks is important and that the steps are numbered to indicate the order of execution.

  1. Mask on the SCAN setting from the /etc/hosts
  2. Stop the scan listeners using the command

    [grid@oel61 oel61]$ srvctl stop scan_listener

  3. Stop the scan using the command

    [grid@oel61 oel61]$ srvctl stop scan

  4. Modify SCAN settings.

    [root@oel61 bin]# ./srvctl modify scan -n oel-cluster.gj.com

  5. Modify the SCAN listeners setting to automatically create three SCAN listeners.

    [root@oel61 bin]# ./srvctl modify scan_listener –u

  6. Start scan

    [grid@oel61 oel61]$ srvctl start scan

  7. Start scan listeners
  8. [grid@oel61 oel61]$ srvctl start scan_listener
  9. Verify configuration and status

    [grid@oel61 oel61]$ srvctl config scan

    SCAN name: oel-cluster.gj.com, Network: 1/192.168.2.0/255.255.255.0/eth1

    SCAN VIP name: scan1, IP: /oel-cluster.gj.com/192.168.2.73

    SCAN VIP name: scan2, IP: /oel-cluster.gj.com/192.168.2.71

    SCAN VIP name: scan3, IP: /oel-cluster.gj.com/192.168.2.72

    [grid@oel61 oel61]$

    [grid@oel61 ~]$ srvctl status scan

    SCAN VIP scan1 is enabled

    SCAN VIP scan1 is running on node oel61

    SCAN VIP scan2 is enabled

    SCAN VIP scan2 is running on node oel61

    SCAN VIP scan3 is enabled

    SCAN VIP scan3 is running on node oel61

    [grid@oel61 ~]$

    [grid@oel61 oel61]$ 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

    [grid@oel61 oel61]$ srvctl status scan_listener

    SCAN Listener LISTENER_SCAN1 is enabled

    SCAN listener LISTENER_SCAN1 is running on node oel61

    SCAN Listener LISTENER_SCAN2 is enabled

    SCAN listener LISTENER_SCAN2 is running on node oel61

    SCAN Listener LISTENER_SCAN3 is enabled

    SCAN listener LISTENER_SCAN3 is running on node oel61

    [grid@oel61 oel61]$

ANNEX

Resources before SCAN modification

[root@oel61 bin]# ./crsctl status res -t

——————————————————————————–

NAME TARGET STATE SERVER STATE_DETAILS

——————————————————————————–

Local Resources

——————————————————————————–

ora.DATA.dg

 ONLINE ONLINE oel61

ora.LISTENER.lsnr

 ONLINE ONLINE oel61

ora.asm

 ONLINE ONLINE oel61 Started

ora.gsd

 OFFLINE OFFLINE oel61

ora.net1.network

 ONLINE ONLINE oel61

ora.ons

 ONLINE ONLINE oel61

ora.registry.acfs

 ONLINE ONLINE oel61

——————————————————————————–

Cluster Resources

——————————————————————————–

ora.LISTENER_SCAN1.lsnr

 1 ONLINE ONLINE oel61

ora.LISTENER_SCAN2.lsnr

 1 OFFLINE OFFLINE

ora.LISTENER_SCAN3.lsnr

 1 OFFLINE OFFLINE

ora.cvu

 1 ONLINE ONLINE oel61

ora.oc4j

 1 ONLINE ONLINE oel61

ora.oel61.vip

 1 ONLINE ONLINE oel61

ora.rmanrep.db

 1 ONLINE ONLINE oel61 Open

ora.scan1.vip

 1 ONLINE ONLINE oel61

ora.scan2.vip

 1 OFFLINE OFFLINE

ora.scan3.vip

 1 OFFLINE OFFLINE

[root@oel61 bin]#

Resource after modification

[root@oel61 bin]# ./crsctl status res -t

——————————————————————————–

NAME TARGET STATE SERVER STATE_DETAILS

——————————————————————————–

Local Resources

——————————————————————————–

ora.DATA.dg

 ONLINE ONLINE oel61

ora.LISTENER.lsnr

 ONLINE ONLINE oel61

ora.asm

 ONLINE ONLINE oel61 Started

ora.gsd

 OFFLINE OFFLINE oel61

ora.net1.network

 ONLINE ONLINE oel61

ora.ons

 ONLINE ONLINE oel61

ora.registry.acfs

 ONLINE ONLINE oel61

——————————————————————————–

Cluster Resources

——————————————————————————–

ora.LISTENER_SCAN1.lsnr

 1 ONLINE ONLINE oel61

ora.LISTENER_SCAN2.lsnr

 1 ONLINE ONLINE oel61

ora.LISTENER_SCAN3.lsnr

 1 ONLINE ONLINE oel61

ora.cvu

 1 ONLINE ONLINE oel61

ora.oc4j

 1 ONLINE ONLINE oel61

ora.oel61.vip

 1 ONLINE ONLINE oel61

ora.rmanrep.db

 1 ONLINE ONLINE oel61 Open

ora.scan1.vip

 1 ONLINE ONLINE oel61

ora.scan2.vip

 1 ONLINE ONLINE oel61

ora.scan3.vip

 1 ONLINE ONLINE oel61

[root@oel61 bin]#

Listeners status

[grid@oel61 oel61]$ lsnrctl status listener_scan1

LSNRCTL for Linux: Version 11.2.0.3.0 – Production on 30-OCT-2011 01:55:26

Copyright (c) 1991, 2011, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))

STATUS of the LISTENER

————————

Alias LISTENER_SCAN1

Version TNSLSNR for Linux: Version 11.2.0.3.0 – Production

Start Date 30-OCT-2011 01:51:09

Uptime 0 days 0 hr. 4 min. 17 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora

Listener Log File /u01/app/11.2.0/grid/log/diag/tnslsnr/oel61/listener_scan1/alert/log.xml

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.73)(PORT=1521)))

The listener supports no services

The command completed successfully

[grid@oel61 oel61]$ lsnrctl status listener_scan2

LSNRCTL for Linux: Version 11.2.0.3.0 – Production on 30-OCT-2011 01:55:28

Copyright (c) 1991, 2011, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))

STATUS of the LISTENER

————————

Alias LISTENER_SCAN2

Version TNSLSNR for Linux: Version 11.2.0.3.0 – Production

Start Date 30-OCT-2011 01:51:11

Uptime 0 days 0 hr. 4 min. 17 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora

Listener Log File /u01/app/11.2.0/grid/log/diag/tnslsnr/oel61/listener_scan2/alert/log.xml

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.71)(PORT=1521)))

Services Summary…

Service “RMANREP” has 1 instance(s).

 Instance “RMANREP1”, status READY, has 1 handler(s) for this service…

Service “RMANREPXDB” has 1 instance(s).

 Instance “RMANREP1”, status READY, has 1 handler(s) for this service…

The command completed successfully

[grid@oel61 oel61]$ lsnrctl status listener_scan3

LSNRCTL for Linux: Version 11.2.0.3.0 – Production on 30-OCT-2011 01:55:33

Copyright (c) 1991, 2011, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))

STATUS of the LISTENER

————————

Alias LISTENER_SCAN3

Version TNSLSNR for Linux: Version 11.2.0.3.0 – Production

Start Date 30-OCT-2011 01:51:09

Uptime 0 days 0 hr. 4 min. 24 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora

Listener Log File /u01/app/11.2.0/grid/log/diag/tnslsnr/oel61/listener_scan1/alert/log.xml

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.72)(PORT=1521)))

The listener supports no services

The command completed successfully

[grid@oel61 oel61]$

November 10, 2011 - Posted by | oracle

2 Comments »

  1. you are cool !!!!!

    Thank you very much it helped me a lot

    Brij

    Comment by brij | December 10, 2011 | Reply

  2. Thank you Guenadi! the article was helpful for me!

    Jahtux

    Comment by Jorge | May 8, 2012 | Reply


Leave a comment