|
|
| Note: If your cluster is down, then you can use the -force option to modify the voting disk configuration when using either of these commands without interacting with active Oracle Clusterware daemons. However, you may corrupt your cluster configuration if you use the -force option while a cluster node is active |
▒ Backing Up and Recovering the Oracle Cluster Registry
Oracle Clusterware automatically creates OCR backups every 4 hours. At any one time, Oracle Clusterware always retains the latest 3 backup copies of the OCR that are 4 hours old, 1 day old, and 1 week old.
You cannot customize the backup frequencies or the number of files that Oracle Clusterware retains. You can use any backup software to copy the automatically generated backup files at least once daily to a different device from where the primary OCR file resides. The default location for generating backups on Red Hat Linux systems is CRS_home/cdata/cluster_name where cluster_name is the name of your cluster and CRS_home is the home directory of your Oracle Clusterware
installation. This section contains the following topics:
■ Viewing Available OCR Backups
■ Backing Up the OCR
■ Recovering the OCR
▒ Viewing Available OCR Backups
To find the most recent backup of the OCR, on any node in the cluster, use the following command:
ocrconfig -showbackup
▒ Backing Up the OCR
Because of the importance of OCR information, Oracle recommends that you use theocrconfig tool to make copies of the automatically created backup files at least once a day.
In addition to using the automatically created OCR backup files, you should also export the OCR contents to a file before and after making significant configuration changes, such as adding or deleting nodes from your environment, modifying Oracle Clusterware recource, or createing a database. Exporting the OCR contents to a file lets you restore the OCR if your configuration changes cause errors. For example, if you have unresolvable configuration problems, or if you are unable to restart your cluster database after such changes, then you can restore your configuration by importing the saved OCR content from the valid configuration.
To export the contents of the OCR to a file, use the following command, where backup_file_name is the name of the OCR backup file you want to create:
ocrconfig -export backup_file_name
[참고]
| Note: You must be logged in as the root user to run the ocrconfig command |
▒ Recovering the OCR
This section describes two methods for recovering the OCR. The first method uses automatically generated OCR file copies and the second method uses manually created OCR export files.
In event of a failure, before you attempt to restore the OCR, ensure that the OCR is unavailable. Run the following command to check the status of the OCR:
ocrcheck
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 mirror have failed. You must restore the OCR from a backup.
Restoring the Oracle Cluster Registry from Automatically Generated OCR Backups
When restoring the OCR from automatically generated backups, you first have to determine which backup file you will use for the recovery.
To restore the OCR from an automatically generated backup on a Red Hat Linux system:
1. Identify the available OCR backups using the ocrconfig command:
# ocrconfig -showbackup
2. Review the contents of the backup using the following ocrdump command, where file_name is the name of the OCR backup file:
$ ocrdump -backupfile file_name
# crsctl stop crs
Repeat this command on each node in your Oracle RAC cluster.
4. As the root user, restore the OCR by applying an OCR backup file that you identified in step 1 using the following command, where file_name is the name of the OCR that you want to restore. Make sure that the OCR devices that you specify in the OCR configuration exist, and that these OCR devices are valid before running this command.
# ocrconfig -restore file_name
# crsctl start crs
Repeat this command on each node in your Oracle RAC cluster.
6. Use the Cluster Verify 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:
$ cluvfy comp ocr -n all [-verbose]
Recovering the OCR from an OCR Export File
Using the ocrconfig -export command enables you to restore the OCR using the-import option if your configuration changes cause errors.
To restore the previous configuration stored in the OCR from an OCR export file:
1. Place the OCR export file that you created previously with the ocrconfig-export command in an accessible directory on disk.
2. As the root user, stop Oracle Clusterware on all the nodes in your Oracle RAC cluster by executing the following command:
crsctl stop crs
Repeat this command on each node in your Oracle RAC cluster.
3. As the root user, restore the OCR data by importing the contents of the OCR export file using the following command, where file_name is the name of the OCR export file:
ocrconfig -import file_name
4. As the root user, restart Oracle Clusterware on all the nodes in your cluster by restarting each node, or by running the following command:
crsctl start crs
Repeat this command on each node in your Oracle RAC cluster.
5. Use the 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:
cluvfy comp ocr -n all [-verbose]
|
|