Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Monday, December 06, 2010

Voting Disk and OCR Files Backup (Win 10gR2)

Voting Disk:
The voting disk is nothing but a file that contains and manages information of all the node memberships. Oracle RAC uses the voting disk to determine which instances are members of a cluster. The voting disk must reside on shared disk. For high availability, Oracle recommends that you have multiple voting disks. The Oracle Clusterware enables multiple voting disks but you must have an odd number of voting disks, such as three, five, and so on. If you define a single voting disk, then you should use external mirroring to provide redundancy.
I've windows environment for my RAC so I will not be using dd instead I'll use Oracle supplied utility ocopy
-- where Vote Disk is available
D:\oracle\product\10.2.0\crs\BIN>crsctl query css votedisk
 0.     0    \\.\votedsk1

located 1 votedisk(s).

Back it up
D:\oracle\product\10.2.0\crs\BIN>ocopy \\.\\votedsk1 D:\Home_Backup\VOTEnOCR
D:\HOME_BACKUP\VOTENOCR\\\.\VOTEDSK1

Note: If you have multiplexed your voting disk locations then make sure to back up EACH of these!

--Info in Vote file
D:\oracle\product\10.2.0\crs\BIN>olsnodes -n -v
prlslms: Initializing LXL global
prlsndmain: Initializing CLSS context
prlsmemberlist: No of cluster members configured = 256
prlsmemberlist: Getting information for nodenum = 1
prlsmemberlist: node_name = db1
prlsmemberlist: ctx->lsdata->node_num = 1
prls_printdata: Printing the node data
db1    1
prlsmemberlist: Getting information for nodenum = 2
prlsmemberlist: node_name = db2
prlsmemberlist: ctx->lsdata->node_num = 2
prls_printdata: Printing the node data
db2    2
prlsndmain: olsnodes executed successfully
prlsndterm: Terminating LSF

Changes in 11gR2
There some changes in the way we handle now the important Clusterware components Voting Disk and Oracle Cluster Registry (OCR): Amazingly, we can now store the two inside of an Automatic Storage Management (ASM) Disk Group, which was not possible in 10g.

The Voting Disk (or Voting File, as it is now also referred to) is not striped but put as a whole on ASM Disks – if we use a redundancy of normal on the Diskgroup, 3 Voting Files are placed, each on one ASM Disk. This is a concern, if our ASM Diskgroups consist of only 2 ASM Disks! Therefore, the new quorum failgroup clause was introduced:

create diskgroup data normal redundancy
 failgroup fg1 disk 'ORCL:ASMDISK1'
 failgroup fg2 disk 'ORCL:ASMDISK2'
 quorum failgroup fg3 disk 'ORCL:ASMDISK3'
 attribute 'compatible.asm' = '11.2.0.0.0';

The failgroup fg3 above needs only one small Disk (300 MB should be on the safe side here, since the Voting File is only about 280 MB in size) to keep one Mirror of the Voting File. fg1 and fg2 will contain each one Voting File and all the other stripes of the Database Area as well, but fg3 will only get that one Voting File.
[root@uhesse1 ~]#  /u01/app/11.2.0/grid/bin/crsctl query css votedisk ##  STATE    File Universal Id                File Name Disk group --  -----    -----------------                --------- --------- 1. ONLINE   511de6e64e354f9bbf4be318fc928c28 (ORCL:ASMDISK1) [DATA] 2. ONLINE   2f1973ed4be84f50bffc2475949b428f (ORCL:ASMDISK2) [DATA] 3. ONLINE   5ed44fb7e79c4f79bfaf09b402ba70df (ORCL:ASMDISK3) [DATA]
 

Another important change regarding the Voting File is that it is no longer supported to take a manual backup of it with dd or ocopy. Instead, the Voting File gets backed up automatically into the OCR
OCR
OCR is a file that manages the cluster and RAC configuration. OCR contains information pertaining to instance-to-node mapping, node list and resource profiles for customized applications in your Clusterware.

Oracle Clusterware automatically creates OCR backups every four hours and it always retains the last three backup copies of the OCR.   The CRSD process that creates the backups also creates and retains an OCR backup for each full day and then at the end of a week a complete backup for the week. So there is a robust backup taking place in the background. And you guessed it right; you cannot alter the backup frequencies. This is meant to protect you, the DBA, so that you can copy these generated backup files at least once daily to a different device from where the primary OCR resides. These files are located at %CRS_home/cdata/my_cluster.

OCR Location:
D:\oracle\product\10.2.0\crs\BIN>ocrconfig -showbackup

db1     2010/12/06 09:19:48     D:\oracle\product\10.2.0\crs\cdata\crs
db1     2010/12/06 05:19:48     D:\oracle\product\10.2.0\crs\cdata\crs
db1     2010/12/06 01:19:48     D:\oracle\product\10.2.0\crs\cdata\crs
db1     2010/12/05 01:19:48     D:\oracle\product\10.2.0\crs\cdata\crs
db1     2010/11/25 01:19:45     D:\oracle\product\10.2.0\crs\cdata\crs


Create a batch file to copy to some safe location (10gR2):
VOTEnOCRBackup.bat
#Backup the voting disk to .81
ocopy \\.\votedsk1 \\192.168.12.81\additional_backups\databases\homerac\VOTEnOCRBackup\votingdisk
#Backup OCR .81
xcopy D:\oracle\product\10.2.0\crs\cdata\*.* \\192.168.12.81\additional_backups\databases\homerac\VOTEnOCRBackup\ocr /s/e
 OR
D:\oracle\product\10.2.0\crs\BIN>ocopy \\.\ocrcfg \\192.168.12.81\additional_backups\databases\homerac\VOTEnOCRBackup

\\192.168.12.81\ADDITIONAL_BACKUPS\DATABASES\HOMERAC\VOTENOCRBACKUP\\\.\OCRCFG

--Dumping info in OCR
D:\oracle\product\10.2.0\crs\BIN>ocrdump D:\Home_Backup\VOTEnOCR\ocrinfo
Check ocrinfo by text editor
D:\oracle\product\10.2.0\crs\BIN>ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     128276
         Used space (kbytes)      :       3852
         Available space (kbytes) :     124424
         ID                       :  798127722
         Device/File Name         : \\.\ocrcfg
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded

Export OCR
D:\oracle\product\10.2.0\crs\BIN>ocrconfig -export ocr.backup


Changes in 11gR2
You can now do a manual backup of the OCR any time you like, without having to wait until that is done automatically – which is also still done:

D:\app\11.2.0.3\grid\BIN>ocrconfig -manualbackup

or-11     2012/10/01 10:50:44     D:\app\11.2.0.3\grid\cdata\homecrs\backup_20121001_105044.ocr
Manual backup location
D:\app\11.2.0.3\grid\BIN>ocrconfig -backuploc D:\Home_Backup\ocr_voting
PROT-45: The specified Oracle Cluster Registry backup location D:\Home_Backup\ocr_voting is inaccessible.
PROC-49: The specified Oracle Cluster Registry backup location is inaccessible on nodes or-12.


you need to have the same folder on all the nodes for the backup location you specify in the ocrconfig command and then take the backup

D:\app\11.2.0.3\grid\BIN>ocrconfig -backuploc D:\Home_Backup\ocr_voting


The OLR
In Oracle Clusterware 11g Release 2 an additional component related to the OCR called the Oracle Local Registry (OLR) is installed on each node in the cluster. The OLR is a local registry for node specific resources and is used by cluster and non-cluster Oracle processes. One use of the OLR is to store the location of the of the voting disk. This information is used when the node is being started and attempts to join the cluster. The OLR file is located in the grid_home/cdata/.olr . You can view the status of the OLR file on each node by using the ocrcheck command with the –local parameter as seen here:
D:\app\11.2.0.3\grid\BIN>Ocrcheck -local -config
Oracle Local Registry configuration is :
         Device/File Name         : D:\app\11.2.0.3\grid\cdata\or-11.olr
You can also use the ocrdump to see the contents

D:\app\11.2.0.3\grid\BIN>Ocrdump -local -stdout
Note: Oracle Clusterware can access the OCR and the voting disks present in ASM even if the ASM instance is down. As a result CSS can continue to maintain the Oracle cluster even if the ASM instance has failed.

No comments: