Oracle RAC rebuilding OCR, Votedisk, and racvotedisk
Haha, I just mentioned the last article. I was bored and started another test.
Environment:
OS: redhat 5.8
DB: Oracle 10.2.0.5 raw device
We need to develop the habit of backing up ocr and votedisk frequently. However, ocr and votedisk can be rebuilt without backup. It is like a control file. However, the process is troublesome. The procedure is as follows:
First back up ocr and votedisk:
[root@rac1 ~]#[root@rac1 ~]# ocrcheckStatus of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 1048296 Used space (kbytes) : 3292 Available space (kbytes) : 1045004 ID : 1891074113 Device/File Name : /dev/raw/raw1 Device/File integrity check succeeded Device/File Name : /dev/raw/raw2 Device/File integrity check succeeded Cluster registry integrity check succeeded[root@rac1 ~]# crsctl qeury css votediskUnknown parameter: qeury[root@rac1 ~]# crsctl query css votedisk0. 0 /dev/raw/raw31. 0 /dev/raw/raw42. 0 /dev/raw/raw5[root@rac1 ~]# dd if=/dev/raw/raw3 of=/opt/votedisk.bak2097152+0 records in2097152+0 records out1073741824 bytes (1.1 GB) copied, 462.285 seconds, 2.3 MB/s[root@rac1 ~]# ocrconfig -export /opt/ocr.bak[root@rac1 ~]# cd /opt/[root@rac1 opt]# lsocr.bak ORCLfmap votedisk.bak
Delete Configuration:
[Root @ rac1 install] #. /rootdelete. shShutting down Oracle Cluster Ready Services (CRS): Stopping resources. this cocould take several minutes. error while stopping resources. possible cause: CRSD is down. shutdown has begun. the daemons shoshould exit soon. checking to see if Oracle CRS stack is down... oracle CRS stack is not running. oracle CRS stack is down now. removing script for Oracle Cluster Ready servicesUpdating ocr file for downgradeCleaning up SCR settings in '/etc/oracle/scls_scr' Cleaning up Network socket directories [root @ rac2 install] #. /rootdelete. shShutting down Oracle Cluster Ready Services (CRS): Stopping resources. this cocould take several minutes. error while stopping resources. possible cause: CRSD is down. shutdown has begun. the daemons shoshould exit soon. checking to see if Oracle CRS stack is down... oracle CRS stack is not running. oracle CRS stack is down now. removing script for Oracle Cluster Ready servicesUpdating ocr file for downgradeCleaning up SCR settings in '/etc/oracle/scls_scr' Cleaning up Network socket directories: [root @ rac1 install] #. /rootdeinstall. shRemoving contents from OCR mirror device2560 + 0 records in2560 + 0 records out10485760 bytes (10 MB) copied, 0.521651 seconds, 20.1 MB/sRemoving contents from OCR device2560 + 0 records in2560 + 0 records out10485760 bytes (10 MB) copied, 0.496207 seconds, 21.1 MB/s
Re-run the root script:
[root@rac1 crs]# ./root.shWARNING: directory '/u01/app/oracle' is not owned by rootWARNING: directory '/u01/app' is not owned by rootWARNING: directory '/u01' is not owned by rootNo value set for the CRS parameter CRS_OCR_LOCATIONS. Using Values in paramfile.crsChecking to see if Oracle CRS stack is already configuredSetting the permissions on OCR backup directorySetting up NS directoriesOracle Cluster Registry configuration upgraded successfullyWARNING: directory '/u01/app/oracle' is not owned by rootWARNING: directory '/u01/app' is not owned by rootWARNING: directory '/u01' is not owned by rootSuccessfully accumulated necessary OCR keys.Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.node <nodenumber>: <nodename> <private interconnect name>
Configure VIP
[Root @ rac2 crs] # oifcfg getif [root @ rac2 crs] # oifcfg iflisteth0 192.168.56.0eth1 192.168.11.0 [root @ rac2 crs] # oifcfg setif-global eth0/192.168.56.0: public [root @ rac2 crs] # oifcfg setif-global eht1/192.168.11.0: cluster_interconnect [root @ rac2 crs] # oifcfg getifeth0 192.168.56.0 global publiceht1 192.168.11.0 global cluster_interconnect run vipca to configure VIP
View results:
[root@rac1 crs]# crs_stat -tName Type Target State Host ------------------------------------------------------------ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora.rac2.gsd application ONLINE ONLINE rac2 ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip application ONLINE ONLINE rac2
Configuration listening:
[Root @ rac1 admin] # mv listener. ora listener. ora. bak
[Root @ rac2 admin] # mv listener. ora listener. ora. bak
Use netca to create a listener
[root@rac1 admin]# crs_stat -tName Type Target State Host ------------------------------------------------------------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
Add the database to CRS:
[Oracle @ rac1 ~] $ Srvctl add database-d zhdb-o $ ORACLE_HOME
Start the database:
Srvctl start database-d zhdb
[oracle@rac1 dbs]$ crs_stat -tName Type Target State Host ------------------------------------------------------------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 ora.zhdb.db application ONLINE ONLINE rac1 ora....b2.inst application ONLINE ONLINE rac2
The OCR and Votedisk have been rebuilt since then.