Tuesday, April 15, 2008

Move/Replace/Change Location of OCR & Voting Disk

How To Change the location of OCR & Voting Disk in 10gR2 Oracle RAC

Voting Disk:
1.) Login as root
2.) Shutdown CRS on all nodes:

root@oracle-server:/home/crs/bin[bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
root@oracle-server:/home/crs/bin[bin]# ./crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM

3.) Check the the location of the voting disk:

root@oracle-server:/home/crs/bin[bin]# ./crsctl query css votedisk
0. 0 /mnt/db_crs/vd1
1. 0 /mnt/db_crs/vd2
2. 0 /mnt/db_crs/vd3

4.) Copy the voting disk to the new location:
root@oracle-server:/home/crs/bin[bin]# cp /mnt/db_crs/vd2 /mnt/db_crs_mirror1/
root@oracle-server:/home/crs/bin[bin]# cp /mnt/db_crs/vd3 /mnt/db_crs_mirror2/

5.) Change the location in CRS:

root@oracle-server:/home/crs/bin[bin]# ./crsctl add css votedisk /mnt/db_crs_mirror1/vd2
Now formatting voting disk: /mnt/db_crs_mirror1/vd2
successful addition of votedisk /mnt/db_crs_mirror1/vd2.
root@oracle-server:/home/crs/bin[bin]# ./crsctl add css votedisk /mnt/db_crs_mirror2/vd3
Now formatting voting disk: /mnt/db_crs_mirror2/vd3
successful addition of votedisk /mnt/db_crs_mirror2/vd3.

6.) Delete the old Voting Disks:

root@oracle-server:/home/crs/bin[bin]# crsctl delete css votedisk /mnt/db_crs/vd2 -force
successful deletion of votedisk /mnt/db_crs/vd2.
root@oracle-server:/home/crs/bin[bin]# crsctl delete css votedisk /mnt/db_crs/vd3 -force
successful deletion of votedisk /mnt/db_crs/vd3.

7.) Query CRS to see if the changes where proper:

root@oracle-server:/home/crs/bin[bin]# ./crsctl query css votedisk
0. 0 /mnt/db_crs/vd1
1. 0 /mnt/db_crs_mirror2/vd3
2. 0 /mnt/db_crs_mirror1/vd2

PS: The permission to the voting disk should be root:dba, while copying and creating voting disk as we are using the root user, the permission will change to root:root, which will give error when starting crs.

OCR:

1.) Login as root.

2.) Start CRS on all nodes:

root@oracle-server:/home/crs/bin[bin]# ./crsctl start crs

Attempting to start CRS stack

The CRS stack will be started shortly

root@oracle-server:/home/crs/bin[bin]# ./crsctl check crs

Failure 1 contacting CSS daemon

Cannot communicate with CRS

Cannot communicate with EVM

root@oracle-server:/home/crs/bin[bin]# ./crsctl check crs

CSS appears healthy

CRS appears healthy

EVM appears healthy

3.) Check OCR configuration/backups:

root@oracle-server:/home/crs/bin[bin]# ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 2

Total space (kbytes) : 262144

Used space (kbytes) : 2812

Available space (kbytes) : 259332

ID : 429958626

Device/File Name : /mnt/db_crs/crs

Device/File integrity check succeeded

Device/File Name : /mnt/db_crs/crs_mirror

Device/File integrity check succeeded

Cluster registry integrity check succeeded

root@oracle-server:/home/crs/bin[bin]# ocrconfig -showbackup

oracle-server 2008/04/10 23:47:02 /oracle/product/10.2.0/crs/cdata/ac4-db-crs

oracle-server 2008/04/10 19:47:03 /oracle/product/10.2.0/crs/cdata/ac4-db-crs

oracle-server 2008/04/10 15:47:04 /oracle/product/10.2.0/crs/cdata/ac4-db-crs

oracle-server 2008/04/08 19:47:17 /oracle/product/10.2.0/crs/cdata/ac4-db-crs

oracle-server 2008/04/03 15:47:53 /oracle/product/10.2.0/crs/cdata/ac4-db-crs

4.) Copy the OCR mirror to the new location:

root@oracle-server:/mnt/prdaudit_crs[root@oracle-server db_crs]# ls -rlt

mtotal 38916

-rw-r--r-- 1 oracle dba 10240000 Apr 11 02:27 vd2.old

-rw-r--r-- 1 oracle dba 10240000 Apr 11 02:27 vd3.old

-rw-r----- 1 root dba 3121152 Apr 11 02:59 crs_mirror

-rw-r----- 1 root dba 3121152 Apr 11 03:22 crs

-rw-r--r-- 1 oracle dba 10240000 Apr 11 03:23 vd1

root@oracle-server:/mnt/db_crs[root@oracle-server db_crs]# cp crs_mirror /mnt/db_crs_mirror1

Check the permission, it should be root:dba

5.) Change the OCR location in the CRS:

root@oracle-server:/home/crs/bin[bin]# ./ocrconfig -replace ocrmirror /mnt/db_crs_mirror1/crs_mirror

Same way to can move the ocr:

oraconfig -replace ocr

root@oracle-server:/home/crs/bin[bin]# ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 2

Total space (kbytes) : 262144

Used space (kbytes) : 2812

Available space (kbytes) : 259332

ID : 429958626

Device/File Name : /mnt/db_crs/crs

Device/File integrity check succeeded

Device/File Name : /mnt/db_crs_mirror1/crs_mirror

Device/File integrity check succeeded

Cluster registry integrity check succeeded

root@oracle-server:/home/crs/bin[bin]# exit

OCR AND VOTING DISK MOVED!!!!

2 Comments:

Anonymous said...

do we need to copy the voting disk to the new location before we move it

Oracle documentation doesnt say it

Anonymous said...

should we bring the OCR down, for 10.2.0.3 is it necessary, can we use the same commands for moving OCR when it is up?

I know we have to for sure for Voting disk because of an oracle bug