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 RAC日常運維-ASM磁碟擴容Oracle運維ASM
- Oracle資料庫 ASM磁碟線上擴容Oracle資料庫ASM
- ASM重新命名包含OCR/vote file的磁碟組ASM
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- ASM磁碟組更換磁碟的操作方法ASM
- 更換ocr和votingdisk磁碟組
- 遷移OCR和VotingDisk並刪除原ASM磁碟組ASM
- RAC之grid叢集安裝及ASM磁碟組配置ASM
- Oracle RAC日常運維-DATA磁碟組故障Oracle運維
- Oracle RAC ASM磁碟組擴容時遇到的VIP漂移OracleASM
- goldengate + asm + racGoASM
- 如何檢視Oracle RAC的asm磁碟的udev對應關係OracleASMdev
- RAC+ASM+DATAGUARDASM
- RAC_OCR管理
- ASM磁碟組限制ASM
- 替換OCR和表決磁碟後,重啟叢集,資料庫資源的叢集狀態為OFFLINE資料庫
- RAC節點啟動失敗--ASM無法連線ASM
- 【ASM】Oracle asm磁碟被格式化,如何掛載該磁碟組ASMOracle
- 遷移ASM磁碟組ASM
- 【RAC】asm_diskgroups 引數ASM
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- 【ASM】ASM磁碟頭被重寫,如何修復ASM
- oracle rac 增加磁碟Oracle
- RAC安裝【AIX 7 + 11.2.0.4 + ASM】AIASM
- RAC+DG(asm單例項)ASM單例
- 從定位資料塊所在ASM磁碟到ASM strippingASM
- 圖片上傳顯示替換
- 【RAC】Oracle RAC上線測試場景介紹Oracle
- RAC和ASM環境下打patchASM
- Oracle 11.2.0.4 rac for aix acfs異常環境的克隆環境ASM磁碟組掛載緩慢OracleAIASM
- HTML 替換元素與非替換元素HTML
- 阿里雲線上擴容磁碟阿里
- ASM 磁碟組的建立及擴容ASM
- ORACLE ASM磁碟組空間溢位OracleASM
- 使用udev擴充套件ASM磁碟組dev套件ASM
- ASM磁碟組擴容操作文件ASM
- python函式教程:Python 字串操作(string替換、擷取等)Python函式字串
- 永遠線上的遊戲公司,XSKY星辰天合如何幫助它線上替換開源儲存?遊戲