1) How to modify IP, VIP and SCAN for RAC ?
Plan to change testrac1/2 RAC public IP, VIP and SCAN:
Summary
1. All DBs, services, ASMs, listeners down (DBA)
2. Registers new public IP and new VIP on DNS (SA/Network)
3. Change /etc/hosts and /etc/rc.config.d with new IP (DBA)
4. RAC public IP change via oifcfg (part I below, DBA)
5. RAC VIP change via srvctl (part II below, DBA)
6. Reboot server (DBA)
7. Network engineer makes public IP change on LAN (Network)
8. Finally test (DBA/App Team)
Before any following step, all databases and services, ASM, listeners will be shutdown.
I. Change Public IP:
Use the getif option to show the currently configured interfaces.
% $ORA_CRS_HOME/bin/oifcfg getif
lan2 10.0.0.0 global cluster_interconnect
lan0 138.69.21.0 global public
Change Public IP
% $ORA_CRS_HOME/bin/oifcfg delif -global lan0
% $ORA_CRS_HOME/bin/oifcfg setif -global lan0/newIP:public
No private IP change here (10.0.0.1 and 10.0.0.2 remained same)
Verify
% $ORA_CRS_HOME/bin/oifcfg getif
II. Change VIP :
Find out current VIP and subnet
srvctl config nodeapps -n testrac1 -a
(VIP exists.: /testrac1-vip/138.69.21.247/255.255.255.0/lan0)
srvctl config nodeapps -n testrac2 -a
(VIP exists.: /testrac2-vip/138.69.21.162/255.255.255.0/lan0)
stop the nodeapps
srvctl stop nodeapps -n testrac1
Verify VIP is no longer running
Netstat -in
Make any changes necessary to testrac2's "/etc/hosts" file as root
Change VIP as root (according to SA, new subnet will be 255.255.254.0)
srvctl modify nodeapps -n testrac1 -A newIP/255.255.254.0/lan0
Verify
srvctl config nodeapps -n testrac1 -a
Repeat step 1 to 6 on testrac2.
Bring up nodeapp, asm, listener, db, etc.
Final testing
III. Change SCAN IP:
SCAN Concepts:
1) 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).
2) 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).
3) By default, the name used as the SCAN is also the name of the cluster and must be globally unique throughout your enterprise.
4) SCAN VIP addresses must be on the same subnet as virtual IP addresses and public IP addresses.
5) 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.
If hosts file is used to resolve SCAN hostname, you will receive Cluster Verification Utility failure at end of installation.
5) Because the SCAN is associated with the cluster as a whole, rather than to a particular node, the SCAN makes it possible to add or remove nodes from the cluster without needing to reconfigure clients.
6) Grid Infrastructure will start local listener LISTENER on all nodes to listen on local VIP, and SCAN listener LISTENER_SCAN1 (up to three cluster wide) to listen on SCAN VIP(s); 11gR2 database by default will set local_listener to local LISTENER, and remote_listener to SCAN listener.
7) SCAN listener will be running off GRID_HOME, and by default, in 11gR2 local listener will be running off GRID_HOME as well.
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.
How to check SCAN IP and round-robin access ?
Use nslookup. DNS is set up to provide round-robin access to the IPs resolved by the scan entry.
Run the nslookup command for 2-3 times and check round-robin algorithm works.
The result should be a set of 3 IPs in a DIFFERENT ORDER.
Start/Restart/Stop the scan listener:
1.srvctl start listener
2.srvctl start scan
3.srvctl start scan_listener
Check config :
srvctl config listener
srvctl config scan
srvctl config scan_listener
Check status :
srvctl status listener
srvctl status scan
srvctl status scan_listener
Modify the scan NAME:
srvctl modify scan -n my-scan
srvctl modify scan_listener -u [ Update the scan listeners ]
srvctl config scan_listener
Modify the scan listener PORT :
srvctl modify scan_listener -p 1522
srvctl modify scan_listener -u [ Update the scan listeners ]
srvctl config scan_listener
Check the remote listerner and modify:
show parameter remote_listener
lsnrctl status LISTENER_SCAN1
alter system set remote_listener='RACDB_Clus_SCAN:1522'
scope=BOTH SID='*';
alter system register;
Note: Modify tnsname.ora (port=1522)
show parameter remote_listener
NAME TYPE VALUE
remote_listener string RACDB_Clus.jdata.com:1521
show parameter local_listener
NAME TYPE VALUE
local_listener string (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.88.999.111)(PORT=1521))))
Ref. Docs: [ID - 972500.1 and 887522.1]