06 March, 2017

12cR1 RAC Posts -- 7 : OCR Commands

[Yes, I know that 12.2 is now available for download but it will be some time before I have a running 12.2 RAC environment]

Some OCR / OLR Commands :

The OCR is the Cluster Registry.  We also have an OLR that is the Local Registry which is created on a local filesystem.

We can check the consistency of the Registry with ocrcheck.  Note the difference between using oracle (or grid) and using root to run the check.  oracle can't check the OLR and can't do a logical consistency check of the OCR -- both require to be run as root.

[root@collabn1 ~]# su - oracle
[oracle@collabn1 ~]$ . oraenv
ORACLE_SID = [oracle] ? +ASM1
The Oracle base has been set to /u01/app/oracle
[oracle@collabn1 ~]$ ocrcheck -local
PROTL-602: Failed to retrieve data from the local registry
PROCL-26: Error while accessing the physical storage Operating System error [Permission denied] [13]
[oracle@collabn1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     409568
         Used space (kbytes)      :       1676
         Available space (kbytes) :     407892
         ID                       :  827167720
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check bypassed due to non-privileged user

[oracle@collabn1 ~]$ su
Password:
[root@collabn1 oracle]# ocrcheck -local
Status of Oracle Local Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     409568
         Used space (kbytes)      :       1036
         Available space (kbytes) :     408532
         ID                       : 1014277103
         Device/File Name         : /u01/app/12.1.0/grid/cdata/collabn1.olr
                                    Device/File integrity check succeeded

         Local registry integrity check succeeded

         Logical corruption check succeeded

[root@collabn1 oracle]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     409568
         Used space (kbytes)      :       1676
         Available space (kbytes) :     407892
         ID                       :  827167720
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check succeeded

[root@collabn1 oracle]#


Oracle automates backups of the OCR (but not the OLR !).  Below, the -showbackuploc shows the location of backups.

[root@collabn1 oracle]# ocrconfig -showbackuploc
The Oracle Cluster Registry backup location is [/u01/app/12.1.0/grid/cdata/]
[root@collabn1 oracle]# ls -lt /u01/app/12.1.0/grid/cdata
total 1272
-rw-------. 1 root   oinstall 503484416 Mar  6 17:03 collabn1.olr
drwxrwxr-x. 2 oracle oinstall      4096 Jan 16 14:12 collabn-cluster
drwxr-xr-x. 2 oracle oinstall      4096 Dec 19 15:06 collabn1
drwxr-xr-x. 2 oracle oinstall      4096 Dec 19 14:37 localhost
[root@collabn1 oracle]# ls -lt /u01/app/12.1.0/grid/cdata/collabn1
total 820
-rw-r--r--. 1 root root 839680 Dec 19 15:06 backup_20161219_150615.olr
[root@collabn1 oracle]# ocrconfig -showbackup

collabn1     2017/01/16 14:09:40     /u01/app/12.1.0/grid/cdata/collabn-cluster/backup00.ocr     0

collabn1     2017/01/16 14:09:40     /u01/app/12.1.0/grid/cdata/collabn-cluster/day.ocr     0

collabn1     2017/01/16 14:09:40     /u01/app/12.1.0/grid/cdata/collabn-cluster/week.ocr     0

collabn2     2016/12/19 15:47:24     /u01/app/12.1.0/grid/cdata/collabn-cluster/backup_20161219_154724.ocr     0   

collabn2     2016/12/19 15:47:16     /u01/app/12.1.0/grid/cdata/collabn-cluster/backup_20161219_154716.ocr     0   
[root@collabn1 oracle]#


All recent (4-Hourly, Daily, Weekly) of the OCR are on the "master" node -- collabn1 -- which comes up first in my cluster.    The 19-Dec backups (of the OCR and OLR) are when I started setting up the Cluster.  Note that there are no subsequent (automated) OLR backups.
Note : There are no 4-Hourly/Daily/Weekly backups since 16-Jan because I haven't had my cluster running for long enough for those backups to kick in.

[root@collabn1 oracle]# ocrconfig -local -manualbackup

collabn1     2017/03/06 17:11:29     /u01/app/12.1.0/grid/cdata/collabn1/backup_20170306_171129.olr     0

collabn1     2016/12/19 15:06:15     /u01/app/12.1.0/grid/cdata/collabn1/backup_20161219_150615.olr     0
[root@collabn1 oracle]# ocrconfig -manualbackup

collabn1     2017/03/06 17:12:21     /u01/app/12.1.0/grid/cdata/collabn-cluster/backup_20170306_171221.ocr     0   

collabn2     2016/12/19 15:47:24     /u01/app/12.1.0/grid/cdata/collabn-cluster/backup_20161219_154724.ocr     0   

collabn2     2016/12/19 15:47:16     /u01/app/12.1.0/grid/cdata/collabn-cluster/backup_20161219_154716.ocr     0   
[root@collabn1 oracle]#


I can run manual backups (the -local is for the OLR) as shown above.

It is important to include these backups in the backup strategy for the filesystem(s) that hold the Grid Infrastructure and RDBMS installations (binaries, configuration files, trace files etc).
.
.
.

No comments: