您好,登錄后才能下訂單哦!
環境描述:
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狀態正常
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。