ITPub博客

首页 > 数据库 > Oracle > rac11.2.0.3 修改IP

rac11.2.0.3 修改IP

原创 Oracle 作者:fredxny 时间:2016-03-09 17:55:26 0 删除 编辑
--执行手工OCR的备份
[root@rac1 rac-cluster]# ocrconfig -manualbackup 


--查看ocr的手工备份:
[root@rac1 rac-cluster]# ocrconfig -showbackup manual


vmac2     2016/03/08 10:21:50     /g01/11ggrid/app/11.2.0/grid/cdata/vmac-cluster/backup_20160308_102150.ocr


vmac2     2016/03/07 11:22:49     /g01/11ggrid/app/11.2.0/grid/cdata/vmac-cluster/backup_20160307_112249.ocr




用grid用户执行:
$ cd $GRID_HOME/gpnp/<hostname&get;/profiles/peer/
$ cp -p profile.xml profile.xml.bk




/g01/11ggrid/app/11.2.0/grid/gpnp/vmac1/profiles/peer
这个XML文件不能改,


9.7.2.2 关闭所有的crs资源,仅保留crs的后台进程 
crsctl stop crs


--停止相关资源:
[root@rac1 u01]# srvctl stop database -d PROD
[root@rac1 u01]# srvctl stop listener
[root@rac1 u01]# srvctl stop scan_listener
[root@rac1 u01]# srvctl stop scan
[root@rac1 u01]# srvctl stop cvu
[root@rac1 u01]# srvctl stop nodeapps -n vmac1
[root@rac1 u01]# srvctl stop nodeapps -n vmac2


这个ora.cvu 是oracle的一个数据库健康检查进程,他会调用cluster verification utility 工具执行检查工作,然后将日志输出到$GRID_HOME/log/nodename/cvu/cvulog/cvuxxxx.log.
如下:
[grid@rac1 cvulog]$ pwd
/u01/app/grid/11.2.0/log/rac1/cvu/cvulog
[grid@rac1 cvulog]$ ls
cvu20130714124109.log
[grid@rac1 cvulog]$




9.7.2.3 修改public IP地址 
戴明明(251097186)20:57:18
-- 查看当前配置:
[root@rac1 u01]# su - grid
[grid@rac1 ~]$ oifcfg getif -global
[root@vmac1 ~]# oifcfg getif -global
eth1  172.168.9.0  global  cluster_interconnect
eth0  192.168.9.0  global  public
 
戴明明(251097186)20:57:30


----删除public配置
oifcfg delif -global eth0
oifcfg delif -global eth1
PRIF-31: 无法删除指定的网络接口, 因为该接口是最后一个专用接口




----添加public 配置
[grid@rac1 ~]$ 
oifcfg setif -global eth0/192.168.9.0:public
oifcfg setif -global eth1/192.168.8.0:cluster_interconnect


[grid@vmac1 peer]$ oifcfg getif -global
eth1  172.168.9.0  global  cluster_interconnect
eth0  192.168.8.0  global  public
eth1  192.168.8.0  global  cluster_interconnect




9.7.2.4 用grid用户修改VIP 地址 




9.7.2.4.1 查看当前的VIP 信息
[root@rac1 /]# srvctl config nodeapps -a


Network exists: 1/192.168.8.0/255.255.252.0/eth0, type static
VIP exists: /192.168.9.71/192.168.9.72/192.168.8.0/255.255.252.0/eth0, hosting node vmac1
VIP exists: /192.168.9.73/192.168.9.74/192.168.8.0/255.255.252.0/eth0, hosting node vmac2








9.7.2.4.2 用root用户修改VIP 信息


# srvctl modify nodeapps -n <node&get; -A <new_vip_address or new_vip_hostname&get;/<netmask&get;/<[if1[if2...]]&get;


[root@rac1 /]# srvctl modify nodeapps -n vmac1 -A 192.168.9.72/255.255.252.0/eth0
[root@rac1 /]# srvctl modify nodeapps -n vmac2 -A 192.168.9.74/255.255.252.0/eth0
 
[root@vmac1 ~]# srvctl config nodeapps -a
Network exists: 1/192.168.8.0/255.255.252.0/eth0, type static
VIP exists: /192.168.8.71/192.168.8.71/192.168.8.0/255.255.252.0/eth0, hosting node vmac1
VIP exists: /192.168.8.73/192.168.8.73/192.168.8.0/255.255.252.0/eth0, hosting node vmac2




9.7.2.5 修改private IP地址 
D48-俊凯-二期(2394052242)21:02:30
终于起来了 
戴明明(251097186)21:02:32
----删除Private配置
[grid@rac1 ~]$ oifcfg delif -global eth1
PRIF-31: Failed to delete the specified network interface because it is the last private interface
[grid@rac1 ~]$
 
--确认网卡配置:
[root@rac1 /]# oifcfg getif -global
eth1  172.168.9.0  global  cluster_interconnect
eth0  192.168.8.0  global  public
eth1  192.168.8.0  global  cluster_interconnect


9.7.2.5.1 确认网卡配置
[grid@rac1 ~]$ oifcfg getif -global
eth0  192.168.3.0  global  public
eth1  192.168.1.0  global  cluster_interconnect


9.7.2.5.2 用grid用户添加一个新的private 配置
[grid@rac1 ~]$ oifcfg setif -global eth1/192.168.2.0:cluster_interconnect


这里的网卡名称若相同,则网段必须不同。 


--验证:
[grid@rac1 ~]$ oifcfg getif -global
eth1  192.168.1.0  global  cluster_interconnect
eth0  192.168.3.0  global  public
eth1  192.168.2.0  global  cluster_interconnect




9.7.2.6 修改RAC SCAN IP 




--查看scan状态:
[root@rac1 ~]# srvctl config scan
SCAN name: vmac-cluster-scan, Network: 1/192.168.8.0/255.255.252.0/eth0
SCAN VIP name: scan1, IP: /vmac-cluster-scan/192.168.9.89


--准备修改:
$srvctl stop scan_listener
$srvctl stop scan
$srvctl status scan
 
[root@vmac1 ~]# srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running




--根据我们/etc/hosts中的修改:
192.168.8.79 rac-scan
 




--用root进行修改:
[root@rac1 ~]# srvctl modify scan -n vmac-cluster-scan


[root@vmac1 ~]# srvctl config scan
SCAN name: vmac-cluster-scan, Network: 1/192.168.8.0/255.255.252.0/eth0
SCAN VIP name: scan1, IP: /vmac-cluster-scan/192.168.8.79


9.7.2.7 用root停止所有节点上的clusterware并禁止其自启动
[root@rac1 u01]# crsctl stop crs  (有些停不掉呀,)
[root@rac1 u01]# crsctl disable crs


 






[root@vmac1 ~]# crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATADG2.dg ora....up.type ONLINE    OFFLINE               
ora.DATAGP.dg  ora....up.type ONLINE    OFFLINE               
ora....ER.lsnr ora....er.type OFFLINE   OFFLINE               
ora....N1.lsnr ora....er.type OFFLINE   OFFLINE               
ora....MDG1.dg ora....up.type ONLINE    OFFLINE               
ora.asm        ora.asm.type   ONLINE    OFFLINE               
ora.cvu        ora.cvu.type   OFFLINE   OFFLINE               
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    vmac1       
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    vmac1       
ora.ons        ora.ons.type   OFFLINE   OFFLINE               
ora.prod.db    ora....se.type ONLINE    OFFLINE               
ora....taf.svc ora....ce.type OFFLINE   OFFLINE               
ora....ce2.svc ora....ce.type OFFLINE   OFFLINE               
ora.scan1.vip  ora....ip.type OFFLINE   OFFLINE               
ora....SM1.asm application    ONLINE    OFFLINE               
ora....C1.lsnr application    OFFLINE   OFFLINE               
ora.vmac1.gsd  application    OFFLINE   OFFLINE               
ora.vmac1.ons  application    OFFLINE   OFFLINE               
ora.vmac1.vip  ora....t1.type OFFLINE   ONLINE    vmac1       
ora....SM2.asm application    ONLINE    OFFLINE               
ora....C2.lsnr application    OFFLINE   OFFLINE               
ora.vmac2.gsd  application    OFFLINE   OFFLINE               
ora.vmac2.ons  application    OFFLINE   OFFLINE               
ora.vmac2.vip  ora....t1.type OFFLINE   ONLINE    vmac2       




[root@rac2 ~]# crsctl stop crs -f


9.7.2.8 修改操作系统上的网络配置


这里的修改包括/etc/hosts 文件和网卡的相关信息,修改完之后,重启网络服务。


[root@rac1 ~]# cat /etc/hosts
127.0.0.1   localhost  


192.168.3.150 rac1 rac1-public
192.168.2.110 rac1-priv
192.168.3.151 rac1-vip
              
192.168.3.152 rac2 rac2-public
192.168.2.111 rac2-priv
192.168.3.153 rac2-vip
              
192.168.3.154 rac3 rac3-public
192.168.2.112 rac3-priv
192.168.3.155 rac3-vip
              
192.168.3.253 rac-scan


[root@rac1 ~]#


vim /etc/sysconfig/network-scripts/ifcfg-eth1
vim /etc/sysconfig/network-scripts/ifcfg-eth0


[root@rac1 network-scripts]# service network restart




9.7.2.9 在所有节点用root用户enable并启动clusterware


[root@rac1 /]# crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@rac1 /]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
[root@rac1 /]#




9.7.2.10 删除旧的Private 配置信息并确认Private 修改成功


[grid@rac1 ~]$ oifcfg delif -global eth1/192.168.9.0


oifcfg delif -global eth1/192.168.8.0:cluster_interconnect   --ok




--确认添加成功:
[root@rac2 ~]# oifcfg getif -global
eth0  192.168.3.0  global  public
eth1  192.168.2.0  global  cluster_interconnect

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28999336/viewspace-2052030/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-09-05

  • 博文量
    7
  • 访问量
    29722