原hosts
92.18.1.52 rac1
92.18.1.53 rac2
92.18.1.54 rac1-vip
92.18.1.55 rac2-vip
92.18.56.10 rac1-priv
92.18.56.20 rac2-priv
修改为
92.18.100.152 rac1
92.18.100.153 rac2
92.18.100.154 rac1-vip
92.18.100.155 rac2-vip
92.18.56.10 rac1-priv
92.18.56.20 rac2-priv
1:关闭数据库实例,asm实例,nodeapps
[oracle@rac2 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.rac.db application 0/0 0/1 ONLINE ONLINE rac1
ora....c1.inst application 0/5 0/0 ONLINE ONLINE rac1
ora....c2.inst application 0/5 0/0 ONLINE ONLINE rac2
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2
ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip application 0/0 0/0 ONLINE ONLINE rac2
[oracle@rac2 ~]$ srvctl stop database -d rac -o immediate
[oracle@rac2 ~]$ crs_stop -all
二、修改publicip, vip,scan ip
1 修改两边的/etc/hosts文件
#修改前最好做个备份
修改后如下
92.18.100.152 rac1
92.18.100.153 rac2
92.18.100.154 rac1-vip
92.18.100.155 rac2-vip
92.18.56.10 rac1-priv
92.18.56.20 rac2-priv
2修改2个节点的listener.ora文件
3 修改rac1及rac2网卡配置
(1)rac1:vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改ip为92.18.100.152掩码255.255.255.0
service network restart//重启网卡
(2)rac2:vi/etc/sysconfig/network-scripts/ifcfg-eth0
修改ip为92.18.100.153掩码 255.255.255.0
service network restart//重启网卡
重启2个节点
4 集群的public IP 设置(如果属于同一网段,可不修改)
start crs后,请稍等一会儿再执行
[root@rac1bin]# ./oifcfg getif //查看下集群的VIP
eth0 92.18.1.0 global public
eth1 92.18.56.0 global cluster_interconnect
[root@rac1bin]# ./oifcfg delif -global eth0
[root@rac1bin]# ./oifcfg setif -global eth0/92.18.100.0:public
[root@rac1/2bin]# ./oifcfg getif //两边查看下集群的VIP
如果需要修改private ip 则需要先用
[root@rac1bin]# ./oifcfg delif -global eth1
[root@rac1bin]#./oifcfg setif -global eth1/x.x.x.0:cluster_interconnect(注意,我前面修改网卡可没有修改private,private是要在这步先修改后,才可以修改的)
5 集群的VIP设置
查看集群的vip
[oracle@rac1 ~]$srvctl config nodeapps -n rac1 -a
[oracle@rac1 ~]$srvctl config nodeapps -n rac2 -a
[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/crs_1/bin/
[root@rac1 bin]# ./oifcfg iflist
eth0 92.18.1.0
eth0 92.18.100.0
eth1 92.18.56.0
[root@rac1 bin]# ./oifcfg getif
[root@rac1 bin]# ./oifcfg setif -global eth0/92.18.2.0:public
[root@rac1 bin]# ./oifcfg setif -global eth1/92.18.123.0:cluster_interconnect
[root@rac1 bin]# ./oifcfg getif
eth0 92.18.100.0 global public
eth1 92.18.56.0 global cluster_interconnect
[oracle@rac1 ~]$ srvctl stop database -d rac -o immediate
[oracle@rac1 ~]$ srvctl stop listener -n rac1
[oracle@rac1 ~]$ srvctl stop listener -n rac2
[root@rac1 bin]# ./srvctl modify nodeapps -n rac1 -A 92.18.100.154/255.255.255.0/eth0
[root@rac2 bin]# ./srvctl modify nodeapps -n rac2 -A 92.18.100.155/255.255.255.0/eth0
修改tnsname
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 92.18.100.154)(PORT = 1521))' sid='orcl1' ;
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 92.18.100.155)(PORT = 1521))' sid='orcl2' ;
7 重启2个节点
[oracle@rac1 ~]$ crs_start -all
92.18.1.52 rac1
92.18.1.53 rac2
92.18.1.54 rac1-vip
92.18.1.55 rac2-vip
92.18.56.10 rac1-priv
92.18.56.20 rac2-priv
修改为
92.18.100.152 rac1
92.18.100.153 rac2
92.18.100.154 rac1-vip
92.18.100.155 rac2-vip
92.18.56.10 rac1-priv
92.18.56.20 rac2-priv
1:关闭数据库实例,asm实例,nodeapps
[oracle@rac2 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.rac.db application 0/0 0/1 ONLINE ONLINE rac1
ora....c1.inst application 0/5 0/0 ONLINE ONLINE rac1
ora....c2.inst application 0/5 0/0 ONLINE ONLINE rac2
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2
ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip application 0/0 0/0 ONLINE ONLINE rac2
[oracle@rac2 ~]$ srvctl stop database -d rac -o immediate
[oracle@rac2 ~]$ crs_stop -all
二、修改publicip, vip,scan ip
1 修改两边的/etc/hosts文件
#修改前最好做个备份
修改后如下
92.18.100.152 rac1
92.18.100.153 rac2
92.18.100.154 rac1-vip
92.18.100.155 rac2-vip
92.18.56.10 rac1-priv
92.18.56.20 rac2-priv
2修改2个节点的listener.ora文件
3 修改rac1及rac2网卡配置
(1)rac1:vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改ip为92.18.100.152掩码255.255.255.0
service network restart//重启网卡
(2)rac2:vi/etc/sysconfig/network-scripts/ifcfg-eth0
修改ip为92.18.100.153掩码 255.255.255.0
service network restart//重启网卡
重启2个节点
4 集群的public IP 设置(如果属于同一网段,可不修改)
start crs后,请稍等一会儿再执行
[root@rac1bin]# ./oifcfg getif //查看下集群的VIP
eth0 92.18.1.0 global public
eth1 92.18.56.0 global cluster_interconnect
[root@rac1bin]# ./oifcfg delif -global eth0
[root@rac1bin]# ./oifcfg setif -global eth0/92.18.100.0:public
[root@rac1/2bin]# ./oifcfg getif //两边查看下集群的VIP
如果需要修改private ip 则需要先用
[root@rac1bin]# ./oifcfg delif -global eth1
[root@rac1bin]#./oifcfg setif -global eth1/x.x.x.0:cluster_interconnect(注意,我前面修改网卡可没有修改private,private是要在这步先修改后,才可以修改的)
5 集群的VIP设置
查看集群的vip
[oracle@rac1 ~]$srvctl config nodeapps -n rac1 -a
[oracle@rac1 ~]$srvctl config nodeapps -n rac2 -a
[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/crs_1/bin/
[root@rac1 bin]# ./oifcfg iflist
eth0 92.18.1.0
eth0 92.18.100.0
eth1 92.18.56.0
[root@rac1 bin]# ./oifcfg getif
[root@rac1 bin]# ./oifcfg setif -global eth0/92.18.2.0:public
[root@rac1 bin]# ./oifcfg setif -global eth1/92.18.123.0:cluster_interconnect
[root@rac1 bin]# ./oifcfg getif
eth0 92.18.100.0 global public
eth1 92.18.56.0 global cluster_interconnect
[oracle@rac1 ~]$ srvctl stop database -d rac -o immediate
[oracle@rac1 ~]$ srvctl stop listener -n rac1
[oracle@rac1 ~]$ srvctl stop listener -n rac2
[root@rac1 bin]# ./srvctl modify nodeapps -n rac1 -A 92.18.100.154/255.255.255.0/eth0
[root@rac2 bin]# ./srvctl modify nodeapps -n rac2 -A 92.18.100.155/255.255.255.0/eth0
修改tnsname
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 92.18.100.154)(PORT = 1521))' sid='orcl1' ;
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 92.18.100.155)(PORT = 1521))' sid='orcl2' ;
7 重启2个节点
[oracle@rac1 ~]$ crs_start -all