0. 需求
OCR和Votingdisk目前存放在+DG_GRID磁盘组中,计划将OCR和Votingdisk临时迁移至+DG_DATA磁盘组,然后重建+DG_GRID磁盘组,等+DG_GRID磁盘组重建完成后,再将OCR和Votingdisk最终迁移回+DG_GRID磁盘组
1. 磁盘组信息
[grid@19crac1 ~]$ asmcmd lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 12288 5876 0 5876 0 N DG_DATA/
MOUNTED EXTERN N 512 512 4096 4194304 8192 7816 0 7816 0 Y DG_GRID/
[grid@19crac1 ~]$
2. 当前状态
[root@19crac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 4
Total space (kbytes) : 901284
Used space (kbytes) : 84588
Available space (kbytes) : 816696
ID : 1272834433
Device/File Name : +DG_GRID
Device/File integrity check succeeded
Cluster registry integrity check succeeded
Logical corruption check succeeded
[root@19crac1 ~]# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE a03805e7da4b4f99bf5e33e26be1aa5d (AFD:DG_GRID1) [DG_GRID]
Located 1 voting disk(s).
[root@19crac1 ~]#
3. 哪些信息存放在以前的OCR磁盘组中
OCR
OCR自动生成的备份位置
Votingdisk
ASM的spfile
ASM的密码文件
ASM的密码文件备份
4. 所有更换操作
4.1 更换ASM的spfile
asmcmd spget
asmcmd spmove +DG_GRID/sdsw-cluster/ASMPARAMETERFILE/registry.253.1135716505 +DG_DATA/spfileasm.ora
asmcmd spget
4.2 更换ASM的密码文件
asmcmd pwget --asm
asmcmd pwcopy +DG_GRID/orapwASM +DG_DATA/orapwASM
asmcmd pwset --asm +DG_DATA/orapwASM -f
asmcmd pwget --asm
4.3 更换ASM的密码文件备份
srvctl config asm
srvctl modify asm -pwfilebackup +DG_DATA/orapwASM_backup
4.4 更换OCR
# ocrcheck
# ocrconfig -add +DG_DATA
# ocrconfig -delete +DG_GRID
# ocrcheck
4.5 OCR自动生成的备份位置
# ocrconfig -showbackuploc
# ocrconfig -backuploc +DG_DATA
# ocrconfig -showbackuploc
4.6 更换Votingdisk
# crsctl query css votedisk
# crsctl replace votedisk +DG_DATA
# crsctl query css votedisk
5. 重启集群验证
# crsctl stop crs
# crsctl start crs
# crsctl check crs
6. 删除dg_grid磁盘组
sqlplus / as sysasm
alter diskgroup dg_grid dismount; --除了将执行drop diskgroup的节点之外,其他节点都执行该命令
drop diskgroup dg_grid including contents;