Oracle database 11g rac損壞ocr和votedisk恢復實驗

辛勤的小胖發表於2014-03-25
本人的操作環境:oracle database rdbms 11g rac on OEL5.5
檢視一下表決磁碟和ocr的資訊:
[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin
[root@rac1 bin]# ./crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   5122b184495d4fe9bf1fad29647807ba (ORCL:VOL1) [OCRVOTI]
Located 1 voting disk(s).
[root@rac1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2700
         Available space (kbytes) :     259420
         ID                       :  268167937
         Device/File Name         :   +OCRVOTI
                                    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
檢視當前ocr備份情況,ocr
[root@rac1 bin]# ./ocrconfig -showbackup

rac2     2014/03/25 12:04:28     /u01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocr

rac2     2014/03/21 16:16:32     /u01/app/11.2.0/grid/cdata/rac-cluster/backup01.ocr

rac2     2014/03/21 12:16:31     /u01/app/11.2.0/grid/cdata/rac-cluster/backup02.ocr

rac2     2014/03/25 12:04:28     /u01/app/11.2.0/grid/cdata/rac-cluster/day.ocr

rac2     2014/03/19 14:26:16     /u01/app/11.2.0/grid/cdata/rac-cluster/week.ocr
可以進行手工備份:
[root@rac1 bin]# ./ocrconfig -local -manualbackup
rac1     2014/03/25 14:33:39     /u01/app/11.2.0/grid/cdata/rac1/backup_20140325_143339.olr

rac1     2014/03/25 10:34:33     /u01/app/11.2.0/grid/cdata/rac1/backup_20140325_103433.olr

rac1     2014/03/25 09:53:32     /u01/app/11.2.0/grid/cdata/rac1/backup_20140325_095332.olr

rac1     2014/03/25 09:53:18     /u01/app/11.2.0/grid/cdata/rac1/backup_20140325_095318.olr

rac1     2014/03/18 10:57:51     /u01/app/11.2.0/grid/cdata/rac1/backup_20140318_105751.olr

在asmcmd的md_backup命令備份磁碟組,順便檢視該磁碟組都存放什麼??
[grid@rac1 ~]$ asmcmd -p
ASMCMD [+] > md_backup /home/grid/ocrvote2.bak -G OCRVOTI
Disk group metadata to be backed up: OCRVOTI
Current alias directory path: rac-cluster
Current alias directory path: rac-cluster/ASMPARAMETERFILE
Current alias directory path: rac-cluster/OCRFILE
也可以手工匯出ocr內容
[root@rac1 bin]# ./ocrconfig -export /home/grid/ocr2.bak
我們可以破壞存放ocr的裝置檔案
[root@rac1 bin]# dd if=/dev/zero of=/dev/sdg bs=1024k count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.002366 seconds, 443 MB/s
然哈停止叢集:
[root@rac1 bin]# ./crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.oc4j' on 'rac1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'
CRS-2673: Attempting to stop 'ora.OCRVOTI.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac1'
CRS-2673: Attempting to stop 'ora.test.db' on 'rac1'
CRS-2673: Attempting to stop 'ora.gsd' on 'rac1'
CRS-2677: Stop of 'ora.gsd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' su 忽略。。。。。
我們在啟動clusterware 發現無法啟動了
[root@rac1 bin]# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.
[root@rac1 bin]# ./crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
CRS-4534: Cannot communicate with Event Manager

ocr和vote disk損壞恢復步驟大致如下:

1)停止所有節點clusterware
# crsctl stop crs
# crsctl stop crs -f
2)以root使用者在其中一個節點獨佔模式啟動clusterware
# crsctl start crs -excl -nocrs
備註:如果發現crsd在執行,那麼通過如下命令將之停止。
# crsctl stop resource ora.crsd -init
3)建立新的存放ocr和vote disk的磁碟組,磁碟組名和原有的一致(如果想改變位置,需修改/etc/oracle/ocr.loc檔案)
備註:如發現無法建立等情況,可以採用如下刪除磁碟組等排錯思路
SQL> drop diskgroup disk_group_name force including contents;
4)還原ocr,並檢查
# ocrconfig -restore file_name
# ocrcheck
5)恢復表決磁碟,並檢查
# crsctl replace votedisk +asm_disk_group
# crsctl query css votedisk
6)停止獨佔模式執行的clusterware
# crsctl stop crs -f
7)所有節點正常啟動clusterware
# crsctl start crs
8)CVU驗證所有RAC節點OCR的完整性
$ cluvfy comp ocr -n all -verbose






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

相關文章