[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]# ./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