To check the OLR
Location
cat
/etc/oracle/olr.loc
[root@rac1 bin]# cat /etc/oracle/olr.loc
olrconfig_loc=/u01/app/12.2.0.1/grid/cdata/rac1.olr
crs_home=/u01/app/12.2.0.1/grid
ocrcheck –local
[root@rac1 bin]# ./ocrcheck -local
Status of Oracle Local Registry is as follows :
Version : 4
Total space (kbytes) : 409568
Used space (kbytes) : 912
Available space (kbytes) :
408656
ID :
1305540689
Device/File Name :
/u01/app/12.2.0.1/grid/cdata/rac1.olr
Device/File
integrity check succeeded
Local registry integrity check succeeded
Logical corruption check succeeded
Get and Set OLR
Backup Location
·
GET
ocrconfig –local –showbackuploc
[root@rac1 bin]# ./ocrconfig -local
-showbackuploc
The Oracle Local Registry backup location is
[/backup]
·
SET
ocrconfig –local –backuploc <target_loc>
[root@rac1 bin]# ./ocrconfig -local -backuploc
/newbkp
[root@rac1 bin]# ./ocrconfig -local
-showbackuploc
The Oracle Local Registry backup location is
[/newbkp]
OLR Backups
·
To check OLR Backups
ocrconfig -local –showbackup
[root@rac1 bin]# ./ocrconfig -local -showbackup
rac1
2019/02/01 00:54:46
/backup/backup_20190201_005446.olr
0
rac1
2018/07/26 13:21:46 /u01/app/12.2.0.1/grid/cdata/rac1/backup_20180726_132146.olr 0
·
Backup OLR
ocrconfig –local –manualbackup
[root@rac1 bin]# ./ocrconfig -local
-manualbackup
rac1
2019/02/01 01:49:23
/newbkp/backup_20190201_014923.olr
0
rac1
2019/02/01 00:54:46
/backup/backup_20190201_005446.olr
0
rac1
2018/07/26 13:21:46
/u01/app/12.2.0.1/grid/cdata/rac1/backup_20180726_132146.olr 0
·
Export OLR
ocrconfig –local –export <filename>
[root@rac1 bin]# ./ocrconfig -local -export
/newbkp/olr-export
PROTL-58: successfully exported the Oracle
Local Registry contents to file '/newbkp/olr-export'
[root@rac1 bin]# ls -lrt /newbkp/olr-export
-rw-------. 1 root root 69632 Feb 1 01:53 /newbkp/olr-export
How to Restore OLR from Backup when OLR is missing.
Ø
To simulate OLR missing , go to $GRID_HOME/cdata
location and rename rac1.olr to rac1.olr.bkp
Ø
Stop CRS on Node (crsctl stop crs /crsctl stop
crs –f)
Ø
Try to start CRS to check whether it starts
without OLR
[root@rac1 bin]# ./crsctl start crs
PROCL-26: Error while accessing the physical storage
Operating System error [No such file or directory] [2]
CRS-4000: Command Start failed, or completed with
errors.
Ø
Showbackup does not work here as the stack is
not yet started . We must be aware of our OLR backups location or OLR exports
location .
[root@rac1 bin]# ./ocrconfig -local -showbackup
PROTL-1: Failed to initialize ocrconfig
PROCL-26: Error while accessing the physical storage
Storage layer error [Configured OLR device has an invalid format] [0]
Ø
In order to restore or import OLR from backups ,
first we need to create a dummy file in $GRID_HOME/cdata with the same name
using touch command and change the ownership of the file .
[root@rac1
cdata]# pwd
/u01/app/12.2.0.1/grid/cdata
[root@rac1
cdata]# touch rac1.olr
[root@rac1
cdata]# chown root:dba rac1.olr
[root@rac1
cdata]# ls -lrt rac1.olr*
-rw-------.
1 root dba 503484416 Feb 1 01:12
rac1.olr.old
-rw-r--r--.
1 root dba 503484416 Feb 1 01:29
rac1.olr.bkp
-rw-r--r--.
1 root dba 503484416 Feb 1 02:00
rac1.olr.1
-rw-r--r--.
1 root dba 0 Feb 1 02:07 rac1.olr
Ø
Restore the OLR from backup
[root@rac1
bin]# ./ocrconfig -local -restore /newbkp/backup_20190201_014923.olr
[root@rac1
bin]# cd /u01/app/12.2.0.1/grid/cdata
[root@rac1
cdata]# ls -lrt rac1.olr*
-rw-------.
1 root dba 503484416 Feb 1 01:12
rac1.olr.old
-rw-r--r--.
1 root dba 503484416 Feb 1 01:29
rac1.olr.bkp
-rw-r--r--.
1 root dba 503484416 Feb 1 02:00
rac1.olr.1
-rw-r--r--.
1 root dba 503484416 Feb 1 02:22
rac1.olr
[root@rac1
cdata]#
Ø
Import OLR from Export
[root@rac1
bin]# ./ocrconfig -local -import /newbkp/olr-export
[root@rac1
bin]# cd /u01/app/12.2.0.1/grid/cdata
[root@rac1
cdata]# ls -lrt rac1.olr*
-rw-------.
1 root dba 503484416 Feb 1 01:12
rac1.olr.old
-rw-r--r--.
1 root dba 503484416 Feb 1 01:29
rac1.olr.bkp
-rw-r--r--.
1 root dba 503484416 Feb 1 02:00
rac1.olr.1
-rw-r--r--.
1 root dba 503484416 Feb 1 02:26
rac1.olr
[root@rac1
cdata]#
NOTE : Either restore from backup or Import from the
previous export file
Ø
Start CRS
crsctl start crs
Ø
Do the OLR check
[root@rac1
bin]# ./ocrcheck -local
Status
of Oracle Local Registry is as follows :
Version : 4
Total space (kbytes) :
409568
Used space (kbytes) :
936
Available space (kbytes) : 408632
ID : 775180756
Device/File Name :
/u01/app/12.2.0.1/grid/cdata/rac1.olr
Device/File
integrity check succeeded
Local registry integrity check succeeded
Logical corruption check succeeded
Ø
As GRID User do the OLR integrity check and fix
the reported issues .
[oracle@rac1
~]$ cluvfy comp olr
Verifying
OLR Integrity ...FAILED (PRVG-2033)
Verification
of OLR integrity was unsuccessful on all the specified nodes.
Failures
were encountered during execution of CVU verification request "OLR
integrity".
Verifying
OLR Integrity ...FAILED
rac1:
PRVG-2033 : Permissions of file
"/u01/app/12.2.0.1/grid/cdata/rac1.olr"
did not match the expected octal value on
node "rac1". [Expected = "0600"
; Found = "0644"]
CVU
operation performed: OLR integrity
Date: Feb 1, 2019 2:45:24 AM
CVU
home:
/u01/app/12.2.0.1/grid/
User: oracle
[oracle@rac1
~]$
Change File Permissions
[root@rac1
bin]# cd /u01/app/12.2.0.1/grid/cdata/
[root@rac1
cdata]# ls -lrt rac1.olr*
-rw-------.
1 root dba 503484416 Feb 1 01:12
rac1.olr.old
-rw-r--r--.
1 root dba 503484416 Feb 1 01:29
rac1.olr.bkp
-rw-r--r--.
1 root dba 503484416 Feb 1 02:00
rac1.olr.1
-rw-r--r--.
1 root dba 503484416 Feb 1 02:52
rac1.olr
[root@rac1
cdata]# chmod 600 rac1.olr
[root@rac1
cdata]#
Re-run the Integrity check as grid user .
[oracle@rac1
~]$ cluvfy comp olr
Verifying
OLR Integrity ...PASSED
Verification
of OLR integrity was successful.
CVU
operation performed: OLR integrity
Date: Feb 1, 2019 2:55:44 AM
CVU
home:
/u01/app/12.2.0.1/grid/
User: oracle
[oracle@rac1
~]$
No comments:
Post a Comment