Tuesday, 25 August 2015

BACKUP OF OCR AND OLR FILE IN CLUSTER WARE(RAC)

OCR is central repository for CRSD process. It stores METADATA ,configuration and state information of all the resource mentioned in clusterware.

To check the current location of OCR file.

[root@node01 ohasd]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3516
         Available space (kbytes) :     258604
         ID                       :  344790311
         Device/File Name         :   +OCR_VOT
                                    Device/File integrity check succeeded
         Device/File Name         :      +DATA
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded


         Logical corruption check succeeded



We can take two type of OCR BACKUP.

1.Auto Backup:- Auto Backup is not occur when you instance is down.

To check the Location of OCR BACKUP:-

[root@node01 ohasd]# ocrconfig -showbackup auto

node02     2015/08/25 00:43:05     /u01/BACKUPOCR/backup00.ocr

node02     2015/08/22 20:50:53     /u01/BACKUPOCR/backup01.ocr

node01     2015/08/17 11:30:48     /u01/BACKUPOCR/backup02.ocr

node02     2015/08/25 00:43:05     /u01/BACKUPOCR/day.ocr

node02     2015/08/05 11:23:49     /u01/BACKUPOCR/week.ocr

Backup frequies and rentention Policy

(backup..)Backup in every 4 hour, CRS keep last 3 copies
(day..) Backup every day  and CRS keep last 2 copies.
(Week..) Backup weekly and CRS keep last 2 copies.

2. Manual Backup

[root@node01 ohasd]# ocrconfig -showbackup manual

node01     2015/08/06 12:54:05     /u01/BACKUPOCR/backup_20150806_125405.ocr

node02     2015/08/06 11:08:43     /u01/BACKUPOCR/backup_20150806_110843.ocr

node02     2015/08/05 10:35:09     /u01/BACKUPOCR/backup_20150805_103509.ocr

node02     2015/08/05 10:35:01     /u01/BACKUPOCR/backup_20150805_103501.ocr

node02     2015/08/05 10:34:14     /u01/BACKUPOCR/backup_20150805_103414.ocr


Command to take and show OCR backup

[root@node01 ohasd]# ocrconfig -manualbackup

node02     2015/08/25 20:25:03     /u01/BACKUPOCR/backup_20150825_202503.ocr

node02     2015/08/25 20:24:34     /u01/BACKUPOCR/backup_20150825_202434.ocr

node02     2015/08/25 20:22:40     /u01/BACKUPOCR/backup_20150825_202240.ocr

node02     2015/08/25 20:22:34     /u01/BACKUPOCR/backup_20150825_202234.ocr

node02     2015/08/25 20:22:00     /u01/BACKUPOCR/backup_20150825_202200.ocr


NOTE:- OCR backup always occur in Master node. Suppose I am taking manual OCR backup from Node01 but master node is node02 then it always create OCR backup file in Node02.


Changing BACKUP location of OCR file

To change backup location for both Auto and Manaul OCR FILE run the following command with  root user.

1. Create a new directory on all node with same directory structure. Must exists in all node.

[root@node01 u01]# mkdir -p /u01/OCR_BACKUP
[root@node01 u01]# ocrconfig -backuploc /u01/OCR_BACKUP
PROT-45: The specified Oracle Cluster Registry backup location /u01/OCR_BACKUP is inaccessible.
PROC-49: The specified Oracle Cluster Registry backup location is inaccessible on nodes node02.
[root@node01 u01]# ssh node02
root@node02's password:
Last login: Tue Aug 25 21:20:43 2015 from node01.example.com
[root@node02 ~]# mkdir -p /u01/OCR_BACKUP
[root@node02 ~]# exit
logout
Connection to node02 closed.

2. Change the Backup location

[root@node01 u01]# ocrconfig -backuploc /u01/OCR_BACKUP

3. Take Backup

 [root@node01 u01]# ocrconfig -manualbackup

node02     2015/08/25 21:26:38     /u01/OCR_BACKUP/backup_20150825_212638.ocr

node02     2015/08/25 20:25:03     /u01/BACKUPOCR/backup_20150825_202503.ocr

node02     2015/08/25 20:24:34     /u01/BACKUPOCR/backup_20150825_202434.ocr

node02     2015/08/25 20:22:40     /u01/BACKUPOCR/backup_20150825_202240.ocr

node02     2015/08/25 20:22:34     /u01/BACKUPOCR/backup_20150825_202234.ocr

4.  check new backup location.

[root@node01 u01]# ocrconfig -showbackup manual

node02     2015/08/25 21:26:38     /u01/OCR_BACKUP/backup_20150825_212638.ocr

node02     2015/08/25 20:25:03     /u01/BACKUPOCR/backup_20150825_202503.ocr

node02     2015/08/25 20:24:34     /u01/BACKUPOCR/backup_20150825_202434.ocr

node02     2015/08/25 20:22:40     /u01/BACKUPOCR/backup_20150825_202240.ocr

node02     2015/08/25 20:22:34     /u01/BACKUPOCR/backup_20150825_202234.ocr

OLR:-
=====
OCR is a file which is used to startup the CRS . it help in starting OHASD process.

NOTE:- Backup of OLR Backup occured occur on same node from which we are taking backup.

To check OLR LOCATION

[root@node01 ohasd]# ocrcheck -local
Status of Oracle Local Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2864
         Available space (kbytes) :     259256
         ID                       : 1057608504
         Device/File Name         : /u01/app/11.2.0/grid1/cdata/node01.olr
                                    Device/File integrity check succeeded

         Local registry integrity check succeeded

         Logical corruption check succeeded

To take  and check OLR file backup

[root@node01 ohasd]# ocrconfig -local -manualbackup

node01     2015/08/25 21:05:16     /u01/app/11.2.0/grid1/cdata/node01/backup_20150825_210516.olr

node01     2015/08/25 21:02:56     /u01/app/11.2.0/grid1/cdata/node01/backup_20150825_210256.olr

node01     2015/08/05 10:34:31     /u01/app/11.2.0/grid1/cdata/node01/backup_20150805_103431.olr

node01     2015/08/05 10:34:25     /u01/app/11.2.0/grid1/cdata/node01/backup_20150805_103425.olr

node01     2015/07/17 07:02:25     /u01/app/11.2.0/grid1/cdata/node01/backup_20150717_070225.olr
[root@node01 ohasd]# date
Tue Aug 25 21:05:21 IST 2015

To check the location of Backup (OLR).
[root@node01 ohasd]# ocrconfig -local -showbackup manual

node01     2015/08/25 21:05:16     /u01/app/11.2.0/grid1/cdata/node01/backup_20150825_210516.olr

node01     2015/08/25 21:02:56     /u01/app/11.2.0/grid1/cdata/node01/backup_20150825_210256.olr

node01     2015/08/05 10:34:31     /u01/app/11.2.0/grid1/cdata/node01/backup_20150805_103431.olr

node01     2015/08/05 10:34:25     /u01/app/11.2.0/grid1/cdata/node01/backup_20150805_103425.olr

node01     2015/07/17 07:02:25     /u01/app/11.2.0/grid1/cdata/node01/backup_20150717_070225.olr

CHANGING BACKUP LOCATION OF OLR FILE:-
Backup of OLR file is node specific . you can keep same or different backup directory architecture on both node.
[root@node01 u01]# mkdir -p /u01/OLR_BACKUP
[root@node01 u01]# ocrconfig -local -backuploc /u01/OLR_BACKUP/
[root@node01 u01]# ocrconfig -local -manualbackup

node01     2015/08/25 21:33:01     /u01/OLR_BACKUP/backup_20150825_213301.olr

node01     2015/08/25 21:05:16     /u01/app/11.2.0/grid1/cdata/node01/backup_20150825_210516.olr

node01     2015/08/25 21:02:56     /u01/app/11.2.0/grid1/cdata/node01/backup_20150825_210256.olr

node01     2015/08/05 10:34:31     /u01/app/11.2.0/grid1/cdata/node01/backup_20150805_103431.olr

node01     2015/08/05 10:34:25     /u01/app/11.2.0/grid1/cdata/node01/backup_20150805_103425.olr


[root@node01 u01]# ssh node02
root@node02's password:
Last login: Tue Aug 25 21:25:22 2015 from node01.example.com
[root@node02 ~]# mkdir -p /u01/OLR_BACKUP1
 [root@node02 ~]# . oraenv
ORACLE_SID = [root] ? +ASM2
The Oracle base has been set to /u01/app/grid
[root@node02 ~]# ocrconfig -local -backuploc /u01/OLR_BACKUP1/
[root@node02 ~]# ocrconfig -local -manualbackup


node02     2015/08/25 21:35:25     /u01/OLR_BACKUP1/backup_20150825_213525.olr

node02     2015/07/26 10:48:46     /u01/app/11.2.0/grid1/cdata/node02/backup_20150726_104846.olr


node02     2015/06/20 09:21:21     /u01/app/11.2.0/grid/cdata/node02/backup_20150620_092121.olr

No comments:

Post a Comment