ASM中OCR所在磁盘组损坏后该怎么恢复

ASM中OCR所在磁盘组损坏后该怎么恢复,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

How to restore ASM based OCR after complete loss of the CRS diskgroup on Linux/Unix systems [ID 1062983.1]
当OCR存于ASM且损坏时,不能直接恢复;
因为ocrconfig -restore需要ASM处于运行状态才能执行成功,而OCR丢失又导致ASM无法启动,由此产生了悖论;
对于11202,可采用如下方法应对:

背景
When using an ASM disk group for CRS there are typically 3 different types of files located in the disk group that potentially need to be restored/recreated:

the Oracle Cluster Registry file (OCR)
the Voting file(s)
the shared SPFILE for the ASM instances
The following example assumes that the OCR was located in a single disk group used exclusively for CRS. The disk group has just one disk using external redundancy.

Since the CRS disk group has been lost the CRS stack will not be available on any node.

如果将OCR恢复到新的磁盘组,还应修改/etc/oracle/ocr.loc文件
This document assumes that the name of the OCR diskgroup remains unchanged, however there may be a need to use a different diskgroup name, in which case the name of the OCR diskgroup would have to be modified in /etc/oracle/ocr.loc across all nodes prior to executing the following steps.

首先确定OCR存有备份,在跳过CRS的前提下启动clusterware,先后恢复OCR/voting disk

OCR自动备份集可位于集群中任一节点,应逐个查找
[oracle@justin ~]$ ocrconfig -showbackup
justin     2013/05/16 04:43:30     /orasw/app/11.2.0.3/grid/cdata/backup00.ocr
justin     2013/05/16 00:43:29     /orasw/app/11.2.0.3/grid/cdata/backup01.ocr
justin     2013/05/15 20:43:29     /orasw/app/11.2.0.3/grid/cdata/backup02.ocr
justin     2013/05/14 08:43:26     /orasw/app/11.2.0.3/grid/cdata/day.ocr
justin     2013/05/02 22:14:05     /orasw/app/11.2.0.3/grid/cdata/week.ocr
关闭所有GI服务
# $CRS_HOME/bin/crsctl stop crs -f

跳过CRS以排他方式启动GI
# $CRS_HOME/bin/crsctl start crs -excl -nocrs CRS-4123: Oracle High Availability Services has been started.
...
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'auw2k3'
CRS-2672: Attempting to start 'ora.ctssd' on 'racnode1'
CRS-2676: Start of 'ora.drivers.acfs' on 'racnode1' succeeded
CRS-2676: Start of 'ora.ctssd' on 'racnode1' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'racnode1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'racnode1'
CRS-2676: Start of 'ora.asm' on 'racnode1' succeeded


登陆ASM创建丢失的磁盘组,然后导入最新OCR备份
SQL> create diskgroup CRS external redundancy disk 'ORCL:ASMD40' attribute 'COMPATIBLE.ASM' = '11.2';

Diskgroup created.
# cd $CRS_HOME/cdata/rac_cluster1/
# $CRS_HOME/bin/ocrconfig -restore backup00.ocr

重建voting disk
# $CRS_HOME/bin/crsctl replace votedisk +CRS
Successful addition of voting disk 00caa5b9c0f54f3abf5bd2a2609f09a9.
Successfully replaced voting disk group with +CRS.
CRS-4266: Voting file(s) successfully replaced

关闭并重启CRS
# $CRS_HOME/bin/crsctl stop crs -f
...
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'auw2k3' has completed
CRS-4133: Oracle High Availability Services has been stopped.

# $CRS_HOME/bin/crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

看完上述内容,你们掌握ASM中OCR所在磁盘组损坏后该怎么恢复的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注行业资讯频道,感谢各位的阅读!