Disclaimer

Sunday, 24 November 2024

Oracle Local Registry (OLR) and OLR restore and Recovery in Oracle RAC

 

Oracle Local Registry (OLR) and OLR restore and Recovery in Oracle RAC


What is Oracle Local Registry (OLR)?

The Oracle Local Registry (OLR) is an operating system file that resides on every node in an Oracle Clusterware environment. 

It manages the configuration information specific to each node in the cluster. 

The OLR contains critical information about Oracle Clusterware, including the dependencies between various services that run on the cluster.

Key Points:

  • Node-Specific Information: Unlike the Oracle Cluster Registry (OCR), which is shared across all nodes, the OLR contains node-specific configuration details and is not shared between nodes.
  • Usage by OHASD: The Oracle High Availability Services Daemon (OHASD) uses the information stored in the OLR to manage the resources and services specific to each node in the cluster.
  • Internal Structure: The structure of the OLR is similar to the OCR in that it stores configuration data in key-value pairs. However, while the OCR is a shared resource, the OLR is unique to each node.
  • Installation and Configuration: The OLR is created and configured during the Oracle Clusterware installation, alongside the OCR. It plays a crucial role in ensuring the proper functioning of Oracle Clusterware services on each node.

Tools and Management:

  • The same tools that are used to check and dump the data for the OCR (like ocrcheck and crsctl) can also be used to manage and check the status of the OLR.

What Information Exist in OLR ?

There are some of the following information present in OLR:

  • ORA_CRS_HOME
  • Clusterware Version
  • Clusterware Configuration
  • Localhost Version
  • Active Version
  • GPnP profile Details
  • OCR latest backup time and location
  • Information about OCR daily, weekly backup location
  • Node Name
  • Status of resources of the node as in which to be started and which not
  • Start & stop dependencies of resources , Start and Stop Dependencies are classified as,
    • Weak Dependency ( Means It Should fulfill)
    • Hard Dependency (Means It Must fulfill)

ORACLE LOCAL REGISTRY(OLR) contains node-specific information required by OHASD . Every node has its own dedicated OLR file.(not shared between the nodes


1. The default location of OLR:

[root@rac09-p olr]# pwd
/u01/app/grid/grid_base/crsdata/rac09-p/olr
[root@rac09-p olr]#
[root@rac09-p olr]#
[root@rac09-p olr]# ls -lrt
total 499448
-rw------- 1 root root       1028096 Aug 29 22:33 backup_20240829_223349.olr
-rw------- 1 root root       1118208 Aug 29 22:45 autobackup_20240829_224550.olr
-rw-r--r-- 1 root root     503484416 Oct 20 20:44 rac09-p_19.olr.bkp.patch
-rw------- 1 root root       1630208 Oct 20 22:24 backup_20241020_222422.olr
-rw------- 1 root root       1703936 Nov 22 23:54 autobackup_20241122_235414.olr
-rw------- 1 root oinstall 503484416 Nov 24 22:03 rac09-p_19.olr
[root@rac09-p olr]#


2.View the available backups of OLR:

In Oracle RAC, Oracle Clusterware automatically manages the backup of the Oracle Local Registry (OLR) through the Cluster Ready Services Daemon (CRSD) process. 


Here's how it works:

Automatic OLR Backup in Oracle RAC

  1. Automatic Backup Mechanism:

    • The CRSD process is responsible for automatically backing up the OLR at regular intervals.
    • These backups are stored in the crsdata directory for the respective node.
[root@rac09-p ~]# ocrconfig -local -showbackup

rac09-p     2024/11/22 23:54:14     /u01/app/grid/grid_base/crsdata/rac09-p/olr/autobackup_20241122_235414.olr     3669234883

rac09-p     2024/08/29 22:45:50     /u01/app/grid/grid_base/crsdata/rac09-p/olr/autobackup_20240829_224550.olr     2204791795

rac09-p     2024/10/20 22:24:22     /u01/app/grid/grid_base/crsdata/rac09-p/olr/backup_20241020_222422.olr     3669234883

rac09-p     2024/08/29 22:33:49     /u01/app/grid/grid_base/crsdata/rac09-p/olr/backup_20240829_223349.olr     2204791795


3. Take the backup of OLR manually: ( Need to done from ROOT user)

[root@rac09-p olr]# ocrconfig -local -manualbackup

rac09-p     2024/11/24 22:36:53     /u01/app/grid/grid_base/crsdata/rac09-p/olr/backup_20241124_223653.olr     3669234883

rac09-p     2024/10/20 22:24:22     /u01/app/grid/grid_base/crsdata/rac09-p/olr/backup_20241020_222422.olr     3669234883

rac09-p     2024/08/29 22:33:49     /u01/app/grid/grid_base/crsdata/rac09-p/olr/backup_20240829_223349.olr     2204791795
[root@rac09-p olr]#
[root@rac09-p olr]#
[root@rac09-p olr]#
[root@rac09-p olr]# ls -rlt
total 501116
-rw------- 1 root root       1028096 Aug 29 22:33 backup_20240829_223349.olr
-rw------- 1 root root       1118208 Aug 29 22:45 autobackup_20240829_224550.olr
-rw-r--r-- 1 root root     503484416 Oct 20 20:44 rac09-p_19.olr.bkp.patch
-rw------- 1 root root       1630208 Oct 20 22:24 backup_20241020_222422.olr
-rw------- 1 root root       1703936 Nov 22 23:54 autobackup_20241122_235414.olr
-rw------- 1 root root       1703936 Nov 24 22:36 backup_20241124_223653.olr
-rw------- 1 root oinstall 503484416 Nov 24 22:36 rac09-p_19.olr


4. Verify integrity of the OLR

[grid@rac09-p ~]$ cluvfy comp olr

Performing following verification checks ...

  OLR Integrity ...PASSED

Verification of OLR integrity was successful.

CVU operation performed:      OLR integrity
Date:                         Nov 24, 2024 10:38:51 PM
CVU version:                  19.24.0.0.0 (062024x8664)
Clusterware version:          19.0.0.0.0
CVU home:                     /u01/app/grid/19.3.0/gridhome_1
Grid home:                    /u01/app/grid/19.3.0/gridhome_1
User:                         grid
Operating system:             Linux4.18.0-553.16.1.el8_10.x86_64



5. Check the current OLR location:

[root@rac09-p olr]# ocrcheck -local
Status of Oracle Local Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     491684
         Used space (kbytes)      :      83496
         Available space (kbytes) :     408188
         ID                       :  162290061
         Device/File Name         : /u01/app/grid/grid_base/crsdata/rac09-p/olr/rac09-p_19.olr
                                    Device/File integrity check succeeded

         Local registry integrity check succeeded

         Logical corruption check succeeded





6.  View OLR in text format:

$GRID_HOME/bin/ocrdump -local -stdout


7. Restore OLR from backup:

If olr file is missing, How can you restore olr file from backup

In case OLR is corrupted, Restore it from backup.

# crsctl stop crs -f

# touch $GRID_HOME/cdata/<node>.olr

# chown root:oinstall $GRID_HOME/cdata/<node>.olr

# ocrconfig -local -restore $GRID_HOME/cdata/<node>/backup_<date>_<num>.olr

# crsctl start crs



8. OLR missing and no backup of OLR:

If OLR is missing , then if the cluster is already running, then cluster will run fine. 

But if you try to restart it , It will fail.

So you need to do below activities.


On the failed node:

# $GRID_HOME/crs/install/rootcrs.pl -deconfig -force
# $GRID_HOME/root.sh








No comments:

Post a Comment

How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...