How to change SCAN, VIP IP address in 19c RAC (Two nodes)
Important Note: Command only executed in a test environment. In Production, execute at your own risk. The authors (Hayat Mohammad Khan) claim no responsibility for the below commands.
--As a grid user
--Grid home: /u01/app/19c/grid
[oracle@dbwr2 ~]$ . grid.env
[oracle@dbwr2 ~]$ oifcfg getif
enp0s3 192.168.50.0 global public
enp0s8 192.168.10.0 global cluster_interconnect,asm
--for dns below scan ips configured
[root@dbwr1 network-scripts]# cat /etc/racdns
changed from:
192.168.50.93 dbwr-scan.localdomain dbwr-scan
192.168.50.94 dbwr-scan.localdomain dbwr-scan
192.168.50.95 dbwr-scan.localdomain dbwr-scan
changed to
192.168.50.96 dbwr-scan.localdomain dbwr-scan
192.168.50.97 dbwr-scan.localdomain dbwr-scan
192.168.50.98 dbwr-scan.localdomain dbwr-scan
--Updated /etc/hosts file
comment old IPs
#192.168.50.93 dbwr-scan.localdomain dbwr-scan
#192.168.50.94 dbwr-scan.localdomain dbwr-scan
#192.168.50.95 dbwr-scan.localdomain dbwr-scan
Enter new IPs
192.168.50.96 dbwr-scan.localdomain dbwr-scan
192.168.50.97 dbwr-scan.localdomain dbwr-scan
192.168.50.98 dbwr-scan.localdomain dbwr-scan
As a Grid User perform below
=========================
[root@dbwr1 bin]# ./srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node dbwr1
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node dbwr1
SCAN Listener LISTENER_SCAN3 is enabled
----- SCAN-NAME is currently resolving old scan IPs
SCAN listener LISTENER_SCAN3 is running on node dbwr1
[root@dbwr1 bin]# ./srvctl config scan
SCAN name: dbwr-scan, Network: 1
Subnet IPv4: 192.168.50.0/255.255.255.0/enp0s3, static
Subnet IPv6:
SCAN 1 IPv4 VIP: 192.168.50.93
SCAN VIP is enabled.
SCAN 2 IPv4 VIP: 192.168.50.94
SCAN VIP is enabled.
SCAN 3 IPv4 VIP: 192.168.50.95
SCAN VIP is enabled.
----public and private network usage IPs scheme
[oracle@dbwr1 ~]$ oifcfg getif
enp0s3 192.168.50.0 global public
enp0s8 192.168.10.0 global cluster_interconnect,asm
[oracle@dbwr1 ~]$
----- stop scan services
[root@dbwr1 bin]# ./srvctl stop scan_listener
[root@dbwr1 bin]# ./srvctl stop scan
[root@dbwr1 bin]# ./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
[root@dbwr1 bin]#
[root@dbwr1 bin]# ./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
[root@dbwr1 bin]#
---------------stop and start dns server after IP change
[root@dbwr1 ~]# service dnsmasq stop
Redirecting to /bin/systemctl stop dnsmasq.service
[root@dbwr1 ~]# service dnsmasq start
Redirecting to /bin/systemctl start dnsmasq.service
[root@dbwr1 ~]# cat /etc/hosts
--------------Verify that new IPs are taken
[root@dbwr1 ~]# nslookup dbwr-scan
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: dbwr-scan.localdomain
Address: 192.168.50.98
Name: dbwr-scan.localdomain
Address: 192.168.50.96
Name: dbwr-scan.localdomain
Address: 192.168.50.97
Name: dbwr-scan.localdomain
Address: 192.168.50.98
Name: dbwr-scan.localdomain
Address: 192.168.50.97
Name: dbwr-scan.localdomain
Address: 192.168.50.96
** server can't find dbwr-scan.localdomain: REFUSED
------------ Modify scan IPs in RAC cluster
cd /u01/app/19c/grid/bin
[root@dbwr1 bin]# ./srvctl modify scan -n dbwr-scan
[root@dbwr1 bin]# ./srvctl config scan
SCAN name: dbwr-scan, Network: 1
Subnet IPv4: 192.168.50.0/255.255.255.0/enp0s3, static
Subnet IPv6:
SCAN 1 IPv4 VIP: 192.168.50.96
SCAN VIP is enabled.
SCAN 2 IPv4 VIP: 192.168.50.97
SCAN VIP is enabled.
SCAN 3 IPv4 VIP: 192.168.50.98
SCAN VIP is enabled.
[root@dbwr1 bin]#
[root@dbwr1 bin]# ./srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node dbwr1
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node dbwr1
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node dbwr1
============ Changing VIP Address ===========================
--192.168.50.83 is old VIP of node1 (dbwr1 is host name)
[root@dbwr1 bin]# ./srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 192.168.50.0/255.255.255.0/enp0s3, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
VIP exists: network number 1, hosting node dbwr1
VIP Name: dbwr1-vip.localdomain
VIP IPv4 Address: 192.168.50.83
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists: network number 1, hosting node dbwr2
VIP Name: dbwr2-vip
VIP IPv4 Address: 192.168.50.84
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
--- stop db and nodeapps service
[root@dbwr1 bin]# ./srvctl stop database -d oradbwr
[root@dbwr1 bin]# ./srvctl stop nodeapps -f
[root@dbwr1 bin]#
[oracle@dbwr1 ~]$ oifcfg getif
enp0s3 192.168.50.0 global public
enp0s8 192.168.10.0 global cluster_interconnect,asm
[oracle@dbwr1 ~]$
[root@dbwr1 bin]# ./crsctl stop cluster -all
CRS-2673: Attempting to stop 'ora.crsd' on 'dbwr1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'dbwr1'
CRS-2673: Attempting to stop 'ora.chad' on 'dbwr1'
CRS-33673: Attempting to stop resource group 'ora.asmgroup' on server 'dbwr1'
CRS-2673: Attempting to stop 'ora.GI.dg' on 'dbwr1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'dbwr1'
CRS-2673: Attempting to stop 'ora.RECO.dg' on 'dbwr1'
CRS-2677: Stop of 'ora.DATA.dg' on 'dbwr1' succeeded
CRS-2677: Stop of 'ora.RECO.dg' on 'dbwr1' succeeded
CRS-2677: Stop of 'ora.GI.dg' on 'dbwr1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'dbwr1'
CRS-2677: Stop of 'ora.asm' on 'dbwr1' succeeded
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'dbwr1'
CRS-2677: Stop of 'ora.chad' on 'dbwr1' succeeded
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'dbwr1' succeeded
CRS-2673: Attempting to stop 'ora.asmnet1.asmnetwork' on 'dbwr1'
CRS-2677: Stop of 'ora.asmnet1.asmnetwork' on 'dbwr1' succeeded
CRS-33677: Stop of resource group 'ora.asmgroup' on server 'dbwr1' succeeded.
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'dbwr1' has completed
CRS-2677: Stop of 'ora.crsd' on 'dbwr1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'dbwr1'
CRS-2673: Attempting to stop 'ora.evmd' on 'dbwr1'
CRS-2673: Attempting to stop 'ora.storage' on 'dbwr1'
CRS-2677: Stop of 'ora.storage' on 'dbwr1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'dbwr1'
CRS-2677: Stop of 'ora.ctssd' on 'dbwr1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'dbwr1' succeeded
CRS-2677: Stop of 'ora.asm' on 'dbwr1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'dbwr1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'dbwr1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'dbwr1'
CRS-2677: Stop of 'ora.cssd' on 'dbwr1' succeeded
[root@dbwr1 bin]#
---change VIP address in /etc/hosts or DNS
# Virtual
Change from:
192.168.50.83 dbwr1-vip.localdomain dbwr1-vip
192.168.50.84 dbwr2-vip.localdomain dbwr2-vip
Change VIP From 83 TO 85
192.168.50.85 dbwr1-vip.localdomain dbwr1-vip
192.168.50.84 dbwr2-vip.localdomain dbwr2-vip
----
root@dbwr1 network-scripts]# pwd
/etc/sysconfig/network-scripts
enp0s3:4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.50.85 netmask 255.255.255.0 broadcast 192.168.50.255
ether 08:00:27:c4:c9:54 txqueuelen 1000 (Ethernet)
[oracle@dbwr1 ~]$ /sbin/ifconfig enp0s3
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.50.73 netmask 255.255.255.0 broadcast 192.168.50.255
inet6 fe80::2fe:60bf:4e6f:a9fc prefixlen 64 scopeid 0x20<link>
inet6 fe80::58db:9472:e1f7:37b2 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:c4:c9:54 txqueuelen 1000 (Ethernet)
RX packets 2887 bytes 343925 (335.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2752 bytes 254973 (248.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[oracle@dbwr1 ~]$ /sbin/ifconfig enp0s3:4
enp0s3:4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.50.85 netmask 255.255.255.0 broadcast 192.168.50.255
ether 08:00:27:c4:c9:54 txqueuelen 1000 (Ethernet)
------------------
-- VIP IP change to 192.168.50.85 from 192.168.50.83 (hostname dbwr1)
[root@dbwr2 bin]# ./srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 192.168.50.0/255.255.255.0/enp0s3, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
VIP exists: network number 1, hosting node dbwr1
VIP Name: dbwr1-vip.localdomain
VIP IPv4 Address: 192.168.50.85
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists: network number 1, hosting node dbwr2
VIP Name: dbwr2-vip
VIP IPv4 Address: 192.168.50.84
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
[root@dbwr2 bin]#
--srvctl modify nodeapps -n dbwr1 -A 192.168.50.85/255.255.255.0/enp0s3:4
--srvctl modify nodeapps -n racnode1 -A 10.1.1.40/255.255.255.0/eth1
[root@dbwr2 bin]# ./srvctl start nodeapps
PRKO-2421 : Network resource is already started on node(s): dbwr1,dbwr2
PRKO-2420 : VIP dbwr1-vip.localdomain is already started on nodes: dbwr1
PRKO-2420 : VIP dbwr2-vip is already started on nodes: dbwr2
PRKO-2422 : ONS is already started on node(s): dbwr1,dbwr2
[root@dbwr1 bin]# ./srvctl status database -d oradbwr
Instance oradbwr1 is not running on node dbwr1
Instance oradbwr2 is not running on node dbwr2
SQL> select instance_name, status from gv$instance;
INSTANCE_NAME STATUS
---------------- ------------
oradbwr2 OPEN
oradbwr1 OPEN
Some other useful Commands:
srvctl modify scan_listener -update
$GRID_HOME/bin/srvctl modify scan_listener -u
/sbin/ifconfig -a | egrep '(eth|Mask)'
$GRID_HOME/bin/crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=<scan>.oracle.com"
Credit Goes:
https://www.funoracleapps.com/2018/06/how-to-change-various-ips-in-rac-cluster.html
https://cdmana.com/2021/08/20210809182210880t.html
http://what-when-how.com/Tutorial/topic-816rrqij6/Oracle-Exadata-Recipes-A-Problem-Solution-Approach-306.html
Oracle MOC:
How to Modify Public Network Information including VIP in Oracle Clusterware (Doc ID 276434.1)
How to Modify SCAN Setting or SCAN Listener Port after Installation (Doc ID 972500.1)
No comments:
Post a Comment