Oracle Local Registry (OLR) in RAC
4 min readOracle Clusterware includes three components: voting disks, Oracle Cluster Registry (OCR), and Oracle Local Registry (OLR).
■ Voting disks manage information about node membership. Each voting disk must be accessible by all nodes in the cluster for nodes to be members of the cluster. ■ OCR manages Oracle Clusterware and Oracle RAC database configuration information. ■ OLR resides on every node in the cluster and manages Oracle Clusterware configuration information for each particular node.
Each node in a cluster has a local registry for node-specific resources, called an Oracle Local Registry (OLR), that is installed and configured when Oracle Clusterware installs OCR. Multiple processes on each node have simultaneous read and write access to the OLR particular to the node on which they reside, regardless of whether Oracle Clusterware is running or fully functional. Oracle Local Registry is OCRs local counterpart. It stores information about the local node only, mainly related to the OHASd It was introduced in 11gR2, and is not shared by any other node in the cluster. The OLR is located on local storage on each node in a cluster.
Function of OLR:
It is the first file that is accessed to startup Clusterware when OCR is stored on ASM. OCR should be accessible to find out the resources which need to be started on a node. If OCR is on ASM, it can’t be read until ASM (which itself is a resource for the node and this information is stored in OCR) is up. To resolve this problem, information about the resources which need to be started on a node is stored in an operating system file which is called Oracle Local Registry or OLR. Since OLR is an operating system file, it can be accessed by various processes on the node for read/write irrespective of the status of the Clusterware (up/down). Hence, when a node joins the cluster, OLR on that node is read, various resources ,including ASM are started on the node . Once ASM is up , OCR is accessible and is used to manage all the Clusterware resources. If OLR is missing or corrupted, Clusterware can’t be started on that node!
Generally, the following information is found in the OLR. 1) Data about Grid Plug and Play Wallet 2) Clusterware configuration 3) Version information
The location of OLR can be found in /etc/oracle/olr.loc
The default location of OLR:
$GRID_HOME/cdata/*olr
Run the ocrcheck -local -config command to obtain OLR information
-local: Option to dump the contents of OLR.
$ ocrcheck -local -config
Oracle Local Registry configuration is :
Device/File Name : Grid_home/oracle/data/olr.local2
Manage OLR using the OCRCHECK, OCRDUMP, and OCRCONFIG utilities as root with the -local option.
You can check the status of OLR on the local node using the OCRCHECK utility:
$GRID_HOME/bin/ocrcheck -local
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262132
Used space (kbytes) : 9200
Available space (kbytes) : 252932
ID : 604793089
Device/File Name : /opt/data/crs/cdata/localhost/localhost.olr
Device/File integrity check succeeded
Local OCR integrity check succeeded
View OLR in text format:
$GRID_HOME/bin/ocrdump -local -stdout
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
ocrconfig [-local] -showbackup [auto | manual]
You can perform administrative tasks on OLR on the local node using the OCRCONFIG utility.
To export OLR to a file:
# ocrconfig –local –export file_name
To import a specified file to OLR"
# ocrconfig –local –import file_name
To manually back up OLR:
# ocrconfig –local –manualbackup
To view the contents of the OLR backup file:
ocrdump -local -backupfile olr_backup_file_name
To change the OLR backup location:
ocrconfig -local -backuploc new_olr_backup_path
To restore OLR:
# crsctl stop crs
# ocrconfig -local -restore file_name
# ocrcheck -local
# crsctl start crs
$ cluvfy comp olr
cluvfy comp olr
Use the cluvfy comp olr component verification command to check the integrity of Oracle Local Registry (OLR) on the local node.
cluvfy comp olr -verbose
This command produces output similar to the following:
Verifying OLR integrity
Checking OLR integrity...
Checking OLR config file...
OLR config file check successful
Checking OLR file attributes...
OLR file check successful
WARNING:
This check does not verify the integrity of the OLR contents. Execute ‘ocrcheck
-local’ as a privileged user to verify the contents of OLR.
OLR integrity check passed
Verification of OLR integrity was successful.