Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Oracle RAC OCR and Voting Disk Backup and Make a OCR and Voting disk mirror location

ADDING OCR AND VOTING DISK MIRRORING IN ORACLE 10G
The Oracle Clusterware (CRS) includes two important components: The voting disk and the Oracle Cluster Registry (OCR). The voting disk is a file that manages information about
node membership and the OCR is a file that manages the Real application Cluster (RAC) database configuration information.
ORACLE 10G:
Backing Up Voting Disks
There is no need to backup voting disk every day, because the node membership information does not usually change.
Following is a guideline to backup voting disk.
• After installation
• After adding nodes to or deleting nodes from the cluster
• After performing voting disk add or delete operations
Backup of existing OCR and Voting Disk:
Oracle 10g
[root@dbsr34-node2 ~]# cd /u01/app/oracle/product/10.2.0/crs/bin
[root@dbsr34-node2 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 124320
Used space (kbytes) : 4588
Available space (kbytes) : 119732
ID : 986910621
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
[root@dbsr34-node2 bin]# ./ocrconfig -export /backup/ocrvot_bkp/ocr.dmp
[root@dbsr34-node2 bin]# ./crsctl query css votedisk
0. 0 /dev/raw/raw2
located 1 votedisk(s).
[root@dbsr34-node2 bin]# dd if=/dev/raw/raw2 of=/backup/ocrvot_bkp/voting.dmp
41419+0 records in
41419+0 records out
[root@dbsr34-node2 bin]#
Taking fdisk –l output of existing setup from Node1 & Node2 and save it in notepad for your information.
Added three disk partitions to both nodes
New Disks added are
#these are new disk allocated for ocr and vote
Disk /dev/sdj: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Disk /dev/sdj doesn’t contain a valid partition table
Disk /dev/sdk: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Disk /dev/sdk doesn’t contain a valid partition table
Disk /dev/sdl: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Disk /dev/sdl doesn’t contain a valid partition table
[root@dbsr34-node1 ~]#
Create partitions from above three
Making disk partitions
New disk name are
/dev/sdj
/dev/sdk
/dev/sdl
[root@dbsr34-node1 ~]# fdisk /dev/sdj
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1011, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1011, default 1011):
Using default value 1011
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@dbsr34-node1 ~]# fdisk /dev/sdk
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1011, default 1): w
First cylinder (1-1011, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1011, default 1011):
Using default value 1011
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@dbsr34-node1 ~]# fdisk /dev/sdl
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1011, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1011, default 1011):
Using default value 1011
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@dbsr34-node1 ~]#
Adding raw partitions to /etc/sysconfig/rawdevices file
/dev/raw/raw3 /dev/sdj1
/dev/raw/raw4 /dev/sdk1
/dev/raw/raw5 /dev/sdl1
Adding new raw partitions to rc.local files for permissions
chown oracle:oinstall /dev/raw/raw3
chown oracle:oinstall /dev/raw/raw4
chown oracle:oinstall /dev/raw/raw5
chmod 660 /dev/raw/raw3
chmod 660 /dev/raw/raw4
chmod 660 /dev/raw/raw5
Add ocr mirror raw partitions /dev/raw/raw3
[root@dbsr34-node1 bin]# ./ocrconfig -add /dev/raw/raw3
[root@dbsr34-node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 124320
Used space (kbytes) : 4588
Available space (kbytes) : 119732
ID : 986910621
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw3 ==>new addded OCR disk
Device/File integrity check succeeded
Cluster registry integrity check succeeded
Adding voting disk/Adding voting disk mirror raw partitions
Raw4 and raw5
[root@dbsr34-node1 bin]# ./crsctl add css votedisk /dev/raw/raw4 -force
Now formatting voting disk: /dev/raw/raw4
successful addition of votedisk /dev/raw/raw4.
[root@dbsr34-node1 bin]# ./crsctl add css votedisk /dev/raw/raw5 -force
Now formatting voting disk: /dev/raw/raw5
successful addition of votedisk /dev/raw/raw5.
[root@dbsr34-node1 bin]#
Now checking voting disk locations:
[root@dbsr34-node1 bin]# ./crsctl add css votedisk /dev/raw/raw5 -force
Now formatting voting disk: /dev/raw/raw5
successful addition of votedisk /dev/raw/raw5.
[root@dbsr34-node1 bin]# ./crsctl query css votedisk
0. 0 /dev/raw/raw2
1. 0 /dev/raw/raw4 ==>new addded Voting disk
2. 0 /dev/raw/raw5 ==>new addded Voting disk
located 3 votedisk(s).
[root@dbsr34-node1 bin]#
Confirming OCR Status
[root@dbsr34-node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 124320
Used space (kbytes) : 4596
Available space (kbytes) : 119724
ID : 986910621
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw3
Device/File integrity check succeeded
Cluster registry integrity check succeeded
[root@dbsr34-node2 bin]# ./crsctl query css votedisk
0. 0 /dev/raw/raw2
1. 0 /dev/raw/raw4
2. 0 /dev/raw/raw5
located 3 votedisk(s).
[root@dbsr34-node2 bin]#
Disks are successfully added

OCR Backup in Oracle 11gr2
[root@rac-node2 db2]# cd /u11/app/11.2.0/grid2/bin
[root@rac-node2 bin]# ./ocrconfig -export /u14/backup/db2/ocr.dmp
[root@rac-node2 bin]# ls -lrt /u14/backup/db2/
total 144
-rwxr-xr-x 1 oracle oinstall 102 Aug 16 05:27 rmansch.sh
-rwxr-xr-x 1 oracle oinstall 358 Aug 16 05:27 rmanokey.sh
-rwxr-xr-x 1 oracle oinstall 358 Aug 16 05:27 rman-backup-db-and-ctl-del-old.sh
-rwxr-xr-x 1 oracle oinstall 336 Aug 16 05:29 rman-backup-db-and-ctl.sh
-rw-r–r– 1 oracle oinstall 5991 Aug 16 05:44 rmanlog.Thu
-rw——- 1 root root 118723 Aug 24 05:26 ocr.dmp
[root@rac-node2 bin]# ./ocrconfig -manualbackup
rac-node2 2012/08/24 05:27:11 /u11/app/11.2.0/grid2/cdata/exdb-cluster/backup_20120824_052711.ocr
[root@rac-node2 bin]#
[root@rac-node2 bin]# ./ocrconfig -showbackup
rac-node2 2012/08/24 05:13:04 /u11/app/11.2.0/grid2/cdata/exdb-cluster/backup00.ocr
rac-node2 2012/08/24 01:13:03 /u11/app/11.2.0/grid2/cdata/exdb-cluster/backup01.ocr
rac-node2 2012/08/23 21:13:01 /u11/app/11.2.0/grid2/cdata/exdb-cluster/backup02.ocr
rac-node2 2012/08/23 05:12:59 /u11/app/11.2.0/grid2/cdata/exdb-cluster/day.ocr
rac-node2 2012/08/13 09:12:21 /u11/app/11.2.0/grid2/cdata/exdb-cluster/week.ocr
rac-node2 2012/08/24 05:27:11 /u11/app/11.2.0/grid2/cdata/exdb-cluster/backup_20120824_052711.ocr
[root@rac-node2 bin]# cp -r /u11/app/11.2.0/grid2/cdata/exdb-cluster/backup_20120824_052711.ocr /u14/backup/db2/.
[root@rac-node2 bin]#
[root@rac-node2 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3156
Available space (kbytes) : 258964
ID : 178013316
Device/File Name : +VOTING_GRP
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@rac-node2 bin]# ./crsctl query css votedisk
## STATE File Universal Id File Name Disk group
— —– —————– ——— ———
1. ONLINE 3c53ba17e7f04f3dbfa1e7b1f9398a2a (/dev/mapper/voting1p1) [VOTING_GRP]
2. ONLINE 7f63864613d34ff5bfafc132fe38fbd5 (/dev/mapper/voting2p1) [VOTING_GRP]
3. ONLINE ab7672a3c47e4f4bbff8c991abe8952e (/dev/mapper/voting3p1) [VOTING_GRP]
Located 3 voting disk(s).
[root@rac-node2 bin]#
Fortunately, in 11g R2 the Voting disk contents are now backed up automatically in OCR; therefore, you are no longer required to back up the Voting disk manually.
Adding OCR and Voting disk mirror in Oracle 11gr2

./ocrconfig –add +OCRVOTE
To place a redundant copy for OCR on an ASM diskgroup, use the following
command. Ensure the diskgroup is created with the COMPATIBLE.ASM attribute and
That the value is set to 11.2 and mounted on all ASM instances of the cluster.

./ocrconfig –add +OCRVOTE
To add a redundant copy of a Voting disk file on a shared storage location, use the
following command as root user. However, you cannot add a redundant copy of a
Voting disk when it is placed on the ASM storage.

./$ORA_GRID_HOME/bin/crsctl add css votedisk /dev/sdg1 — new_location_path

References
OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE) [ID 428681.1]

Comments

Popular posts from this blog

PostgreSQL Pgbadger Installation On Linux

PostgreSQL pgBadger

How to configure Replication Manager (repmgr) ?

Migrating From Oracle to PostgreSQL using ora2pg open source tools

7 Steps to configure BDR replication in postgresql