How to Change RAC Public IP and VIP


1 DB env

---------------------------------------------------
OS: Linux 5
DB: 10G
----------------
Old IP                                 New IP

192.168.181.11            192.168.24.11
192.168.181.12            192.168.24.12

10.0.0.11                       10.0.0.11
10.0.0.12                       10.0.0.12

192.168.181.13            192.168.24.13
192.168.181.14            192.168.24.14
---------------------------------------------------

1 Stop all oracle process including DB, ASM,nodeapps

--Stop DB, ASM,nodeapps    (root or oracle)
Method 1:
cd CRS_HOME/bin
./srvctl stop database -d rac
./srvctl stop asm -n node1
./srvctl stop asm -n node2
./srvctl stop nodeapps -n node1
./srvctl stop nodeapps -n node2


Method 2:
cd CRS_HOME/bin
./crs_stop -all

2 Backup OCR   (root)
./ocrconfig -export /tmp/ocr.bak

3 Stop CRS    
./crsctl stop crs             (root or oracle)
&
/etc/init.d/init.crs stop     (root)


4 Change IP in /etc/hosts of all nodes accordingly (root)

5 Change network config accordingly (root)

6 Restart network service in all nodes

service network restart

7 Oifcfg reconfig in OCR

--Start CRS

/etc/init.d/init.crs start     (root)

./crs_stat -t -v               (root or oracle)


--Stop nodeappps which start along with CRS

./crs_stop -all                (root or oracle)
./crs_stat -t -v               (root or oracle)


--Get current oifcfg status
./oifcfg getif

--Delete current oifcfg        (root)
./oifcfg delif -global eth0
(./oifcfg delif -global eth1)
./oifcfg getif

--Reset oifcfg                 (root)
./oifcfg setif -global eth0/192.168.24.11:public
(./oifcfg setif -global eth1/xxx.xx.xx.xx:cluster_interconnect)
./oifcfg getif


8 Modify VIP in OCR            (root)
./srvctl modify nodeapps -n node1 -A 192.168.24.13/255.255.255.0/eth0
./srvctl modify nodeapps -n node2 -A 192.168.24.14/255.255.255.0/eth0


9 Change IP in listener.ora and tnsnames.ora accordingly(usually just listener.ora)  (root)

10 Start rac nodeapps service      (root or oracle)       

./crs_start -all

11 Verify

./crs_stat -t -v

请使用浏览器的分享功能分享到微信等