环境:
数据库版本:oracle 11.2.0.4
是否RAC:两个节点的RAC
--准备工作
更换前:
10.100.10.62 en1
10.100.10.200 en1
更换后:
10.100.10.62 en8
10.100.10.200 en8
1. 查看修改前的Public IP配置
testdb1:/home/oracle(testdb1)$oifcfg getif
en1 10.100.10.0 global public
en3 192.168.110.0 global cluster_interconnect
2. 查看节点1修改前的VIP配置
testdb1:/home/oracle(testdb1)$srvctl config vip -n testdb1
VIP exists: /testdb1-vip/10.100.10.156/10.100.10.0/255.255.255.0/en1, hosting node testdb1
3. 查看节点2修改前的VIP配置
testdb2:/home/oracle(testdb2)$srvctl config vip -n testdb2
VIP exists: /testdb2-vip/10.100.10.157/10.100.10.0/255.255.255.0/en1, hosting node testdb2
4. 检查当前scan IP配置
testdb1:/home/oracle(testdb1)$srvctl config scan
SCAN name: testdb-scan, Network: 1/10.100.10.0/255.255.255.0/en1
SCAN VIP name: scan1, IP: /testdb-scan/10.100.10.158
5. 检查OCR备份
testdb1:/home/oracle(testdb1)$ocrconfig -showbackup
testdb1 2016/09/18 09:18:48 /oracle/app/11.2.0/grid/cdata/testdb-cluster/backup00.ocr
testdb1 2016/09/18 05:18:47 /oracle/app/11.2.0/grid/cdata/testdb-cluster/backup01.ocr
testdb1 2016/09/18 01:18:46 /oracle/app/11.2.0/grid/cdata/testdb-cluster/backup02.ocr
testdb1 2016/09/16 13:18:38 /oracle/app/11.2.0/grid/cdata/testdb-cluster/day.ocr
testdb1 2016/09/07 04:11:26 /oracle/app/11.2.0/grid/cdata/testdb-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
#手工备份OCR
su - root
/oracle/app/11.2.0/grid/bin/ocrconfig -export /home/oracle/ocr_bak20160918
###############################################################################################
一. 停止业务
hostname 查看主机
id 查看id
查看每个节点crs状态
crsctl stat res -t
二. 停止CRS相关资源的自启动
1. 停止监听资源
su - oracle
srvctl disable listener
srvctl stop listener
crsctl stat res -t
2. 停止数据库资源(每个节点)
su - oracle
ps -ef|grep LOCAL=NO|awk '{print $2}'|xargs kill -9
select * from v$FAST_START_TRANSACTIONS where UNDOBLOCKSDONE <> UNDOBLOCKSTOTAL; --查看是否有大事物回滚,如存在需等待回滚完毕
select undoblocksdone,undoblockstotal from v$fast_start_transactions where state<>'RECOVERED';
sqlplus / as sysdba
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system checkpoint;
srvctl disable database -d testdb (只需在一个节点操作)
srvctl stop database -d testdb -o immediate (只需在一个节点操作)
crsctl stat res -t
新开窗口 ora log 查看日志
tail -300f /oraclelog/diag/rdbms/testdb/testdb1/trace/alert*.log
tail -300f /oraclelog/diag/rdbms/testdb/testdb2/trace/alert*.log
3. 停止VIP资源(每个节点)
停节点1:
su - root
/oracle/app/11.2.0/grid/bin/srvctl disable vip -i testdb1-vip
/oracle/app/11.2.0/grid/bin/srvctl stop vip -n testdb1
停节点2:
su - root
/oracle/app/11.2.0/grid/bin/srvctl disable vip -i testdb2-vip
/oracle/app/11.2.0/grid/bin/srvctl stop vip -n testdb2
4. 停止scan_listener资源
su - root
/oracle/app/11.2.0/grid/bin/srvctl disable scan_listener (只需在一个节点操作)
/oracle/app/11.2.0/grid/bin/srvctl stop scan_listener (只需在一个节点操作)
5. 停止scan资源
su - root
/oracle/app/11.2.0/grid/bin/srvctl disable scan (只需在一个节点操作)
/oracle/app/11.2.0/grid/bin/srvctl stop scan (只需在一个节点操作)
6. 停止crs服务(每个节点)
su - root
/oracle/app/11.2.0/grid/bin/crsctl stop crs
7. 主机侧将 Public IP(10.100.10.62/200) 对应网卡 en1 更换为 en8 ,IP地址/子网掩码等配置不变
8. 启动crs服务(每个节点)
su - root
/oracle/app/11.2.0/grid/bin/crsctl start crs
查看crs状态
crsctl stat res -t
二. 修改网卡名称(Public IP)
1. 查看修改前的Public IP配置
testdb1:/home/oracle(testdb1)$oifcfg getif
en1 10.100.10.0 global public
en3 192.168.110.0 global cluster_interconnect
2. 删除 en1 的Public IP
su - grid
oifcfg delif -global en1
3. 添加 en8 的Public IP
su - grid
oifcfg setif -global en8/10.100.10.0:public
4. 查看修改修改后的Public IP配置
testdb1:/home/oracle(testdb1)$oifcfg getif
四. 修改网卡名称(VIP)
1. 查看节点1修改前的VIP配置
testdb1:/home/oracle(testdb1)$srvctl config vip -n testdb1
VIP exists: /testdb1-vip/10.100.10.156/10.100.10.0/255.255.255.0/en1, hosting node testdb1
2. 查看节点2修改前的VIP配置
testdb2:/home/oracle(testdb2)$srvctl config vip -n testdb2
VIP exists: /testdb2-vip/10.100.10.157/10.100.10.0/255.255.255.0/en1, hosting node testdb2
3. 修改节点1上的VIP配置
su - root
/oracle/app/11.2.0/grid/bin/srvctl modify nodeapps -n testdb1 -A 10.100.10.156/255.255.255.0/en8
4. 修改节点2上的VIP配置
su - root
/oracle/app/11.2.0/grid/bin/srvctl modify nodeapps -n testdb2 -A 10.100.10.157/255.255.255.0/en8
5. 查看节点1修改后的VIP配置
srvctl config vip -n testdb1
6. 查看节点2修改后的VIP配置
srvctl config vip -n testdb2
五. 检查当前scan IP配置
testdb1:/home/oracle(testdb1)$srvctl config scan
SCAN name: testdb-scan, Network: 1/10.100.10.0/255.255.255.0/en1
SCAN VIP name: scan1, IP: /testdb-scan/10.100.10.158
六. 修改CRS相关资源为自启动. 重新启动CRS
su - root
/oracle/app/11.2.0/grid/bin/srvctl enable listener //listener资源
/oracle/app/11.2.0/grid/bin/srvctl enable database -d testdb //数据库资源
/oracle/app/11.2.0/grid/bin/srvctl enable vip -i testdb1-vip //节点1的VIP资源
/oracle/app/11.2.0/grid/bin/srvctl enable vip -i testdb2-vip //节点2的VIP资源
/oracle/app/11.2.0/grid/bin/srvctl enable scan_listener //scan_listener资源
/oracle/app/11.2.0/grid/bin/srvctl enable scan //scan资源
重启CRS服务(两个节点分别执行)
/oracle/app/11.2.0/grid/bin/crsctl stop crs
/oracle/app/11.2.0/grid/bin/crsctl start crs
检查日志、服务
本文名称:oracle11gR2RAC更换网卡实施方案
网页网址:
http://cxhlcq.cn/article/ihhiic.html