设为首页 收藏本站
查看: 918|回复: 0

[经验分享] ORACLE RAC11G 更改IP地址

[复制链接]

尚未签到

发表于 2018-9-10 10:26:54 | 显示全部楼层 |阅读模式
  环境:oracle 11.2.0.4  rac
  修改前IP地址
  # public ip
  192.168.2.71 db1
  192.168.2.72 db2
  192.168.2.76 db3
  #priv ip
  200.100.100.11 db1-priv
  200.100.100.12 db2-priv
  200.100.100.13 db3-priv
  #vip ip
  192.168.2.73 db1-vip
  192.168.2.74 db2-vip
  192.168.2.77 db3-vip
  #scan ip
  192.168.2.75 db-scan
  修改后IP地址
  # public ip
  192.168.1.71 db1
  192.168.1.72 db2
  192.168.1.76 db3
  #priv ip
  100.100.100.11 db1-priv
  100.100.100.12 db2-priv
  100.100.100.13 db3-priv
  #vip ip
  192.168.1.73 db1-vip
  192.168.1.74 db2-vip
  192.168.1.77 db3-vip
  #scan ip
  192.168.1.75 db-scan
  1、查看ocr的备份
  [root@db1 bin]# ./ocrconfig -showbackup
  2、备份OCR
  [root@db1 bin]# ./ocrconfig -manualbackup
  db3     2015/01/29 19:58:22     /u01/app/11.2.0/grid/cdata/db-scan/backup_20150129_195822.ocr
  3、关闭数据库
  srvctl stop database -d db
  4、在任意节点上修改:
  这里我是在节点1上面操作的
  [root@db1 ~]# cd /u01/app/11.2.0/grid/bin/
  [root@db1 bin]# ./oifcfg getif
  eth0  192.168.2.0  global  public
  eth1  200.100.100.0  global  cluster_interconnect
  [root@db1 bin]# ./oifcfg delif -global eth0
  [root@db1 bin]# ./oifcfg setif -global eth0/192.168.1.0:public
  [root@db1 bin]# ./oifcfg getif
  eth1  200.100.100.0  global  cluster_interconnect
  eth0  192.168.1.0  global  public
  [root@db1 bin]# ./oifcfg delif -global eth1
  PRIF-31: Failed to delete the specified network interface because it is the last private interface
  这里不允许删除最后一个私有接口,可以先添加一个私有接口再来删除
  [root@db1 bin]# ./oifcfg setif -global eth1/200.100.100.0:cluster_interconnect
  [root@db1 bin]# ./oifcfg getif
  eth1  100.100.100.0  global  cluster_interconnect
  eth0  192.168.2.0  global  public
  eth1  200.100.100.0  global  cluster_interconnect
  [root@db1 bin]# ./oifcfg delif -global eth1/100.100.100.0:cluster_interconnect
  [root@db1 bin]# ./oifcfg getif
  eth0  192.168.2.0  global  public
  eth1  200.100.100.0  global  cluster_interconnect
  在某节点停止oracle高可能用性服务
  [root@db1 bin]# ./crsctl stop cluster -all
  5、修改IP地址及/etc/hosts文件并测试
  6、在所有节点重新启动所有服务
  [root@db1 bin]#./crsctl start cluster -all
  7、停止scan_listener和scan
  [root@db1 bin]#./srvctl stop scan_listener
  [root@db1 bin]#./srvctl stop scan
  8、删除scan_listener和scan
  [root@db1 bin]#./srvctl remove scan_listener -f
  [root@db1 bin]#./srvctl remove scan -f
  9、添加scan和scan_listener
  [root@db1 bin]#./srvctl add scan -n db-scan -k 2 -S 192.168.1.0/255.255.255.0/eth0
  说明:上面命令中-k 为1(network number)会报错,因为之前已经被使用过
  [root@db1 bin]# ./srvctl config scan
  SCAN name: db-scan, Network: 2/192.168.1.0/255.255.255.0/eth0
  SCAN VIP name: scan1, IP: /db-scan/192.168.1.75
  [root@db1 bin]#./srvctl add scan_listener
  10、启动scan和scan_listener
  [root@db1 bin]#./srvctl start scan
  [root@db1 bin]#./srvctl start scan_listener
  11、停止VIP资源
  [root@db1 bin]# ./crsctl stop resource ora.db1.vip -f
  [root@db1 bin]# ./crsctl stop resource ora.db2.vip -f
  [root@db1 bin]# ./crsctl stop resource ora.db3.vip -f
  这里可以通过下面命令查看vip的状态
  [root@db1 bin]# ./crsctl stat res -t
  ora.db1.vip
  1        OFFLINE OFFLINE
  ora.db2.vip
  1        OFFLINE OFFLINE
  ora.db3.vip
  1        OFFLINE OFFLINE
  12、修改vip地址
  [root@db1 bin]# ./srvctl modify nodeapps -A 192.168.1.73/255.255.255.0/eth0 -n db1
  [root@db1 bin]# ./srvctl modify nodeapps -A 192.168.1.74/255.255.255.0/eth0 -n db2
  [root@db1 bin]# ./srvctl modify nodeapps -A 192.168.1.77/255.255.255.0/eth0 -n db3
  13、启动VIP资源:
  [root@db1 bin]# ./crsctl start resource ora.db1.vip -f
  CRS-2672: Attempting to start 'ora.db1.vip' on 'db1'
  CRS-2676: Start of 'ora.db1.vip' on 'db1' succeeded
  [root@db1 bin]# ./crsctl start resource ora.db2.vip -f
  CRS-2672: Attempting to start 'ora.db2.vip' on 'db2'
  CRS-2676: Start of 'ora.db2.vip' on 'db2' succeeded
  [root@db1 bin]# ./crsctl start resource ora.db3.vip -f
  CRS-2672: Attempting to start 'ora.db3.vip' on 'db3'
  CRS-2676: Start of 'ora.db3.vip' on 'db3' succeeded
  启动VIP资源后本地监听就已经启动了,下面第14步操作可以不执行
  14、启动本地监听:
  [root@db1 bin]# ./srvctl start listener -n db1
  [root@db1 bin]# ./srvctl start listener -n db2
  [root@db1 bin]# ./srvctl start listener -n db3
  问题:操作完成之后执行oifcfg getif,出现在下面的提示信息
  [grid@db1 peer]$ oifcfg getif
  eth0  192.168.1.0  global  public
  eth1  100.100.100.0  global  cluster_interconnect
  Only in OCR: eth1:  100.100.100.0  global  cluster_interconnect
  PRIF-30: Network information in OCR and GPnP profile differs
  说网络信息在OCR与GPnP不一致,这里重新配置一下即可
  [grid@db1 peer]$ oifcfg setif -global eth1/100.100.100.0:cluster_interconnect
  [grid@db1 peer]$ oifcfg getif
  eth0  192.168.1.0  global  public
  eth1  100.100.100.0  global  cluster_interconnect


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-570820-1-1.html 上篇帖子: ORACLE PL/SQL练习(七) 下篇帖子: Oracle ORA-08591告警
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表