Home > Oracle Rac > Restoring OCR and Voting Disk on shared storage 11gr2

Restoring OCR and Voting Disk on shared storage 11gr2

RESTORING OCR

1. List the nodes in your cluster by running the following command as root on one node:

#./olsnodes
davis
cruz

2. Stop Oracle Clusterware by running the following command as root on all of the nodes:

# crsctl stop crs

If the preceding command returns any error due to OCR corruption, stop Oracle Clusterware by running the following command as root on all of the nodes:

# crsctl stop crs -f

If you are using ASM  we need to start ASM on the node where we will recover the OCR

#crstcl start crs -excl

After startup verify that the diskgroups we need are mounted

SQL> select name, state from v$asm_diskgroup

Stop crsd if running

crsctl stop resource ora.crsd -init

3. Run the following command to list the backup files:

<strong># ./ocrconfig -showbackup</strong>

cruz     2012/07/18 14:33:22     /u05/ocrbackup/backup00.ocr
cruz     2012/07/18 10:33:21     /u05/ocrbackup/backup01.ocr
cruz     2012/07/18 06:33:20     /u05/ocrbackup/backup02.ocr
cruz     2012/07/16 18:33:10     /u05/ocrbackup/day.ocr
cruz     2012/07/11 10:32:33     /u05/ocrbackup/week.ocr
davis     2012/01/26 11:13:52    /u05/ocrbackup/backup_20120126_111352.ocr

I have moved the ocr backups onto shared storage just in case we have node failure and dont have access to the backups

If you need show both  automatically or manually created backups


<strong># ./ocrconfig -showbackup manual</strong>
cruz     2012/07/18 16:39:44     /u05/ocrbackup/backup_20120718_163944.ocr
davis     2012/07/18 16:18:35     /u05/ocrbackup/backup_20120718_161835.ocr
davis     2012/01/26 11:13:52     /u05/ocrbackup/backup_20120126_111352.ocr
davis     2012/01/26 11:11:43     /u01/app/11.2.0.2/grid/cdata/ractestscan/backup_20120126_111143.ocr

<strong># ./ocrconfig -showbackup auto</strong>
cruz     2012/07/18 14:33:22     /u05/ocrbackup/backup00.ocr
cruz     2012/07/18 10:33:21     /u05/ocrbackup/backup01.ocr
cruz     2012/07/18 06:33:20     /u05/ocrbackup/backup02.ocr
cruz     2012/07/16 18:33:10     /u05/ocrbackup/day.ocr
cruz     2012/07/11 10:32:33     /u05/ocrbackup/week.ocr

4. If you are restoring OCR to a cluster file system or network file system

if you need to find the location of the OCR

(HP-UX)

/var/opt/oracle/ocr.loc

<strong># ./ocrcheck</strong>
Status of Oracle Cluster Registry is as follows :
Version                  :          3
Total space (kbytes)     :     262120
Used space (kbytes)      :       3316
Available space (kbytes) :     258804
ID                       :  579764850
Device/File Name         : /u02/ocr/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

If this command does not display the message Device/File integrity check succeeded for at least one copy of the OCR,
then both the primary OCR and the OCR mirrors have failed. You must restore the OCR from a backup.

Review the contents of the backup using the following ocrdump
command, where file_name is the name of the OCR backup file. The command generates an ASCII file OCRDUMPFILE:

#ocrdump -backupfile OCR_backup_file_name

# ocrconfig -restore /u05/ocrbackup/backup00.ocr

Restart Oracle Clusterware on all nodes of the cluster

#crsctl start crs

Use the Cluster Verification Utility (CVU) to verify the OCR integrity. Run the following command,
where the -n all argument retrieves a list of all the cluster nodes that are configured as part of your cluster:

<strong>grid#cluvfy comp ocr -n all -verbose</strong>

Verifying OCR integrity

Checking OCR integrity...

Checking the absence of a non-clustered configuration...
All nodes free of non-clustered, local-only configurations

Checking OCR config file "/var/opt/oracle/ocr.loc"...

OCR config file "/var/opt/oracle/ocr.loc" check successful

Checking OCR location "/u02/ocr/ocr"...

Check for OCR location "/u02/ocr/ocr" successful

Check for compatible storage device for OCR location "/u02/ocr/ocr"...

Check for compatible storage device for OCR location "/u02/ocr/ocr" is successful...

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.

The output above confirms that OCR was successfully restored

RESTORING VOTING DISK

1.  Make sure that the OCR is restored and valid using ocrcheck
2. Run the following command as root from only one node to start the Oracle Clusterware stack in exclusive mode, which does not require voting files to be present or usable:
# crsctl start crs -excl

3. Run the crsctl query css votedisk command to retrieve the list of voting files currently defined, similar to the following:

## STATE File Universal Id File Name Disk group
— —– —————– ——— ———
1. ONLINE a9f61832112b4f33bf98988caac790f6 (/u02/ocr/vdsk) []
Located 1 voting disk(s).

4. run the following command using the File Universal Identifier (FUID) obtained in the previous step:

$ crsctl delete css votedisk FUID

5.  Add a voting disk, as follows:

$ crsctl add css votedisk path_to_voting_disk

6. Stop the Oracle Clusterware stack as root:
# crsctl stop crs
If the Oracle Clusterware stack is running in exclusive mode, then use the -f option to force the shutdown of the stack.

7. Restart the Oracle Clusterware stack in normal mode as root:
# crsctl start crs

Oracle Local Registry

Each node in a cluster has a local registry for node-specific resources, called an Oracle Local Registry (OLR),

By default, OLR is located at Grid_home/cdata/host_name.olr on each node.

You can check the status of OLR on the local node using the OCRCHECK utility, as follows:

# ocrcheck -local

You can display the content of OLR on the local node to the text terminal that initiated the program using the OCRDUMP utility, as follows:

# ocrdump -local -stdout

You can perform administrative tasks on OLR on the local node using the OCRCONFIG utility.

To export OLR to a file

# ocrconfig –local –export file_name

Oracle recommends that you use the -manualbackup and -restore commands and not the -import and -export commands.

When exporting OLR, Oracle recommends including “olr“, the host name, and the timestamp in the name string. For example:

olr_myhost1_20090603_0130_export

To import a specified file to OLR:

# ocrconfig –local –import file_name

To manually back up OLR:

# ocrconfig –local –manualbackup

Note:

The OLR is backed up at the end of an installation or an upgrade. After that time, you can only manually back up the OLR. Automatic backups are not supported for the OLR. You should create a new backup when you migrate OCR from Oracle ASM to other storage, or when you migrate OCR from other storage to Oracle ASM.

The default backup location for the OLR is in the path Grid_home/cdata/host_name.

To view the contents of the OLR backup file:

ocrdump -local -backupfile olr_backup_file_name

To change the OLR backup location:

ocrconfig -local -backuploc new_olr_backup_path

To restore OLR:


# crsctl stop crs # ocrconfig -local -restore file_name

# ocrcheck -local

# crsctl start crs

$ cluvfy comp olr

Advertisements
Categories: Oracle Rac
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: