Skip Headers
Oracle® Clusterware Administration and Deployment Guide
11g Release 2 (11.2)

Part Number E10717-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

G Managing the Oracle Cluster Registry

This appendix describes the syntax of the Oracle Cluster Registry (OCR) configuration utility, OCRCONFIG. It also explains how to troubleshoot OCR using the OCRDUMP and OCRCHECK utilities. You can also use these utilities on Oracle Local Registry (OLR).

This appendix contains the following topics:


About OCRCONFIG

This section contains topics which relate to using the OCRCONFIG utility.

Overview

Use the ocrconfig command to manage OCR. Using this utility you can import, export, add, delete, restore, overwrite, backup, repair, replace, move, upgrade, or downgrade OCR.

Operational Notes

Usage Information

Using Utility Help

To display the help output for the OCRCONFIG utility:

ocrconfig -help

Privileges and Security

To use the OCRCONFIG utility you must be logged into the operating system as a user with administrative privileges.

Log Files

When you use the OCRCONFIG utility, a log file called ocrconfig_pid.log is created in the $ORACLE_HOME/log/host_name/client directory. Ensure that you have write privileges in this directory before running the OCRCONFIG utility.


OCRCONFIG Command Reference

This section lists the following OCRCONFIG commands:

ocrconfig -add

Use the ocrconfig -add command to add an OCR location to a storage device or Oracle Automatic Storage Management (Oracle ASM) disk group. OCR locations that you add must exist, have sufficient permissions, and, in the case of Oracle ASM disk groups, must be mounted before you can add them.

Syntax

ocrconfig -add location_name

Usage Notes

Example

To add an OCR location to the default location in Oracle ASM, data:

# ocrconfig -add +data

ocrconfig -backuploc

Use the ocrconfig -backuploc command to specify an OCR backup directory location.

Syntax

ocrconfig [-local] -backuploc file_name

Usage Notes

Example

To specify an OCR backup location in a directory:

# ocrconfig -backuploc $Grid_home/cdata/cluster3

ocrconfig -delete

Use the ocrconfig -delete command to remove an OCR device or file.

Syntax

ocrconfig -delete file_name

Usage Notes

Example

To remove an OCR location:

# ocrconfig -delete +olddg

ocrconfig -downgrade

Use the ocrconfig -downgrade command to downgrade OCR to an earlier specified version.

Syntax

ocrconfig -downgrade [-version version_string]

Usage Notes

Example

To downgrade OCR to an earlier version:

# ocrconfig -downgrade -version

ocrconfig -export

Use the ocrconfig -export command to export the contents of OCR to a target file.

Syntax

ocrconfig [-local] -export file_name

Usage Notes

Example

To export the contents of OCR to a file:

# ocrconfig -export d:\tmp\a

ocrconfig -import

Use the ocrconfig -import command to import the contents of a target file into which you exported the contents of OCR back into OCR.

Syntax

ocrconfig [-local] -import file_name

Usage Notes

Example

To import the contents a file back into OCR:

# ocrconfig -import d:\tmp\a

ocrconfig -manualbackup

Use the ocrconfig -manualbackup command to back up OCR on demand in the location you specify with the -backuploc option.

Syntax

ocrconfig [-local] -manualbackup

Usage Notes

Example

To back up OCR:

# ocrconfig -manualbackup

ocrconfig -overwrite

Use the ocrconfig -overwrite command to overwrite an OCR configuration in the OCR metadata with the current OCR configuration information that is found on the node from which you run this command.

Syntax

ocrconfig -overwrite

Usage Notes

Example

To overwrite an OCR configuration:

# ocrconfig -overwrite

ocrconfig -repair

Use the ocrconfig -repair command to repair an OCR configuration on the node from which you run this command. Use this command to add, delete, or replace an OCR location on a node that may have been stopped while you made changes to the OCR configuration in the cluster. OCR locations that you add must exist, have sufficient permissions, and, in the case of Oracle ASM disk groups, must be mounted before you can add them.

Syntax

ocrconfig -repair -add file_name | -delete file_name | -replace 
current_file_name -replacement new_file_name

Usage Notes

Example

To repair an OCR configuration:

# ocrconfig -repair -delete +olddg

ocrconfig -replace

Use the ocrconfig -replace command to replace an OCR device or file on the node from which you run this command. OCR locations that you add must exist, have sufficient permissions, and, in the case of Oracle ASM disk groups, must be mounted before you can add them.

Syntax

ocrconfig -replace current_location_name -replacement new_location_name

Usage Notes

Example

To replace an OCR device or file:

# ocrconfig -replace /dev/raw/raw1 -replacement +newdg

ocrconfig -restore

Use the ocrconfig -restore command to restore OCR from an automatically created OCR backup file.

Syntax

ocrconfig [-local] -restore file_name

Usage Notes

Example

To restore OCR from a file on Oracle ASM:

# ocrconfig -restore +backupdg:BACKUP02

ocrconfig -showbackup

Use the ocrconfig -showbackup command to display the backup location, timestamp, and the originating node name of the backup files. By default, this command displays information for both automatic and manual backups unless you specify auto or manual.

Syntax

ocrconfig [-local] -showbackup [auto | manual]

Usage Notes

Example

To display manual backup information for OLR:

$ ocrconfig -local -showbackup manual

ocrconfig -upgrade

Use the ocrconfig -upgrade command to upgrade OCR from a previous version.

Syntax

ocrconfig [-local] -upgrade [user [group]]

Usage Notes

Example

To display manual backup information for OLR:

# ocrconfig -local -showbackup manual

Troubleshooting and Diagnostic Output

This section describes various methods for troubleshooting problems with OCR, and obtaining diagnostic information from the utilities used to manage the OCR.

This section contains the following topics:


Oracle Cluster Registry Troubleshooting

Table G-1 describes common OCR problems with corresponding resolution suggestions.

Table G-1 Common Oracle Cluster Registry Problems and Solutions

Problem Solution

Not currently using OCR mirroring and would like to enable it.

Run the ocrconfig command with the -replace option.

OCR failed and you must replace it. Error messages in Oracle Enterprise Manager or OCR log file.

Run the ocrconfig command with the -replace option.

OCR has a misconfiguration.

Run the ocrconfig command with the -repair option as described.

You are experiencing a severe performance effect from OCR processing or you want to remove OCR for other reasons.

Run the ocrconfig command with the -replace option as described.

OCR has failed and before you can fix it, the node must be rebooted with only one OCR.

Run the ocrconfig with the -repair option to remove the bad OCR location. Oracle Clusterware cannot start if it cannot find all OCRs defined.



Using the OCRCHECK Utility

The OCRCHECK utility displays the version of the OCR's block format, total space available and used space, OCRID, and the OCR locations that you have configured. OCRCHECK performs a block-by-block checksum operation for all of the blocks in all of the OCRs that you have configured. It also returns an individual status for each file and a result for the overall OCR integrity check.

You can run the ocrcheck -help command to display usage information about this utility.

The following example shows a sample of the OCRCHECK utility output:

# ocrcheck

Status of Oracle Cluster Registry is as follows :
        Version                  :          3
        Total space (kbytes)     :     262120
        Used space (kbytes)      :        752
        Available space (kbytes) :     261368
        ID                       : 2098980155
        Device/File Name         : +dg1
                                   Device/File integrity check succeeded
        Device/File Name         : +dg2
                                   Device/File integrity check succeeded
                                   Device/File not configured
                                   Device/File not configured
                                   Device/File not configured
        Cluster registry integrity check succeeded 
        Logical corruption check succeeded

Note:

The logical corruption check is only performed if you run the ocrcheck command as root.

To display only configured OCRs:

$ ocrcheck -config

Oracle Cluster Registry configuration is :
        Device/File Name         : Grid_home/oracle/has_work/data.ocr
        Device/File Name         : Grid_home/oracle/has_work/mirror.ocr

Run the ocrcheck -local -config command to obtain OLR information.

$ ocrcheck -local -config

Oracle Local Registry configuration is :
        Device/File Name         : Grid_home/oracle/has_work/data.olr.stact23

OCRCHECK creates a log file in the Grid_home/log/host_name/client directory. To change the log level, edit the Grid_home/srvm/admin/ocrlog.ini file.


Using the OCRDUMP Utility to View Oracle Cluster Registry Content

This section explains how to use the OCRDUMP utility to view OCR and Oracle Local Registry (OLR) content for troubleshooting. The OCRDUMP utility enables you to view the OCR and OLR contents by writing the content to a file or stdout in a readable format.

You can use several options for OCRDUMP. For example, you can limit the output to a key and its descendents. You can also write the contents to an XML file that you can view using a browser. OCRDUMP writes the OCR keys as ASCII strings and values in a data type format. OCRDUMP retrieves header information based on a best effort basis.

OCRDUMP also creates a log file in Grid_home/log/host_name/client. To change the log level, edit the Grid_home/srvm/admin/ocrlog.ini file.

To change the logging component, edit the entry containing the comploglvl= entry. For example, to change the log level of the OCRAPI component to 3 and to change the log level of the OCRRAW component to 5, make the following entry in the ocrlog.ini file:

comploglvl="OCRAPI:3;OCRRAW:5"

Note:

Make sure that you have file creation privileges in the Grid_home directory before using the OCRDUMP utility.

This section includes the following topics:

OCRDUMP Utility Syntax and Options

This section describes the OCRDUMP utility command syntax and usage. Run the ocrdump command with the following syntax where file_name is the name of a target file to which you want Oracle Database to write the Oracle Cluster Registry output and where key_name is the name of a key from which you want Oracle Database to write Oracle Cluster Registry subtree content:

$ ocrdump [file_name | -stdout] [-local] [-backupfile backup_file_name
[-keyname key_name] [-xml] [-noheader]
]

Table G-2 describes the OCRDUMP utility options and option descriptions.

Table G-2 OCRDUMP Options and Option Descriptions

Options Description

file_name

The name of a file to which you want OCRDUMP to write output.

By default, OCRDUMP writes output to a predefined output file named OCRDUMPFILE. The file_name option redirects OCRDUMP output to a file that you specify.

-stdout

Use this option to redirect the OCRDUMP output to the text terminal that initiated the program.

If you do not redirect the output, OCRDUMP writes output to a predefined output file named OCRDUMPFILE.

-local

Use this option to dump the contents of OLR.

-backupfile

Use this option to view the contents of an OCR backup file. Use the -local option with this option to view the contents of an OLR backup file.

backup_file_name

The name of the backup file with the content you want to view. You can query the backups using the ocrconfig -showbackup command.

-keyname key_name

The name of an Oracle Cluster Registry key whose subtree is to be dumped.

-xml

Use this option to write the output in XML format.

-noheader

Does not print the time at which you ran the command and when the Oracle Cluster Registry configuration occurred.


OCRDUMP Utility Examples

The following ocrdump utility examples extract various types of OCR information and write it to various targets:

ocrdump

Writes the OCR content to a file called OCRDUMPFILE in the current directory.

ocrdump MYFILE

Writes the OCR content to a file called MYFILE in the current directory.

ocrdump -stdout -keyname SYSTEM

Displays the OCR content from the subtree of the key SYSTEM in the terminal window.

ocrdump -stdout -xml

Displays the OCR content in the terminal window in XML format.

ocrdump -stdout -backupfile $ORA_CRS_HOME/cdata/cluster_name/file_name

Writes the entire OCR and OLR content to a backup file located in the $ORA_CRS_HOME/cdata/cluster_name directory. You must run this command as root to be able to view all of the keys. Be sure to name the file appropriately so that it can be recognized by anyone as an OCR backup file, such as BACKUPOO.ocr.

Sample OCRDUMP Utility Output

The following OCRDUMP examples show the KEYNAME, VALUE TYPE, VALUE, permission set (user, group, world) and access rights for two sample runs of the ocrdump command. The following shows the output for the SYSTEM.language key that has a text value of AMERICAN_AMERICA.WE8ASCII37.

[SYSTEM.language]
ORATEXT : AMERICAN_AMERICA.WE8ASCII37
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ,
OTHER_PERMISSION : PROCR_READ, USER_NAME : user, GROUP_NAME : group}

The following shows the output for the SYSTEM.version key that has integer value of 3:

[SYSTEM.version]
UB4 (10) : 3
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ,
OTHER_PERMISSION : PROCR_READ, USER_NAME : user, GROUP_NAME : group}

Diagnostic Output for OCRCONFIG

The OCRCONFIG utility creates a log file in Grid_home/log/host_name/client.

To change the amount of logging, edit the path in the Grid_home/srvm/admin/ocrlog.ini file.