最近需要对主库迁移至11gR2 RAC,其原来的IP地址需要在迁移的时候,改成RAC的一个vip。在测试库上测试了一下,在节点postmallrac1把vip从172.24.138.105改成172.24.138.104,大概过程如下:
postmallrac1# ./srvctl status service -d postmall
...... //service name,or nothing
postmallrac1# ./srvctl stop service -d postmall -s <Service_name1,Service_name2> -n postmallrac1
VIP exists: /postmallrac1-vip/172.24.138.105/172.24.138.0/255.255.255.0/eth0, hosting node postmallrac1
postmallrac1# ./srvctl config vip -n postmallrac1 //check config
SQL> SHOW PARAMETER LOCAL_LIST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST= 172.
24.138.105)(PORT=1521))))
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= 172.24.138.104)(PORT=1521))))' scope=both sid=' +ASM1';
SQL> SHOW PARAMETER LOCAL_LIST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST= 172.
24.138.104)(PORT=1521))))
oracle@postmallrac1:~> sqlplus / as sysdba;
SQL> SHOW PARAMETER LOCAL_LIST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST= 172.
24.138.105)(PORT=1521))))
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= 172.24.138.104)(PORT=1521))))' scope=both sid=' postmall1';
SQL> SHOW PARAMETER LOCAL_LIST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST= 172.
24.138.104)(PORT=1521))))
postmallrac1# ./crs_stat -t
grid@postmallrac1:~> lsnrctl status
1、Stop service of current node
postmallrac1# cd /u01/app/grid/product/11.2.0/binpostmallrac1# ./srvctl status service -d postmall
...... //service name,or nothing
postmallrac1# ./srvctl stop service -d postmall -s <Service_name1,Service_name2> -n postmallrac1
2、Find VIP address
postmallrac1# ./srvctl config vip -n postmallrac1VIP exists: /postmallrac1-vip/172.24.138.105/172.24.138.0/255.255.255.0/eth0, hosting node postmallrac1
3、Stop Listener of current node
postmallrac1# ./srvctl stop listener -n postmallrac14、Stop VIP of current node
postmallrac1# ./srvctl stop vip -n postmallrac15、Modify vip
postmallrac1# ./srvctl modify nodeapps -n postmallrac1 -A 172.24.138.104/255.255.255.0/eth0postmallrac1# ./srvctl config vip -n postmallrac1 //check config
6、modify parameter "local_listener"
grid@postmallrac1:~> sqlplus / as sysasmSQL> SHOW PARAMETER LOCAL_LIST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST= 172.
24.138.105)(PORT=1521))))
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= 172.24.138.104)(PORT=1521))))' scope=both sid=' +ASM1';
SQL> SHOW PARAMETER LOCAL_LIST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST= 172.
24.138.104)(PORT=1521))))
oracle@postmallrac1:~> sqlplus / as sysdba;
SQL> SHOW PARAMETER LOCAL_LIST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST= 172.
24.138.105)(PORT=1521))))
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= 172.24.138.104)(PORT=1521))))' scope=both sid=' postmall1';
SQL> SHOW PARAMETER LOCAL_LIST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST= 172.
24.138.104)(PORT=1521))))
7、Make changes into /etc/hosts file on all nodes
8、Start vip
postmallrac1# ./srvctl start vip -n postmallrac19、Start listener
postmallrac1# ./srvctl start listener -n postmallrac110、Start service
postmallrac1# ./srvctl start service -d postmall11、Check
postmallrac1# ifconfigpostmallrac1# ./crs_stat -t
grid@postmallrac1:~> lsnrctl status