RAC線上替換OCR、DATA、FRA等ASM磁碟
RAC線上替換OCR、DATA、FRA等ASM磁碟
環境描述:
ORACLE Version:11.2.0.3.0
RHEL6.4+ASMlib
由於共享儲存需進行升級,故需對所有ASM磁碟進行線上遷移。
1.收集資訊
su - grid
export ORACLE_SID=+ASM1
sqlplus / as sysasm
col NAME for a10
col LABEL for a20
col STATE for a10
col FAILGROUP for a10
col PATH for a20
set line 150
SELECT GROUP_NUMBER, DISK_NUMBER, LABEL, STATE, FAILGROUP, NAME, PATH, TOTAL_MB, FREE_MB FROM V$ASM_DISK;
GROUP_NUMBER DISK_NUMBER LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB
------------ ----------- -------------------- ---------- ---------- ---------- --------------------
1 0 DATA01 NORMAL DATA01 DATA01 ORCL:DATA01 20479 16773
1 1 DATA02 NORMAL DATA02 DATA02 ORCL:DATA02 20479 16773
2 0 FRA01 NORMAL FRA01 FRA01 ORCL:FRA01 30719 28906
3 0 OCR01 NORMAL OCR01 OCR01 ORCL:OCR01 2046 1921
3 1 OCR02 NORMAL OCR02 OCR02 ORCL:OCR02 2046 1952
3 2 OCR03 NORMAL OCR03 OCR03 ORCL:OCR03 2046 1954
3 3 OCR04 NORMAL OCR04 OCR04 ORCL:OCR04 2046 1955
2.備份整庫以及OCR磁碟組
export ORACLE_SID=JSTDB1
rman target /
crosscheck archivelog all;
delete expired archivelog all;
backup format '/u01/rman/fulldb_%d_%U' database include current controlfile plus archivelog delete input;
su - root
ocrconfig -export /u01/rman/ocr.bak
3.對映新磁碟給作業系統
Disk /dev/sdi: 21.5 GB
Disk /dev/sdk: 32.2 GB
Disk /dev/sdl: 2147 MB
Disk /dev/sdj: 21.5 GB
Disk /dev/sdm: 2147 MB
Disk /dev/sdn: 2147 MB
4.標識為ASM磁碟
/etc/init.d/oracleasm createdisk NEW_DATA01 /dev/sdi1
/etc/init.d/oracleasm createdisk NEW_DATA02 /dev/sdj1
/etc/init.d/oracleasm createdisk NEW_FRA01 /dev/sdk1
/etc/init.d/oracleasm createdisk NEW_OCR01 /dev/sdl1
/etc/init.d/oracleasm createdisk NEW_OCR02 /dev/sdm1
/etc/init.d/oracleasm createdisk NEW_OCR03 /dev/sdn1
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
col NAME for a10
col LABEL for a20
col STATE for a10
col FAILGROUP for a10
col PATH for a20
set line 150
SELECT GROUP_NUMBER, DISK_NUMBER, LABEL, STATE, FAILGROUP, NAME, PATH, TOTAL_MB, FREE_MB FROM V$ASM_DISK;
GROUP_NUMBER DISK_NUMBER LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB
------------ ----------- -------------------- ---------- ---------- ---------- --------------------
0 0 NEW_DATA01 NORMAL ORCL:NEW_DATA01 00
0 1 NEW_DATA02 NORMAL ORCL:NEW_DATA02 00
0 2 NEW_FRA01 NORMAL ORCL:NEW_FRA01 00
0 3 NEW_OCR01 NORMAL ORCL:NEW_OCR01 00
0 4 NEW_OCR02 NORMAL ORCL:NEW_OCR02 00
0 5 NEW_OCR03 NORMAL ORCL:NEW_OCR03 00
1 0 DATA01 NORMAL DATA01 DATA01 ORCL:DATA01 20479 16773
1 1 DATA02 NORMAL DATA02 DATA02 ORCL:DATA02 20479 16773
2 0 FRA01 NORMAL FRA01 FRA01 ORCL:FRA01 30719 30142
3 0 OCR01 NORMAL OCR01 OCR01 ORCL:OCR01 2046 1921
3 1 OCR02 NORMAL OCR02 OCR02 ORCL:OCR02 2046 1952
3 2 OCR03 NORMAL OCR03 OCR03 ORCL:OCR03 2046 1954
3 3 OCR04 NORMAL OCR04 OCR04 ORCL:OCR04 2046 1955
14 rows selected.
5.新增磁碟到ASM磁碟組
ALTER DISKGROUP DATA ADD DISK 'ORCL:NEW_DATA01';
ALTER DISKGROUP DATA ADD DISK 'ORCL:NEW_DATA02';
ALTER DISKGROUP FRA ADD DISK 'ORCL:NEW_FRA01';
ALTER DISKGROUP OCR ADD DISK 'ORCL:NEW_OCR01';
ALTER DISKGROUP OCR ADD DISK 'ORCL:NEW_OCR02';
ALTER DISKGROUP OCR ADD DISK 'ORCL:NEW_OCR03';
或者使用asmca圖形介面新增
6.刪除磁碟
ALTER DISKGROUP DATA DROP DISK DATA01;
ALTER DISKGROUP DATA DROP DISK DATA02;
ALTER DISKGROUP FRA DROP DISK FRA01;
ALTER DISKGROUP OCR DROP DISK OCR01;
ALTER DISKGROUP OCR DROP DISK OCR02;
ALTER DISKGROUP OCR DROP DISK OCR03;
ALTER DISKGROUP OCR DROP DISK OCR04;
檢視刪除後的狀態
col NAME for a10
col LABEL for a20
col STATE for a10
col FAILGROUP for a10
col PATH for a20
set line 150
SELECT GROUP_NUMBER, DISK_NUMBER, LABEL, STATE, FAILGROUP, NAME, PATH, TOTAL_MB, FREE_MB FROM V$ASM_DISK;
GROUP_NUMBER DISK_NUMBER LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB
------------ ----------- -------------------- ---------- ---------- ---------- --------------------
0 2 NEW_FRA01 NORMAL ORCL:NEW_FRA01 00
0 3 NEW_OCR01 NORMAL ORCL:NEW_OCR01 00
0 4 NEW_OCR02 NORMAL ORCL:NEW_OCR02 00
0 5 NEW_OCR03 NORMAL ORCL:NEW_OCR03 00
1 0 DATA01 DROPPING DATA01 DATA01 ORCL:DATA01 20479 20240
1 1 DATA02 NORMAL DATA02 DATA02 ORCL:DATA02 20479 18089
2 0 FRA01 NORMAL FRA01 FRA01 ORCL:FRA01 30719 30142
3 0 OCR01 NORMAL OCR01 OCR01 ORCL:OCR01 2046 1921
3 1 OCR02 NORMAL OCR02 OCR02 ORCL:OCR02 2046 1952
3 2 OCR03 NORMAL OCR03 OCR03 ORCL:OCR03 2046 1954
3 3 OCR04 NORMAL OCR04 OCR04 ORCL:OCR04 2046 1955
1 2 NEW_DATA01 NORMAL NEW_DATA01 NEW_DATA01 ORCL:NEW_DATA01 20479 18085
1 3 NEW_DATA02 NORMAL NEW_DATA02 NEW_DATA02 ORCL:NEW_DATA02 20479 18086
14 rows selected.
或者使用asmca圖形介面刪除
7.檢視reblance的狀態
COL ERROR_CODE FOR A10;
select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- -----------
1 REBAL RUN 1 1 1359 2480 1800 0
select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- -----------
3 REBAL REAP 1 1 130148 1390 0
select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------- ----------
3 REBAL WAIT 1
可以看到刪除的狀態:RUN->REAP->WAIT->結束
調整reblance的速度
alter diskgroup DATA rebalance power 8;
select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- -----------
1 REBAL RUN 8 8 120 4006 1440 2
Reblance成功
select * from v$asm_operation;
no rows selected
9.檢視RAC的狀態
crsctl status res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.FRA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.OCR.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
ONLINE OFFLINE rac1
ONLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac2
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac2
ora.cvu
1 ONLINE ONLINE rac2
ora.jstdb.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.paydb.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.oc4j
1 ONLINE ONLINE rac2
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac2
ora.scan2.vip
1 ONLINE ONLINE rac2
ora.scan3.vip
1 ONLINE ONLINE rac2
10.將drop後的磁碟從儲存系統中取消對映
11.重啟伺服器(生產系統請慎重此操作)測試RAC狀態正常
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2137076/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle RAC 遷移替換 OCR 盤Oracle
- oracle asm線上替換dg盤操作OracleASM
- OracleRACStudy之–10gR2RAC環境中線上新增、刪除Votedisk和線上替換OCR的探討Oracle
- oracle11g crs線上更換asm磁碟OracleASM
- asm 磁碟切換ASM
- 遷移ocr/votedisk/asm spfile所在磁碟組ASM
- ORACLE RAC重建ASM磁碟組OracleASM
- RAC共享磁碟物理路徑故障導致OCR、Votedisk所在ASM磁碟組不可訪問的案例分析ASM
- 替換oracle叢集中的OCR 映象Oracle
- ASM下更換磁碟ASM
- asm 磁碟更換記ASM
- oracle rac 無法建立asm磁碟OracleASM
- ASM重新命名包含OCR/vote file的磁碟組ASM
- UDEV方式配置Oracle RAC ASM共享磁碟devOracleASM
- ASM磁碟組更換磁碟的操作方法ASM
- ASM之OCR所在磁碟組損壞後的恢復ASM
- 存貯在asm中的ocr/votedisk/asm磁碟組損害的恢復ASM
- [zt]Oracle rac 11g線上新增ocr,votediskOracle
- Oracle RAC日常運維-ASM磁碟擴容Oracle運維ASM
- RAC資料庫新增ASM磁碟組(1)資料庫ASM
- 【RAC】在ESX 上安裝asm 共享磁碟ASM
- Oracle10g RAC ASM磁碟組[zt]OracleASM
- Oracle資料庫 ASM磁碟線上擴容Oracle資料庫ASM
- Oracle RAC日常運維-DATA磁碟組故障Oracle運維
- 11G RAC 為 ASM 磁碟組增加一個磁碟。(AIX)ASMAI
- 遷移OCR和VotingDisk並刪除原ASM磁碟組ASM
- 管理ASM 檢索ocr資訊 禁用RAC自動啟動ASM
- 12c下更換ASM磁碟ASM
- ORACLE 11G RAC 更改OCR磁碟組extenrnal 為normalOracleORM
- 11g 如何新增,替換,移除,遷移 OCR ?
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- RAC 11G ASM磁碟損壞恢復ASM
- RAC關鍵資訊(OCR/VOTE DISK/ASM DISK HEADER)備份ASMHeader
- RAC環境ASM磁碟組間修改spfile的位置ASM
- RAC建立ASM單個磁碟不能操作2TASM
- 在Oracle10g RAC下新增ASM磁碟組OracleASM
- WPS中活用查詢替換修正OCR識別錯誤
- How to restore ASM based OCRRESTASM