oracle11gR2 RAC更換網卡實施方案
環境:
數據庫版本: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
檢查日志、服務