redhat5.8 + oracle 11.2.0.4 的RAC数据库,修改public IP、VIP和scan-IP。参考了mos上的两篇文档,按文档进行了修改,过程如下:
修改前IP 修改后IP
192.168.156.211 10.3.1.211 db1
192.168.156.212 10.3.1.212 db2
192.168.156.213 10.3.1.213 db1-vip
192.168.156.214 10.3.1.214 db1-vip
172.16.156.211 172.16.156.211 db1-priv #不需要修改
172.16.156.212 172.16.156.212 db2-priv #不需要修改
192.168.156.215 10.3.1.215 db-scan
一、停止CRS相关资源的启动
1、禁止所有节点自启动及停止节点数据库、监听(在一个节点执行)
[root@db1 bin]# ./srvctl disable listener -n db1
[root@db1 bin]# ./srvctl disable listener -n db2
[root@db1 bin]# ./srvctl stop listener -n db1
[root@db1 bin]# ./srvctl stop listener -n db2
[root@db1 bin]# ./srvctl disable database -d prudb
[root@db1 bin]# ./srvctl stop database -d prudb -o immediate
2、禁止所有节点自启动并停止vip(必须与/etc/hosts文件中的vip名称)(在一个节点执行)
[root@db1 bin]# ./srvctl disable vip -i db1-vip
[root@db1 bin]# ./srvctl disable vip -i db2-vip
[root@db1 bin]# ./srvctl stop vip -n db1
[root@db1 bin]# ./srvctl stop vip -n db2
3、禁止所有节点自启动并停止scan_listener(在一个节点执行)
[root@db1 bin]# ./srvctl disable scan_listener
[root@db1 bin]# ./srvctl disable scan
[root@db1 bin]# ./srvctl stop scan_listener
[root@db1 bin]# ./srvctl stop scan
4、停止节点的crs
[root@db1 bin]# ./crsctl stop crs (所有节点执行)
CRS-2791: Starting shutdown of Oracle High Availability
…… CRS-4133: Oracle High Availability Services has been stopped.
二、修改public IP、VIP、scan_IP
1、修改/etc/hosts文件
修改public IP、VIP、scan-IP
2、修改网卡IP地址
setup 或者 图形化 network,然后重启网卡 service network restart
3、检查网卡配置是否生效
Ifconfig -a
4、启动crs(所有节点执行)
[root@db1 bin]# ./crsctl start crs
5、集群public IP重新设置
[root@db1 bin]# ./oifcfg getif
en1 172.16.156.0 global cluster_interconnect
en0 192.168.156.0 global public
[root@db1 bin]# ./oifcfg delif -global en0/192.168.156.0
[root@db1 bin]# ./oifcfg setif -global en0/10.3.1.0:public
[root@db1 bin]# ./oifcfg getif
en1 172.16.156.0 global cluster_interconnect
en0 10.3.1.0 global public
6、集群vip重新设置
[root@db1 bin]# ./srvctl config vip -n db1
VIP exists: /db1-vip/192.168.156.213/192.168.156.0/255.255.255.0/en0, hosting node db1
[root@db1 bin]# ./srvctl config vip -n db2
VIP exists: /db2-vip/192.168.156.214/192.168.156.0/255.255.255.0/en0, hosting node db2
[root@db1 bin]# ./srvctl modify nodeapps -n db1 -A 10.3.1.213/255.255.255.0/en0
[root@db1 bin]# ./srvctl modify nodeapps -n db2 -A 10.3.1.214/255.255.255.0/en0
[root@db1 bin]# ./srvctl config vip -n db1
VIP exists: /db1-vip/10.3.1.213/10.3.1.0/255.255.255.0/en0, hosting node db1
[root@db1 bin]# ./srvctl config vip -n db2
VIP exists: /db2-vip/10.3.1.214/10.3.1.0/255.255.255.0/en0, hosting node db2
7、集群scan IP重新设置
[root@db1 bin]# ./srvctl config scan
SCAN name: 192.168.156.215, Network: 1/192.168.156.0/255.255.255.0/en0
SCAN VIP name: scan1, IP: /192.168.156.215/192.168.156.215
[root@db1 bin]# ./srvctl modify scan -n 10.3.1.215
[root@db1 bin]# ./srvctl config scan
SCAN name: 10.3.1.215, Network: 1/10.3.1.0/255.255.255.0/en0
SCAN VIP name: scan1, IP: /10.3.1.215/10.3.1.215
[root@db1 bin]# ./srvctl modify scan_listener -u
三、启动并开启CRS资源的自启动
1、启动listener
[root@db1 bin]# ./srvctl enable listener -n db1
[root@db1 bin]# ./srvctl enable listener -n db2
[root@db1 bin]# ./srvctl enable vip -i db1-vip
[root@db1 bin]# ./srvctl enable vip -i db2-vip
[root@db1 bin]# ./srvctl start listener -n db1
[root@db1 bin]# ./srvctl start listener -n db2
2、启动scan_listener
[root@db1 bin]# ./srvctl enable scan_listener
[root@db1 bin]# ./srvctl enable scan
[root@db1 bin]# ./srvctl start scan_listener
3、启动数据库
[root@db1 bin]# ./srvctl enable database -d prudb
[root@db1 bin]# ./srvctl start database -d prudb
4、在节点中修改local_listener参数
alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST =db1-vip)(PORT = 1521))' scope=both sid='prudb1';
alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST =db2-vip)(PORT = 1521))' scope=both sid='prudb2';
四、关于RAC环境下,修改hostname
hostname在安装好了以后就不能修改了。如果要修改,只能通过”删除节点->新建节点“的方式修改