Pages

Wednesday 21 August 2013

How to modify SCAN name in RAC 11gR2.

Recently we encountered an issue where we were unable to make connection to database and after analysis found that SCAN name has got changed in the database configuration.  To resolve the issue I had to update with correct SCAN name and below is the procedure that was followed.

1. Login with GRID owner(oracle) and check current status as below.
[root@acldx0041 ~]# su - oracle
[oracle@acldx0041 ~]$ export GRID_HOME=/u01/app/11.2.0.3/grid
[oracle@acldx0041 ~]$ export PATH=$GRID_HOME/bin:$PATH
[oracle@acldx0041 ~]$ srvctl config scan
SCAN name: scan-idxa-test-stg, Network: 1/144.23.173.128/255.255.255.224/bondeth0
SCAN VIP name: scan1, IP: /scan-idxa-test-stg/140.21.173.148
SCAN VIP name: scan2, IP: /scan-idxa-test-stg/140.21.173.146
SCAN VIP name: scan3, IP: /scan-idxa-test-stg/140.21.173.147
[oracle@acldx0041 ~]$ nslookup scan-idxa-test-stg
Server:         10.221.45.71
Address:        10.221.45.71#53

** server can't find scan-idxa-test-stg: NXDOMAIN

What I find is SCAN name scan-idxa-test-stg is not resolving to any VIP in DNS. When I checked the SCAN VIP(Eg: 140.21.173.148), it was resolving to hostname scan-idxa-test-ha.dba.com which is correct SCAN Name.

oracle@acldx0041 ~]$ nslookup 140.21.173.148
Server:         10.221.45.71
Address:        10.221.45.71#53

Non-authoritative answer:
148.173.20.144.in-addr.arpa     name = scan-idxa-test-ha.dba.com.

Authoritative answers can be found from:
173.20.144.in-addr.arpa nameserver = ns1.dba.com.
173.20.144.in-addr.arpa nameserver = ns4.dba.com.
ns1.dba.com  internet address = 148.80.1.20
ns4.dba.com  internet address = 148.80.112.100

[oracle@acldx0041 ~]$ nslookup scan-idxa-test-ha.dba.com.
Server:         10.221.45.71
Address:        10.221.45.71#53

Non-authoritative answer:
Name:   scan-idxa-test-ha.dba.com
Address: 140.21.173.148
Name:   scan-idxa-test-ha.dba.com
Address: 140.21.173.146
Name:   scan-idxa-test-ha.dba.com
Address: 140.21.173.147

2. So now I have to update with correct SCAN name in OCR and is done as below.

Stop scan and scan listeners with GRID owner(oracle) as below.
[oracle@acldx0041 ~]$ export GRID_HOME=/u01/app/11.2.0.3/grid
[oracle@acldx0041 ~]$ export PATH=$GRID_HOME/bin:$PATH
[oracle@acldx0041 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node acldx0041
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node acldx0042
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node acldx0041
[oracle@acldx0041 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node acldx0041
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node acldx0042
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node acldx0041
[oracle@acldx0041 ~]$ srvctl stop scan_listener
[oracle@acldx0041 ~]$ srvctl stop scan
[oracle@acldx0041 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is not running
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is not running
[oracle@acldx0041 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
SCAN VIP scan2 is enabled
SCAN VIP scan2 is not running
SCAN VIP scan3 is enabled
SCAN VIP scan3 is not running

3.Once this is done, now we will modify configurations to point to correct scan name. This has to be done with root user.

[root@acldx0041 ~]# export GRID_HOME=/u01/app/11.2.0.3/grid
[root@acldx0041 ~]# export PATH=$GRID_HOME/bin:$PATH
[root@acldx0041 ~]# srvctl modify scan -n scan-idxa-test-ha.dba.com


4.Now connect with GRID owner r and start SCAN and SCAN listener.

[oracle@acldx0041 ~]$ export GRID_HOME=/u01/app/11.2.0.3/grid
[oracle@acldx0041 ~]$ export PATH=$GRID_HOME/bin:$PATH
[oracle@acldx0041 ~]$ srvctl modify scan_listener -u
[oracle@acldx0041 ~]$ srvctl start scan_listener
[oracle@acldx0041 ~]$ srvctl config scan
SCAN name: scan-idxa-test-ha.dba.com, Network: 1/144.23.173.128/255.255.255.224/bondeth0
SCAN VIP name: scan1, IP: /scan-idxa-test-ha.dba.com/140.21.173.146
SCAN VIP name: scan2, IP: /scan-idxa-test-ha.dba.com/140.21.173.147
SCAN VIP name: scan3, IP: /scan-idxa-test-ha.dba.com/140.21.173.148
[oracle@acldx0041 ~]$ tnsping scan-idxa-test-ha.dba.com

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 21-AUG-2013 07:25:46

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

Used parameter files:
/u01/app/oracle/product/11.2.0.3/dbhome_1/network/admin/sqlnet.ora

Used EZCONNECT adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=140.21.173.148)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=140.21.173.146)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=140.21.173.147)(PORT=1521)))
OK (0 msec)

and update remote_listener to point to correct SCAN name.

SQL> sho parameter remote_listener;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_listener                      string      scan-idxa-test-ha:1521



Please refer Doc ID 952903.1 for more details.


No comments:

Post a Comment