ocr restore test

//rm the ocr file

[root@rac1 config]# rm -rf  ocr

[root@rac1 bin]# ./ocrcheck
PROT-602: Failed to retrieve data from the cluster registry

[root@rac1 bin]# ./crsctl stop crs
OCR initialization failed accessing OCR device: PROC-26: Error while accessing the physical storage Operating System error [No such file or directory] [2]

//the ocr is gone and the crs status is incorrect

//create a ocr file,as I use NFS as share storage,so just touch a ocr file

[root@rac1 bin]# touch /opt/app/config/ocr
//change the owner

chown root:oinstall /opt/app/config/ocr
use the physical backup to restore ocr

[root@rac1 bin]# ./ocrconfig -restore ../cdata/crs/backup00.ocr
start the crs
[root@rac1 bin]# ./crsctl start crs

//check the crs stack
[root@rac1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy

//maybe, u need toe crs_stat -all to pull up all the resource


[oracle@rac2 ~]$ crs_stat -t
Name Type Target State Host
ora.rac.db application ONLINE ONLINE rac1
ora….c1.inst application ONLINE ONLINE rac1
ora….c2.inst application ONLINE ONLINE rac2
ora….C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora….C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2



how to backup vote disk and ocr

vote disk could be backup by dd,you can following this:

check the information msg of vote disk

[oracle@rac1 ~]$ crsctl query css votedisk
0. 0 /opt/app/config/votingdisk

located 1 votedisk(s).

the vote disk is located in /opt/app/config/votingdisk

using dd to backup the vote disk:

[oracle@rac1 ~]$ dd if=/opt/app/config/votingdisk of=votediskBak
20000+0 records in
20000+0 records out

[oracle@rac1 ~]$ ll vot*
-rw-r–r– 1 oracle oinstall 10240000 Aug 20 14:38 votediskBak

it’s quite easy.

How about the OCR? following below:

//show the backup information of OCR

[oracle@rac1 ~]$ ocrconfig -showbackup

rac2 2012/08/20 14:39:02 /opt/app/crs/product/10.2.0/crs/cdata/crs

rac2 2012/08/20 10:38:58 /opt/app/crs/product/10.2.0/crs/cdata/crs

rac2 2012/08/20 06:38:55 /opt/app/crs/product/10.2.0/crs/cdata/crs

rac2 2012/08/18 18:38:16 /opt/app/crs/product/10.2.0/crs/cdata/crs

rac2 2012/08/07 06:05:05 /opt/app/crs/product/10.2.0/crs/cdata/crs

//you can see the backup history information

[oracle@rac1 crs]$ ls -lrt
total 29428
-rw-r–r– 1 root root 4292608 Aug 7 06:12 week.ocr
-rw-r–r– 1 root root 4292608 Aug 14 07:44 week_.ocr
-rw-r–r– 1 root root 4292608 Aug 18 18:46 day.ocr
-rw-r–r– 1 root root 4292608 Aug 19 18:46 day_.ocr
-rw-r–r– 1 root root 4292608 Aug 20 06:46 backup02.ocr
-rw-r–r– 1 root root 4292608 Aug 20 10:46 backup01.ocr
-rw-r–r– 1 root root 4292608 Aug 20 2012 backup00.ocr

// the ocr was backup automaticlly every four hours as the basic backup policy which is showing above

//you need to use root to export the ocr config message as following

[root@rac1 bin]# ./ocrconfig -export /home/oracle/ocrBak.exp

if the ocr was corrupted,you can import the config of backup files into the ocr.

export and import is the logical backup and restore method,ocrconfig provide the “restore” command,but the “restore” command can only restore from the “physical backup” which is the backup made by the automatic policy.



the group and owner infor of OCR,VOTEING DISK

oracle clusterware安装过程中,需要ocr、voting disk,其宿主、权限一直存在误区,例如:660,640,oracle:oinstall等等。

今天在看”2 Day + Real Application Clusters Guide”才发现如下的截图:

2个ocr应该是root:oinstall的宿主设置,mode值应当是640。3个voting disk宿主是oracle:oinstall,而mode值也是640。

sdg,sdh,sdi都是给ASM instance使用,宿主为通常理解的oracle:oinstall,mode值为660.



Modify the /etc/oratab file on each node in the cluster, adding in the
appropriate instance information.

Note: In a single-instance database, setti ng the last field of each entry
to N disables the automatic startup of a database when the server it
runs on is restarted. For an Oracle RAC database, these fields are set
to N because Oracle Clusterware starts the instances and processes,
not the dbstart utility.