ASM重新命名包含OCR/vote file的磁碟組

Davis_itpub發表於2018-06-27
Rename Diskgroup having OCR , Vote File , ASM SPILE [ID 1335975.1]
適用於11R2;
11R2提供renamedg,可在磁碟組dismount時將其重新命名;如果該磁碟組包含OCR/vote file,則dismount前需將其遷移至中間磁碟;

大致思路如下:
建立一個臨時磁碟組temp,將OCR/vote file遷移至此;
將spfile也遷移到temp,重啟CRS;
解除安裝並重新命名原磁碟組,並重新載入;
將ocr/vote file/spfile遷回,重啟CRS;

建立臨時磁碟組
create diskgroup TEMP normal redundancy
disk 'ORCL:DISK4' ,'ORCL:DISK5' ,'ORCL:DATA4' ,'ORCL:DATA6'
attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0', 'au_size'='4M';

遷移ocr/vote file
$ORACLE_HOME/bin/bin/ocrconfig -add +TEMP
$ORACLE_HOME/bin/bin/ocrconfig -delete +DATA
$ORACLE_HOME/bin/crsctl replace votedisk +TEMP
完成後呼叫ocrcheck檢查完整性

遷移spfile

重啟CRS
crsctl stop crs
crsctl start crs

重新命名磁碟組
alter diskgroup data dismount; renamedg phase=both dgname=DATA newdgname=CRS verbose=true
輸出如下
Parsing parameters..
Parameters in effect:
Old DG name : DATA
New DG name : CRS
Phases :
Phase 1
Phase 2
Discovery str : (null)
Clean : TRUE
Raw only : TRUE
renamedg operation: phase=both dgname=DATA newdgname=CRS verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK1 with disk number:0 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK2 with disk number:1 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK3 with disk number:2 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK6 with disk number:5 and timestamp (32955539 -2120261632)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK1 with disk number:0 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK2 with disk number:1 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK3 with disk number:2 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK6 with disk number:5 and timestamp (32955539 -2120261632)
Checking if the diskgroup is mounted or used by CSS
Checking disk number:0
Checking disk number:1
Checking disk number:2
Checking disk number:5
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for ORCL:DISK1
Modifying the header
Looking for ORCL:DISK2
Modifying the header
Looking for ORCL:DISK3
Modifying the header
Looking for ORCL:DISK6
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7ee8050

重新載入磁碟組並遷回OCR
alter diskgroup CRS mount
$ORACLE_HOME/bin/ocrconfig -add +CRS
$ORACLE_HOME/bin/ocrconfig -delete +TEMP
$ORACLE_HOME/bin/crsctl replace votedisk +CRS

遷回spfile並重啟CRS

刪除temp磁碟組並將其資訊從叢集中移除
alter diskgroup TEMP dismount;
drop diskgroup temp including contents;
srvctl remove diskgroup -g data
srvctl remove diskgroup -g TEMP

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31520497/viewspace-2156854/,如需轉載,請註明出處,否則將追究法律責任。

相關文章