This is an excerpt from the bestselling book
Oracle Grid & Real Application Clusters. To get immediate
access to the code depot of working RAC scripts, buy it
directly from the publisher and save more than 30%.
To ensure the OCR files are
recoverable, in addition to using the automatically created OCR
backup files, export the OCR contents before and after making
significant configuration changes. This is done by using the
ocrconfig -export command. This will enable the restoration of the
OCR if the configuration changes cause errors. For example, if there
are unresolvable configuration problems, or if the clusterware will
not restart after making changes, restore the configuration using
one of the following platform-specific procedures. The configuration
cannot be restored from an automatically created OCR backup file
using the -import option. Instead, the -restore option must be used.
Importing Oracle Cluster
Registry Content on UNIX-Based Systems
1.
Shut down all of the nodes in the
cluster and restart one of them in single-user mode.
2.
Import a valid OCR export file using
the ocrconfig -import command from any node.
3.
Restart all the nodes in the cluster in
multi-user mode.
To avoid stopping the entire
cluster, this alternate method can be used:
1.
Update the inittab entries on all the
nodes and remove the CRS-specific entries. Retain a copy of the
original inittab file.
2.
Run the /etc/init.d/init.crs stop
command on all the nodes.
3.
Import the valid OCR export file using
the ocrconfig -import command from any cluster node.
4.
Restore the original inittab file on
all nodes.
5.
Run the /etc/init.d/init.crs start
command on all nodes.
6.
Run the /etc/init q command.
Importing Oracle Cluster
Registry Content on Windows-Based Systems
1.
Stop the following OCR clients using
the Service Control Panel:
*
OracleClusterVolumeService,
* OracleCMService,
* OracleEVMService,
* OracleCSService, and the
* OracleCRService.
2.
Import a valid OCR export file using
the ocrconfig -import command from one of the cluster nodes.
3.
Restart all of the affected services on
all cluster nodes.
The ocrconfig Tool Command Syntax and
Options
Execute OCR commands from a user
with administrative privileges on UNIX-based platforms or from a
user with Administrator privileges on Windows-based systems. The OCR
command syntax is as follows:
ocrconfig
-<option>
OPTION |
PURPOSE |
-export |
To export the contents of
the OCR into a target file. |
-import |
To import OCR contents from
a previously exported OCR file. |
-restore |
To restore the OCR from an
automatically created OCR backup file. |
Table 8.12: Common OCR command
options
To export the OCR contents to a
binary file, for example, use the ocrconfig command with the
following syntax where file_name is the file to which the OCR
contents are to be exported:
ocrconfig
-export file_name
The export file is not editable.
If OCR clients such as the clusterware are running when an export is
attempted, then Oracle will report an error.