本文只介紹同網段公網IP、虛擬IP以及scan的變動,稍後會介紹跨網段的IP變動。node
在兩個節點分別中止集羣服務:數據庫
[root@odb09 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster -all [root@odb09 ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs [root@odb10 ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs
這裏使用了hosts文件,直接編輯便可。若是使用了dns,須要修改dns的解析記錄。若解析不成功會致使變動失敗。oracle
因爲變動了公網IP,須要重啓才能生效。重啓完成後,對應的公網IP和虛擬IP都會改變。而oracle集羣服務也會自動啓動,並把新的公網IP和虛擬IP信息寫入ocr中。到此,公網IP和虛擬IP變動完成。app
[root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl config scan SCAN name: scan01, Network: 1/192.168.120.0/255.255.255.0/eth0 SCAN VIP name: scan1, IP: /scan01/192.168.120.37
[root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl stop scan_listener [root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl stop scan [root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl status scan SCAN VIP scan1 is enabled SCAN VIP scan1 is not running [root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is not running
在更改前,確保新的scan能夠經過dns解析或者以加入hosts文件,不然會出現以下報錯: [root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl modify scan -n scan02 PRCS-1016 : Failed to resolve Single Client Access Name scan02 變動後驗證: [root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl config scan SCAN name: scan02, Network: 1/192.168.120.0/255.255.255.0/eth0 SCAN VIP name: scan1, IP: /scan02/192.168.120.42
[root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl start scan [root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl start scan_listener [root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl status scan SCAN VIP scan1 is enabled SCAN VIP scan1 is running on node odb10 [root@odb09 ~]# /u01/app/11.2.0/grid/bin/srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is running on node odb10
因爲變動scan名稱,因此還須要修改數據庫參數remote_listener,以下:ide
SQL> show parameter remote_listener NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ remote_listener string scan01:1521 變動後以下: SQL> alter system set remote_listener='scan02:1521' scope=spfile; SQL> show parameter remote_listener NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ remote_listener string scan02:1521