Showing posts with label RAC. Show all posts
Showing posts with label RAC. Show all posts

Thursday, 27 April 2017

How to recreate OCR and Voting disk

Restore/Recreate OCR and Voting disk

Restore OCR

1 Locate physical the OCR backups using –showbackup command
[root@ol5-db-host1 bin]#./ocrconfig – showbackup

2 Review the contents
[root@ol5-db-host1 bin]#./ocrdump –backupfile /u01/app/11.2.0.4/grid/cdata/<cluster_name>/week.ocr

3 Stop the Oracle clusterware on all the nodes.
[root@ol5-db-host1 bin]#./crsctl stop crs

4 As the OCR is in ASM disk, we need to start ASM in exclusive mode during restoring OCR
[root@ol5-db-host1 bin]#./crsctl check cluster -all

CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Check failed, or completed with errors.

[root@ol5-db-host1 bin]#./crsctl start crs -excl -nocrs

5 Restore the OCR backup
[root@ol5-db-host1 bin]#./ocrconfig –restore /u01/app/11.2.0.4/grid/cdata/<cluster_name>/backup.ocr

6 Stop and Start the crs normally.
[root@ol5-db-host1 bin]#./crsctl stop crs
[root@ol5-db-host1 bin]#./crsctl start crs

7 Check the OCR entry
ocrdump => this will generate OCRDUMPFILE

*******************************************************************
Restore/Recreate Voting Disk

cd $GRID_HOME/bin

1. Shutdown CRS as root user on all nodes.
[root@ol5-db-host1 bin]#./crsctl stop crs

2. start clusterware in exclusive mode
[root@ol5-db-host1 bin]#./crsctl start crs -excl -nocrs

3. remove the voting disks via
[root@ol5-db-host1 bin]#./crsctl delete css votedisk +DBFS_DG

4. check they are removed via
[root@ol5-db-host1 bin]#./crsctl query css votedisk

5. Readd the voting file in DGFS_DG
[root@ol5-db-host1 bin]#./crsctl replace votedisk +DBFS_DG

6. Stop and start the crs normally on all nodes
[root@ol5-db-host1 bin]#./crsctl stop crs
[root@ol5-db-host1 bin]#./crsctl start crs

*******************************************************************

Validate the OCR and Voting Disks using below link.

How to Validate OCR and Voting Disks

How to Validate OCR and Voting Disks

Validate OCR and Voting Disks

Verify OCR:
*******************************************************************
[oracle@ol5-db-host1 bin]$ cd $GRID_HOME/bin
[oracle@ol5-db-host1 bin]$ ./cluvfy comp ocr -n all

Verifying OCR integrity
Checking OCR integrity...
Checking the absence of a non-clustered configuration...
All nodes free of non-clustered, local-only configurations
ASM Running check passed. ASM is running on all specified nodes
Checking OCR config file "/etc/oracle/ocr.loc"...
OCR config file "/etc/oracle/ocr.loc" check successful
Disk group for ocr location "+DBFS_DG" available on all the nodes

NOTE:
This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR.
OCR integrity check passed

Verification of OCR integrity was successful.
*******************************************************************
Run ocrcheck as "root" user

[root@ol5-db-host1 bin]# cd $GRID_HOME/bin
[root@ol5-db-host1 bin]# ./ocrcheck

Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3836
         Available space (kbytes) :     258284
         ID                       :  187484264
         Device/File Name         :   +DBFS_DG
                                    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

*******************************************************************
Verify Voting Disk:

[oracle@ol5-db-host1 bin]$ cd $GRID_HOME/bin
[oracle@ol5-db-host1 bin]$ ./olsnodes -n -s
ol5-db-host1      1       Active
ol5-db-host2      2       Active
*******************************************************************
[oracle@ol5-db-host1 bin]$ cd $GRID_HOME/bin
[oracle@ol5-db-host1 bin]$ ./cluvfy comp vdisk

Verifying Voting Disk
Checking Oracle Cluster Voting Disk configuration...
ASM Running check passed. ASM is running on all specified nodes
Oracle Cluster Voting Disk configuration check passed
UDev attributes check for Voting Disk locations started...
UDev attributes check passed for Voting Disk locations
Verification of Voting Disk was successful.

*******************************************************************

In Case of corruption of OCR or Voting disk:

Please follow below link

How to recreate OCR and Voting disk