Thursday 2 July 2015



                        ORACLE LOCAL REGISTRY (OLR) 


OLR is an enhancement introduced in Oracle version 11GR2. In Oracle Clusterware 11g Release 2 an additional component (related to the OCR) called the Oracle Local Registry (OLR) is also being installed on each node in the cluster. The OLR is a local registry for node specific resources. The OLR is not shared by other nodes in the cluster. It is installed and configured with Oracle clusterware installation.

What is the use of OLR while we already have OCR?


It is the very 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 a file 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 henceforth to manage all the clusterware resources. If OLR is missing or corrupted, clusterware can’t be started on that node. Don't you think this part is the answer of a most commonly asked interview question!

Location of OLR :


The OLR file is located in the grid_home/cdata/<hostname>.olr . The location of OLR is stored in /etc/oracle/olr.loc. and used by OHASD .

What all does OLR contain: 


The OLR stores
  version of clusterware
  clusterware configuration
  configuration of various resources which need to be started on the node etc.



OLR administration:


You can view the status of the OLR file on each node by using the ocrcheck command with the local parameter:

#ocrcheck -local

You can use ocrdump  to  dump the contents of the OLR to the text terminal:

#ocrdump -local -stdout

You can use the ocrconfig command to export and import the OLR :

#ocrconfig -local -export <export file name >

#ocrconfig -local -import <file name>

 You can resolve/repair the OLR file corruption with the ocrconfig command:

#ocrconfig -local -repair olr <file name>

Please note The OLR gets backed up at the end of an installation or an upgrade. After that time, you can only take manual backup of the OLR. Automatic backups are not enabled/supported for the OLR.



How to Take OLR BackUP:


[root@myhost01 ~]# ocrconfig -local -manualbackup

myhost01     2015/07/01 03:21:20     /u01/app/11.2.0/grid/cdata/myhost01/backup_20150701_032120.olr

[root@myhost01 ~]# strings /u01/app/11.2.0/grid/cdata/myhost01/backup_20150701_032120.olr |grep -v type |grep ora!

ora!drivers!acfs
ora!crsd
ora!asm
ora!evmd
ora!ctssd
ora!cssd
ora!cssdmonitor
ora!diskmon
ora!gpnpd
ora!gipcd
ora!mdnsd

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

No comments:

Post a Comment