环境:RHEL5.8 RAC 11.2.0.4.0
1:查看ORC和voting disk信息:
In 11g Release 2 your voting disk data is automatically backed up in theOCR whenever there is a configuration change.
所以恢复时恢复备份OCR即可,这里和10g是不同的,不需要备份voting disk,备份OCR即可
2:使用ocrcheck检测OCR内容的完整性:
[grid@node2 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3156
Available space (kbytes) : 258964
ID : 2091470210
Device/File Name : +OCR
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
3:使用cluvfy 工具检查OCR完整性
[grid@node2 ~]$ cluvfy comp ocr -n all
4:检测voting disk的信息
[grid@node2 ~]$ crsctl query css votedisk
5:手动备份一份OCR信息:
[root@node1 bin]# ./ocrconfig -export /home/grid/ocr.dmp
6:查看OCR自动备份信息:
[root@node1 bin]# ./ocrconfig -showbackup
node2 2014/11/17 15:54:38 /u01/app/11.2.0./grid/cdata/scan/backup00.ocr
node2 2014/11/16 17:27:49 /u01/app/11.2.0./grid/cdata/scan/backup01.ocr
node1 2014/11/15 17:07:44 /u01/app/11.2.0./grid/cdata/scan/backup02.ocr
node1 2014/11/15 13:07:31 /u01/app/11.2.0./grid/cdata/scan/day.ocr
node1 2014/10/30 18:12:56 /u01/app/11.2.0./grid/cdata/scan/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
7:保存一份ASM参数文件
[grid@node1 ~]$ sqlplus / as sysdba
8:破坏保存OCR信息的磁盘组+CRS
[root@node1 bin]# dd if=/dev/zero of=/dev/asm-diskf bs=1024k count=2000
2000+0 records in
2000+0 records out
2097152000 bytes (2.1 GB) copied, 93.0326 seconds, 22.5 MB/s
9:破坏OCR磁盘组后,集群宕机
[root@node1 bin]# ./crsctl check cluster -all
**************************************************************
node1:
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
CRS-4534: Cannot communicate with Event Manager
**************************************************************
node2:
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
CRS-4534: Cannot communicate with Event Manager
**************************************************************
10.在各个节点强制关闭集群:
[root@node1 bin]# ./crsctl stop crs -f
11.以独占模式启动rac1:只启动ASM实例,不启动CRS
[root@node1 bin]# ./crsctl start crs -excl -nocrs
12:创建CRS磁盘组
[grid@node1 ~]$ sqlplus / as sysasm13.通过导入或者restore还原OCR
[root@node1 bin]# ./ocrconfig -import /home/grid/ocr.dmp
14.OCR恢复成功;
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3188
Available space (kbytes) : 258932
ID : 1409503864
Device/File Name : +OCR
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
15.恢复VOTEDISK
SQL> conn /as sysasm
Connected.SQL> startup pfile='/home/grid/pfile.ora';
ASM instance started
Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
SQL> create spfile from pfile='/home/grid/pfile.ora';
File created.
[root@node1 bin]# ./crsctl replace votedisk +OCR
Successful addition of voting disk 7d1dc64dda914f8abf57617a857032bb.
Successfully replaced voting disk group with +OCR.
CRS-4266: Voting file(s) successfully replaced
[root@node1 bin]# ./crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7d1dc64dda914f8abf57617a857032bb (/dev/asm-diskf) [OCR]
Located 1 voting disk(s).
16.节点一退出独占模式:
[root@node1 bin]# ./crsctl stop crs -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'node1'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'node1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'node1'
CRS-2673: Attempting to stop 'ora.asm' on 'node1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'node1'
CRS-2677: Stop of 'ora.mdnsd' on 'node1' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'node1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'node1' succeeded
CRS-2677: Stop of 'ora.asm' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'node1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'node1'
CRS-2677: Stop of 'ora.cssd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'node1'
CRS-2677: Stop of 'ora.gipcd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'node1'
CRS-2677: Stop of 'ora.gpnpd' on 'node1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'node1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
17.启动所有节点集群:
[root@node2 bin]# ./crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
[root@node1 bin]# ./crsctl check cluster -all
**************************************************************
node1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
node2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************