ASM之OCR所在磁碟組損壞後的恢復

531968912發表於2017-12-19
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.

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

相關文章