Thursday, September 11, 2008

Oracle RAC 10gR2 OCR and Voting Information

Change the Voting and OCR configuration in RAC 10gR2

The voting disk’s configuration can be changed dynamically

To add a new voting disk
5035>crsctl add css votedisk


To delete a voting disk
5035>crsctl delete css votedisk


If the clusterware is down on all nodes, you will need to use the force option –force.
5035>crsctl add css votedisk -force
5035>crsctl delete css votedisk -force


To backup and recover voting disks Oracle recommend to use symbolic links

To backup the voting disk you need to use the Unix dd command. For more information on the dd command, consult the man pages.
Typically, the voting disk should be backed up
* After an Oracle Clusterware installation
* After a new node has been added or deleted from the cluster
* The backup can be performed on-line.

5035>crsctl query css votedisk
5035>dd if=[voting disk path] of=[output file] bs=4k


You will need to recover voting disks by restoring the first one using the dd command, and then multiplex it if necessary.
If you don’t have a valid backup of your voting disk, you will need to reinstall Oracle Clusterware

Automatic OCR backups
The OCR is crucial to Oracle clusterware
OCR is automatically backed up physically
• Every four hours: CRS keeps the last three copies
• At the end of every day: CRS keeps the last three copies.
• At the end of every week: CRS keeps the last two copies.

The default location of the backups

5035>ocrconfig –backuploc /shared/bak

To manually backup the OCR perform the following

5035>ocrconfig –export [file name]

Backups should always be taken prior to making any changes.

Steps to recover the OCR using physical backups
1. Locate the physical backup
2. 5035>ocrconfig –showbackup
3. Check the contents
4. 5035>ocrdump –backupfile [file_name]
5. Stop clusterware on all nodes
6. 5035>crsctl stop crs
7. Restore the physical backup of the OCR
8. 5035>ocrconfig –restore [CRS_HOME]/data/crs/backup.ocr
9. Restart clusterware on all nodes
10. 5035>crsctl start crs
11. Check the OCR
12. 5035>cluvfy comp ocr –n all

To recover the OCR using logical backups perform the following steps
1. Locate the logical backup using the OCR export
2. Stop clusterware on all nodes
3. 5035>crsctl stop crs
4. Restore the logical OCR backup
5. 5035>ocrconfig –import /shared/export/ocrbackup.dmp
6. Restart the clusterware on all nodes
7. 5035>crsctl start crs

Repair and OCR configuration
1. Stop clusterware on second node
2. 5035>crsctl stop crs
3. Add OCR mirror from the first node
4. 5035>ocrconfig –replace ocrmirror /OCRMirror
5. Repair the OCR mirror location on the second node
6. 5035>ocrconfig –repair ocrmirror /OCRMirror
7. Start the clusterware on the second node
8. 5035>crsctl start crs


Some things to remember when working with OCR
• If you are using raw devices to store OCR files, make sure they exist before you use the add or replace operations
• You must issue the add, replace and remove commands as the root user
• While adding or replacing OCR files, the mirror needs to be online
• If you remove a primary OCR the mirror becomes primary
• NEVER remove the last remaining OCR file

No comments: