OCRCONFIG
OCRCONFIG is used to manage the Cluster Registry
file in a RAC environment.
Using this tool, backups of the OCR can
be viewed, taken, and restored. By default, the
OCR is backed up every four hours.
However, in Oracle 11g it is possible to
take manual backups of the OCR in the event that
maintenance needs to take place.
Taking an OCR Backup
ocrconfig –backuploc
/u01/app/oracle/backups/ocr
Ocrconfig –manualbackup
To view the backups that have been taken, use
the
-showbackup option.
These backups are useful in the event of an
issue where the OCR becomes corrupt or unusable.
The backup OCR file can be restored with
the
-restore option.
Example:
[root@racnode1 bin]# ./ocrconfig
-backuploc /u01/app/oracle/backups/ocr
[root@racnode1 bin]# ./ocrconfig
-manualbackup
racnode1
2008/09/30 21:05:17
/u01/app/oracle/backups/ocr/backup_20080930_210517.ocr
[root@racnode1 bin]# ./ocrconfig
-showbackup
racnode1
2008/09/30 21:05:17
/u01/app/oracle/backups/ocr/backup_20080930_210517.ocr
TIP: The
-export option is good to export the
contents of the OCR.
Using
ocrconfig -export and the
strings command, every facet of a
cluster’s setup can be viewed.
Another highly useful
ocrconfig option is the
-replace option, which allows the
replacement of the ocr or ocrmirror location.
Command use:
ocrconfig -replace ocr destination_file|disk
ocrconfig -replace ocrmirror
destination_file|disk
Either a file on a cluster file system or a disk
device can be specified for either the OCR or
the OCR Mirror location.
OCRCHECK
OCRCHECK is a basic utility that displays useful
information about the Cluster Registry.
This information includes:
[root@racnode1 bin]# ./ocrcheck
Status of Oracle Cluster
Registry is as follows :
Version
:
2
Total space (kbytes)
:
1048296
Used space (kbytes)
:
3804
Available space (kbytes)
:
1044492
ID
: 1880797558
Device/File Name
:
/dev/sdb
Device/File
integrity check succeeded
Device/File
not configured
Cluster registry
integrity check succeeded
OCRDUMP
OCRDUMP provides information about data within
the OCR.
Information can be written either to a
file or to standard output, possibly in XML
format.
Optionally, a backup file can be
specified with the
-backupfile parameter, which will
analyze a backup file instead of the live OCR.
Options:
-
-stdout
- Dump to screen
-
file_name
-
Dump to file
-
If the
-stdout parameter and
file_name are omitted, the
command will dump a file in the local
directory called OCRDUMPFILE.
-
-xml
- Use XML output
-
-backupfile
- Specify a backupfile to analyze
Example output:
[root@racnode1 bin]# ./ocrdump
[root@racnode1 bin]# head -30
OCRDUMPFILE
09/30/2008 21:37:38
./ocrdump.bin
[SYSTEM]
UNDEF :
SECURITY : {USER_PERMISSION :
PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ,
OTHER_PERMISSION : PROCR_READ, USER_NAME : root,
GROUP_NAME : root}
[SYSTEM.css]
UNDEF :
SECURITY : {USER_PERMISSION :
PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ,
OTHER_PERMISSION : PROCR_READ, USER_NAME : root,
GROUP_NAME : root}
[SYSTEM.css.interfaces]
UNDEF :
SECURITY : {USER_PERMISSION :
PROCR_ALL_ACCESS, GROUP_PERMISSION :
PROCR_CREATE_SUB_KEY, OTHER_PERMISSION :
PROCR_READ, USER_NAME : oracle, GROUP_NAME :
oinstall}
[SYSTEM.css.interfaces.global]
UNDEF :
SECURITY : {USER_PERMISSION :
PROCR_ALL_ACCESS, GROUP_PERMISSION :
PROCR_ALL_ACCESS, OTHER_PERMISSION : PROCR_READ,
USER_NAME : oracle, GROUP_NAME : oinstall}
[SYSTEM.css.interfaces.global.eth0]
UNDEF :
SECURITY : {USER_PERMISSION :
PROCR_ALL_ACCESS, GROUP_PERMISSION :
PROCR_ALL_ACCESS, OTHER_PERMISSION : PROCR_READ,
USER_NAME : oracle, GROUP_NAME : oinstall}
[SYSTEM.css.interfaces.global.eth0.192|d168|d1|d0]
UNDEF :
SECURITY : {USER_PERMISSION :
PROCR_ALL_ACCESS, GROUP_PERMISSION :
PROCR_ALL_ACCESS, OTHER_PERMISSION : PROCR_READ,
USER_NAME : oracle, GROUP_NAME : oinstall}
[SYSTEM.css.interfaces.global.eth0.192|d168|d1|d0.1]
ORATEXT : public
SECURITY : {USER_PERMISSION :
PROCR_ALL_ACCESS, GROUP_PERMISSION :
PROCR_ALL_ACCESS, OTHER_PERMISSION : PROCR_READ,
USER_NAME : oracle, GROUP_NAME : oinstall}