11g RAC OCR,VOTING DISK儲存全部損壞,利用自動備份,恢復OCR,VOTING DISK到新儲存。

張衝andy發表於2017-02-20

背景:

11g R2 rac 的orc ,voting disk asm儲存磁碟全部損壞。透過調查得知 損壞的 OCR磁碟對應為 VOL1 ,
voting disk磁碟對應於 VOL2 。 故,新增asm新儲存(過程省略),設定為舊配置名 VOL1,VOL2 。

/usr/sbin/oracleasm createdisk VOL1 /dev/sdb1
/usr/sbin/oracleasm createdisk VOL2 /dev/sdc1

[root@node1 bin]# /usr/sbin/oracleasm listdisks -- 檢視 listdisks 。
VOL1
VOL2
VOL3 -- 說明此為沒有損壞的asm
VOL4 -- 說明此為沒有損壞的asm

儲存配置完成後,正式恢復OCR,VOTING DISK 操作流程:

1. 以-excl -nocrs 方式啟動cluster,這將可以啟動ASM例項 但不啟動CRS

# crsctl start crs -excl -nocrs

2.以 sqlplus / as sysasm 登入asm,重建原ocr和votedisk所在diskgroup,注意compatible.asm必須是11.2 。 
## 注意 DISKGROUP 名為舊ORC,VOTING DISK磁碟組名。

SQL> CREATE DISKGROUP griddg external REDUNDANCY
DISK 'ORCL:vol1','ORCL:vol2' ATTRIBUTE 'compatible.asm'='11.2.0.0.0'; 
Diskgroup created.

3.從ocr 自動 backup 中恢復ocr並做ocrcheck檢驗:
[root@node1 bin]# ./ocrconfig -restore /u01/app/11.2.0/grid/cdata/scan-cluster/backup02.ocr

[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3068
Available space (kbytes) : 259052
ID : 1970085021
Device/File Name : +GRIDDG
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 succeeded

4.準備恢復votedisk
[root@node1 bin]# ./crsctl replace votedisk +GRIDDG
Successful addition of voting disk aede3b23ab684fc8bfc52d1bf5a45ea6.
Successful deletion of voting disk 138dbfa62e2d4feabf73d9ec4cb70c68.
Successfully replaced voting disk group with +GRIDDG.
CRS-4266: Voting file(s) successfully replaced

恢復完成。

如果第四步中可能會遇到下面的錯誤:
[grid@vrh1 ~]$ crsctl replace votedisk +SYSTEMDG
CRS-4602: Failed 27 to add voting file 2e4e0fe285924f86bf5473d00dcc0388.
CRS-4602: Failed 27 to add voting file 4fa54bb0cc5c4fafbf1a9be5479bf389.
CRS-4602: Failed 27 to add voting file a109ead9ea4e4f28bfe233188623616a.
CRS-4602: Failed 27 to add voting file 042c9fbd71b54f5abfcd3ab3408f3cf3.
CRS-4602: Failed 27 to add voting file 7b5a8cd24f954fafbf835ad78615763f.
Failed to replace voting disk group with +SYSTEMDG.
CRS-4000: Command Replace failed, or completed with errors.
需要重新配置一下ASM的引數,並重啟ASM:

SQL> alter system set asm_diskstring=‘/dev/asm*’;
System altered.

SQL> create spfile from memory;
File created.

SQL> startup force mount;
ORA-32004: obsolete or deprecated parameter(s) specified for ASM instance
ASM instance started
Total System Global Area 283930624 bytes
Fixed Size 2227664 bytes
Variable Size 256537136 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted

SQL> show parameter spfile
NAME TYPE VALUE
—————————————————— ————— ———————————————
spfile string /g01/11.2.0/grid/dbs/spfi le+ASM1.ora

[grid@vrh1 trace]$ crsctl replace votedisk +SYSTEMDG
CRS-4256: Updating the profile
Successful addition of voting disk 85edc0e82d274f78bfc58cdc73b8c68a.
Successful addition of voting disk 201ffffc8ba44faabfe2efec2aa75840.
Successful addition of voting disk 6f2a25c589964faabf6980f7c5f621ce.
Successful addition of voting disk 93eb315648454f25bf3717df1a2c73d5.
Successful addition of voting disk 3737240678964f88bfbfbd31d8b3829f.
Successfully replaced voting disk group with +SYSTEMDG.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced


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

相關文章