ORACLE RAC11G 更改IP地址
admin
2023-05-11 04:20:53
0

环境: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

eth2  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

eth2  200.100.100.0  global  cluster_interconnect

eth0  192.168.1.0  global  public


[root@db1 bin]# ./oifcfg delif -global eth2

PRIF-31: Failed to delete the specified network interface because it is the last private interface

这里不允许删除最后一个私有接口,可以先添加一个私有接口再来删除

[root@db1 bin]# ./oifcfg setif -global eth2/200.100.100.0:cluster_interconnect

[root@db1 bin]# ./oifcfg getif

eth2  100.100.100.0  global  cluster_interconnect

eth0  192.168.2.0  global  public

eth2  200.100.100.0  global  cluster_interconnect


[root@db1 bin]# ./oifcfg delif -global eth2/100.100.100.0:cluster_interconnect

[root@db1 bin]# ./oifcfg getif

eth0  192.168.2.0  global  public

eth2  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

eth2  100.100.100.0  global  cluster_interconnect

Only in OCR: eth2:  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 eth2/100.100.100.0:cluster_interconnect

[grid@db1 peer]$ oifcfg getif

eth0  192.168.1.0  global  public

eth2  100.100.100.0  global  cluster_interconnect


上一篇:awk命令(1)

下一篇:ORACLE PL/SQL练习(四)

相关内容

热门资讯

以军士兵集体丢掉武器抗命,大喊... 据凤凰卫视报道,以色列国防军一军事基地7月30日发生士兵抗命事件,约120名士兵抗议指挥官做法,将武...
蒋成华任商务部副部长 国务院任免国家工作人员。任命蒋成华为商务部副部长。免去蒋成华的商务部国际贸易谈判副代表职务。
伊朗驻华大使:在军事威胁下,不... 新华社北京7月31日电(记者刁慧琳) 伊朗驻华大使法兹里7月28日表示,伊美回到谈判桌的前提是美国必...
伊朗革命卫队在霍尔木兹海峡击中... 当地时间31日,伊朗伊斯兰革命卫队发布声明称,革命卫队海军当天在霍尔木兹海峡击中并扣留了两艘违反禁令...
美媒:特朗普,遇到了一个更强硬... 据《纽约时报》7月29日报道,就在特朗普总统看似放弃战事升级计划几天后,美国再次与伊朗交火。上周末,...
女子做气管镜时不幸身亡,丈夫称... 7月29日,西安刘先生反映妻子在当地医院做支气管镜检查时死亡,看监控时发现医生疑有违规操作。刘先生表...
全网“帮卖西瓜”,然后呢? 近日,河南部分地区西瓜滞销的消息在网上热度很高。很多地方也伸出援手:有景区收购千斤西瓜、免费赠予游客...
美媒:乌克兰袭击伊朗船只,险引... 据《纽约时报》7月28日报道,据伊朗和西方官员称,伊朗曾考虑攻击乌克兰的一个港口,以报复乌克兰对一艘...
20年里,他只画美女,用东方风... 迈进KIM在上海的工作室,迎面是一整墙的美女们。她们像是刚从一场时髦的沙龙里退场,或倚或立,眉宇间是...
Google在港推出AI代理G... 观点网讯:7月29日,Google在香港推出AI代理Gemini Spark,该代理可全天候在后台运...