一次OCR磁盘组掉磁盘恢复过程
1.错误情况
由于测试环境,是12c数据库。原来normal冗余模式的OCR_VOTE磁盘组,少了两个磁盘
[root@dg2 ~]# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. OFFLINE e3c0e462031b4fd9bfb584aa701c2305 () []
2. ONLINE 0e7da0333dff4ffdbf6e8cbd03154416 (/dev/mapper/node1_ocr) [OCR_VOTE]
3. OFFLINE d93e41dd9e4b4ff2bf2658a4cce9ffba () []
2.恢复过程
2.1停止crs,独占模式启动
[root@dg2 rac-cluster]#crsctl stop crs -f
[root@dg2 rac-cluster]#crsctl start crs -excl -nocrs
2.2创建磁盘组
注意:名称要和之前OCR磁盘组名称相同,即:OCR_VOTE
SQL> create diskgroup OCR_VOTE external redundancy disk '/dev/mapper/node1_12cocr' attribute 'compatible.asm'='12.1.0.0';
create diskgroup OCR_VOTE external redundancy disk '/dev/mapper/node1_12cocr' attribute 'compatible.asm'='12.1.0.0'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15030: diskgroup name "OCR_VOTE" is in use by another diskgroup
这里报错了,原因是OCR磁盘组中还有一个votedisk是online状态,导致无法在创建同样名称的磁盘组。
使用dd掉这个磁盘就行了。
[root@dg2 ~]# dd if=/dev/zero of=/dev/mapper/node1_ocr bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 0.305399 s, 3.4 GB/s
再次创建,成功
SQL> create diskgroup OCR_VOTE external redundancy disk '/dev/mapper/node1_12cocr' attribute 'compatible.asm'='12.1.0.0';
Diskgroup created
2.3 restore ocr
利用自动备份的OCR恢复即可
[root@dg2 rac-cluster]# ocrconfig -restore backup00.ocr
2.4 恢复votedisk
[root@dg2 rac-cluster]# crsctl replace votedisk +OCR_VOTE
CRS-4602: Failed 27 to add voting file 96f3347787194f73bf779f3fe89791af.
Failed to replace voting disk group with +OCR_VOTE.
CRS-4000: Command Replace failed, or completed with errors.
这里又报错了。
解决方法:
SQL> create spfile ='+OCR_VOTE' from memory;
File created.
SQL> startup force
ASM instance started
Total System Global Area 1140850688 bytes
Fixed Size 2933400 bytes
Variable Size 1112751464 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
再次恢复
[root@dg2 rac-cluster]# crsctl replace votedisk +OCR_VOTE
Successful addition of voting disk 6ab7db87be1b4f77bf50bb2e5e307a7e.
Successfully replaced voting disk group with +OCR_VOTE.
CRS-4266: Voting file(s) successfully replaced
2.5 重启集群
crsctl stop crs -f
crsctl start crs
这里就恢复好了,后面还有一些完善工作。