Search This Blog

Saturday, August 20, 2011

Managing OCR and Voting disk in Oracle 10gR2 RAC Database

Both files are managed by the crsd daemon. Voting disk is used for monitoring information for the members of the cluster. OCR is the cluster configuration file and contains everything about the cluster such as list of nodes , mapping between nodes and instances, application profiles and etc.Both file must be located on share device with RAW,CFS,OCFS filesystems. In 10gR2 RAC Database these files can not be hosted in ASM.


Manage OCR files

First determine the ocr and ocrmirror location

Way 1:

[oracle@rac1 crs]$ ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 2

Total space (kbytes) : 262120

Used space (kbytes) : 4644

Available space (kbytes) : 257476

ID : 1900957196

Device/File Name : /ocfs-disk/ocr0.ora

Device/File integrity check succeeded

Device/File Name : /ocfs-disk/ocr1.ora

Device/File integrity check succeeded

Cluster registry integrity check succeeded

Way 2:

[oracle@rac1 ocfs-disk]$ cat /etc/oracle/ocr.loc

ocrconfig_loc=/ocfs-disk/ocr0.ora

ocrmirrorconfig_loc=/ocfs-disk/ocr1.ora

local_only=FALSE

Ensure you have backup

[oracle@rac1 crs]$ ocrconfig -showbackup

rac1 2011/07/07 22:00:25 /oracle/crs/oracle/product/10.2.0/crs/cdata/crs

rac1 2011/07/07 18:00:11 /oracle/crs/oracle/product/10.2.0/crs/cdata/crs

rac1 2011/07/07 14:00:10 /oracle/crs/oracle/product/10.2.0/crs/cdata/crs

rac1 2011/07/06 01:59:58 /oracle/crs/oracle/product/10.2.0/crs/cdata/crs

rac1 2011/06/27 02:43:25 /oracle/crs/oracle/product/10.2.0/crs/cdata/crs

Move OCR and OCR mirror in a new Location

The cluster is UP

*** su - oracle ***

cp /dev/null /ocfs-disk/OCR-DISKS/ocr1.ora

cp /dev/null /ocfs-disk/OCR-DISKS/ocr2.ora

*** su root ( using oracle's profile) ****

ocrconfig -replace ocr /ocfs-disk/OCR-DISKS/ocr1.ora

ocrconfig -replace ocrmirror /ocfs-disk/OCR-DISKS/ocr2.ora

chown root /ocfs-disk/OCR-DISKS/ocr1.ora

chown root /ocfs-disk/OCR-DISKS/ocr2.ora

[oracle@rac2 ~]$ ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 2

Total space (kbytes) : 262120

Used space (kbytes) : 4644

Available space (kbytes) : 257476

ID : 1900957196

Device/File Name : /ocfs-disk/OCR-DISKS/ocr1.ora

Device/File integrity check succeeded

Device/File Name : /ocfs-disk/OCR-DISKS/ocr2.ora

Device/File integrity check succeeded

Cluster registry integrity check succeeded

Post Actions after file Remove

  1. Remove the old files manually

  1. Export the new ocr

*** su root ( using oracle's profile) ****

ocrconfig -export /ocfs-disk/OCR-EXPORTS/ocrExp.dmp

Manage Voting files

First determine the current voting disks location

[root@rac2 OCR-EXPORTS]# crsctl query css votedisk

0. 0 /ocfs-disk/vot0.ora

1. 0 /ocfs-disk/vot1.ora

2. 0 /ocfs-disk/vot2.ora

located 3 votedisk(s).

Backup the voting disks

*** su - oracle ***

dd if=/ocfs-disk/vot0.ora of=/ocfs-disk/VOT-BACKUP/vot0.ora.dmp bs=4k

dd if=/ocfs-disk/vot1.ora of=/ocfs-disk/VOT-BACKUP/vot1.ora.dmp bs=4k

dd if=/ocfs-disk/vot2.ora of=/ocfs-disk/VOT-BACKUP/vot2.ora.dmp bs=4k

Stop your rac system (databases,services, listener etc) using srvctl

Stop your crs as root

crsctl stop crs

as oracle

touch /ocfs-disk/VOT-DISKS/vdisk1.ora

touch /ocfs-disk/VOT-DISKS/vdisk2.ora

Use the touch since the file system is OCFS2

crsctl add css votedisk /ocfs-disk/VOT-DISKS/vdisk1.ora -force

Now formatting voting disk: /ocfs-disk/VOT-DISKS/vdisk1.ora

successful addition of votedisk /ocfs-disk/VOT-DISKS/vdisk1.ora.

crsctl add css votedisk /ocfs-disk/VOT-DISKS/vdisk2.ora -force

Now formatting voting disk: /ocfs-disk/VOT-DISKS/vdisk2.ora

successful addition of votedisk /ocfs-disk/VOT-DISKS/vdisk2.ora.

crsctl delete css votedisk /ocfs-disk/vot0.ora

crsctl delete css votedisk /ocfs-disk/vot1.ora

crsctl delete css votedisk /ocfs-disk/vot2.ora

[oracle@rac2 ~]$ crsctl query css votedisk

0. 0 /ocfs-disk/VOT-DISKS/vdisk1.ora

1. 0 /ocfs-disk/VOT-DISKS/vdisk2.ora

crsctl start crs

Metalink References

OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE) [ID 428681.1]

Failed to Start CRS stack After Adding a New Voting Disk [ID 460874.1]

Web Reference

http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#Relocate a Voting Disk