思路:
1.ocr被破坏(采用dd破坏磁盘的方式)
2.所有节点的cluster都关闭,资源都关闭,db也关闭了。
3.选一个节点执行crsctl start crs -excl -nocrs 启动asm
4.as sysasm 进入后,创建新的磁盘组,并将asm参数文件的spfile创建到新磁盘组里,然后shutdown immdiate关闭asm,再startup启动,以使用新参数文件。
5.恢复crs
6.恢复voting disk
步骤:
在破坏ocr之前,我们得先看看我们的ocr备份是否存在,备份有2种,手动和自动备份。
先简单查看ocr磁盘的冗余模式
这个是我的测试环境,ocr是normal方式的。
SQL> select name,type from v$asm_diskgroup;
NAME TYPE
------------------------------ ------
DATA NORMAL
这是另一个环境,ocr是外部冗余方式的。
SQL> select name,type from v$asm_diskgroup;
NAME TYPE
------------------------------ ------
DATA_PTL EXTERN
OCR_PTL EXTERN
查看自动备份
默认的自动备份路径是$CRS_HOME/cdata/$CRS_NAME
自动备份只会在一个节点执行。如果用于备份的节点出现异常,则oracle会自动切换到其他节点进行备份。
默认情况下,oracle会保留最近5份ocr备份:3份最近的、一份昨天和一份上周的。
[root@host01 bin]# ./ocrconfig -showbackup
host01 2016/03/24 06:48:42 /u01/app/11.2.0/grid/cdata/cluster01/backup00.ocr
host01 2016/03/24 02:48:42 /u01/app/11.2.0/grid/cdata/cluster01/backup01.ocr
host01 2016/03/23 22:48:41 /u01/app/11.2.0/grid/cdata/cluster01/backup02.ocr
host01 2016/03/23 14:48:40 /u01/app/11.2.0/grid/cdata/cluster01/day.ocr
host01 2016/03/23 14:48:40 /u01/app/11.2.0/grid/cdata/cluster01/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
[root@host01 bin]# ll /u01/app/11.2.0/grid/cdata/cluster01/
total 43344
-rw------- 1 root root 7385088 Mar 24 06:48 backup00.ocr
-rw------- 1 root root 7385088 Mar 24 02:48 backup01.ocr
-rw------- 1 root root 7385088 Mar 23 22:48 backup02.ocr
-rw------- 1 root root 7385088 Mar 24 02:48 day_.ocr
-rw------- 1 root root 7385088 Mar 23 14:48 day.ocr
-rw------- 1 root root 7385088 Mar 23 14:48 week.ocr
检查ocr的完整性:
[oracle@host01 bin]$ pwd
/u01/app/11.2.0/grid/bin
[oracle@host01 bin]$ ./cluvfy comp ocr -n all
Verifying OCR integrity
Checking OCR integrity...
Checking the absence of a non-clustered configuration...
All nodes free of non-clustered, local-only configurations
ASM Running check passed. ASM is running on all specified nodes
Checking OCR config file "/etc/oracle/ocr.loc"...
OCR config file "/etc/oracle/ocr.loc" check successful
Disk group for ocr location "+DATA" available on all the nodes
NOTE:
This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR.
OCR integrity check passed
Verification of OCR integrity was successful.
也可以使用ocrcheck检查ocr的完整性:
[oracle@host01 bin]$ ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3064
Available space (kbytes) : 259056
ID : 764742178
Device/File Name : +DATA
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
[oracle@host01 bin]$
[root@host02 ~]# /u01/app/11.2.0/grid/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3064
Available space (kbytes) : 259056
ID : 764742178
Device/File Name : +DATA
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
<