Oracle® Clusterware Administration and Deployment Guide 11g Release 2 (11.2) Part Number E10717-08 |
|
|
View PDF |
This appendix describes the syntax of the Oracle Cluster Registry (OCR) configuration utility, OCRCONFIG.
This appendix contains the following topics:
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
The OCRCONFIG executable is located in the Grid_home/bin
directory
The ocrconfig
command syntax is as follows:
ocrconfig -option
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.
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
You must run this command as root
.
The location_name
variable can be a device name, a file name, or the name of an Oracle ASM disk group. For example:
/dev/raw/raw1
: Ensure that the device exists
/oradbocfs/crs/data.ocr
: You must create an empty (0 byte) OCR location
d:\oracle\mirror.ocr
: You must create an empty (0 byte) OCR location
+newdg
: Ensure that the disk group exists and is mounted
If you specify an Oracle ASM disk group, the name of the disk group must be preceded by a plus sign (+
).
See Also:
Oracle Grid Infrastructure Installation Guide for information about creating OCR locations and setting correct permissions
Oracle Database Storage Administrator's Guide for more information about Oracle ASM disk group management
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
You must run this command as root
.
Use the -local
option to back up OLR.
The file_name
variable can be a full directory path name that is accessible by all nodes. For example:
Grid_home
/cdata/cluster3/
d:\cdata\cluster3
The default location for generating OCR backups on Linux or UNIX systems is Grid_home
/cdata/
cluster_name
, where cluster_name
is the name of your cluster. The Windows default location for generating OCR backups uses the same path structure.
The default location for generating OLR backups on Linux or UNIX systems is Grid_home
/cdata/
host_name
, where host_name
is the name of the node on which the OLR resides that you want to back up. The Windows default location for generating OLR backups uses the same path structure.
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
You must run this command as root
.
The file_name
variable can be a device name, a file name, or the name of an Oracle ASM disk group. For example:
/dev/raw/raw1
/oradbocfs/crs/data.ocr
d:\oracle\mirror.ocr
+olddg
If you specify an Oracle ASM disk group, the name of the disk group must be preceded by a plus sign (+
).
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
You must run this command as root
.
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
You must run this command as root
.
Use the -local
option to export the contents of OLR.
The file_name
variable can be a full path name or the name of an Oracle ASM disk group that is accessible by all nodes. For example:
/oradbocfs/crs/data.ocr
d:\oracle\
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
You must run this command as root
.
Use the -local
option to import the contents of OLR from a file.
The file_name
variable must be a full path name that is accessible by all nodes. For example:
/oradbocfs/crs/data.ocr
d:\oracle\
You must shut down Oracle Clusterware before running this command.
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
You must run this command as root
.
Use the -local
option to perform a manual backup of OLR.
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
You must run this command as root
.
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
You must run this command as root
.
Oracle High Availability Services must be started to successfully complete the repair.
The Cluster Ready Services daemon must be stopped before running ocrconfig -repair
.
The file_name
variable can be a valid OCR and either a device name, an absolute path name of an existing file, or the name of an Oracle ASM disk group. For example:
/dev/raw/raw1
/oradbocfs/crs/data.ocr
d:\oracle\mirror.ocr
+newdg
If you specify an Oracle ASM disk group, the name of the disk group must be preceded by a plus sign (+
).
See Also:
Oracle Grid Infrastructure Installation Guide for information about creating OCRs and setting correct permissions
Oracle Database Storage Administrator's Guide for more information about Oracle ASM disk group management
You can only use one option with ocrconfig -repair
at a time.
Running this command only modifies the local configuration and it and only affects the current node.
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
You must run this command as root
.
The new_location_name
variable can be a device name, a file name, or the name of an Oracle ASM disk group. For example:
/dev/raw/raw1
: Ensure that the device exists
/oradbocfs/crs/data.ocr
: You must create an empty (0 byte) OCR location
d:\oracle\mirror.ocr
: You must create an empty (0 byte) OCR location
+newdg
: Ensure that the disk group exists and is mounted
If you specify an Oracle ASM disk group, the name of the disk group must be preceded by a plus sign (+
).
See Also:
Oracle Grid Infrastructure Installation Guide for information about creating OCRs and setting correct permissions
Oracle Database Storage Administrator's Guide for more information about Oracle ASM disk group management
You must have at least two OCR devices to use this command. If you do not have at least two OCR devices, then you must run the ocrconfig -add
command to add a new OCR device followed by the ocrconfig -delete
command to delete the OCR device you want to replace.
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
You must run this command as root
.
Before running this command, ensure that the original OCR or OLR files exist. If the original file does not exist, then you must create an empty file.
Use the -local
option to restore a backup of OLR.
Example file names are:
/oradbocfs/crs/BACKUP00.ocr
d:\oracle\BACKUP01.ocr
Ensure that the storage devices that you specify exist and that those devices are valid.
If OCR is located on an Oracle ASM disk group, then ensure that the disk group exists and is mounted.
Example
To restore OCR from a file on Oracle ASM:
# ocrconfig -restore /oradbocfs/crs/BACKUP00.ocr
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
Use the -local
option to show manual OLR backup information. The -local
flag functions only with the manual
option.
You can optionally specify auto
or manual
to display information about only automatic backups or only manual backups, respectively:
auto
: Displays information about automatic backups that Oracle Clusterware created in the past 4 hours, 8 hours, 12 hours, and in the last day and week.
manual
: Displays information about manual backups that you invoke using the ocrconfig -manualbackup
command.
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
You must run this command as root
.
Use the -local
option to upgrade OLR.
Example
To display manual backup information for OLR:
# ocrconfig -local -showbackup manual