客户环境由于存储异常,导致rac挂掉.存储更换盘后需要恢复rac
- 恢复ocr-存在备份情况
- 恢复ocr-无备份情况
使用ocrconfig查看
# ./ocrconfig -showbackup
没有结果那就去目录下直接看
# cd /oracle/product/10.2.0/crs_1/cdata/crs # ls -l total 66976 -rw-r--r-- 1 root system 4898816 Aug 31 06:12 backup00.ocr -rw-r--r-- 1 root system 4898816 Aug 31 02:12 backup01.ocr -rw-r--r-- 1 root system 4898816 Aug 30 22:12 backup02.ocr -rw-r--r-- 1 root system 4898816 Aug 30 02:12 day.ocr -rw-r--r-- 1 root system 4898816 Aug 31 02:12 day_.ocr -rw-r--r-- 1 root system 4898816 Aug 21 02:12 week.ocr -rw-r--r-- 1 root system 4898816 Aug 28 02:12 week_.ocr |
修改下权限
# chown oracle:oinstall /dev/rhdisk2 # chown oracle:oinstall /dev/rhdisk3 # chown oracle:oinstall /dev/rhdisk4 # chown oracle:oinstall /dev/rhdisk5 # chown oracle:oinstall /dev/rhdisk6 # chown oracle:oinstall /dev/rhdisk7 # # # # # chmod 660 /dev/rhdisk2 # chmod 660 /dev/rhdisk3 # chmod 660 /dev/rhdisk4 # chmod 660 /dev/rhdisk5 # chmod 660 /dev/rhdisk6 # chmod 660 /dev/rhdisk7 |
ocrconfig恢复
# /oracle/product/10.2.0/crs_1/bin/ocrconfig -restore /oracle/product/10.2.0/crs_1/cdata/crs/backup00.ocr # cd /oracle/product/10.2.0/crs_1/bin/ # ./ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 511764 Used space (kbytes) : 4620 Available space (kbytes) : 507144 ID : 517522761 Device/File Name : /dev/rhdisk2 Device/File integrity check succeeded Device/File Name : /dev/rhdisk3 Device/File integrity check succeeded Cluster registry integrity check succeeded # /oracle/product/10.2.0/crs_1/bin/crsctl query css votedisk 0. 0 /dev/rhdisk4 1. 0 /dev/rhdisk5 2. 0 /dev/rhdisk6 located 3 votedisk(s). # /oracle/product/10.2.0/crs_1/bin/crsctl start crs Attempting to start CRS stack The CRS stack will be started shortly |
$ crs_stat -t -v Name Type R/RA F/FT Target State Host ---------------------------------------------------------------------- ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1 ora....V1.lsnr application 0/5 0/0 ONLINE ONLINE rac1 ora....rv1.gsd application 0/5 0/0 ONLINE ONLINE rac1 ora....rv1.ons application 0/3 0/0 ONLINE ONLINE rac1 ora....rv1.vip application 0/0 0/0 ONLINE ONLINE rac1 ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2 ora....V2.lsnr application 0/5 0/0 ONLINE ONLINE rac2 ora....rv2.gsd application 0/5 0/0 ONLINE ONLINE rac2 ora....rv2.ons application 0/3 0/0 ONLINE ONLINE rac2 ora....rv2.vip application 0/0 0/0 ONLINE ONLINE rac2 ora.orcl.db application 0/0 0/1 ONLINE OFFLINE ora....l1.inst application 0/5 0/0 ONLINE OFFLINE ora....l2.inst application 0/5 0/0 ONLINE OFFLINE ora....orcl.cs application 0/0 0/1 ONLINE OFFLINE ora....cl1.srv application 0/0 0/0 ONLINE OFFLINE ora....cl2.srv application 0/0 0/0 ONLINE OFFLINE |
Execute
Execute
Execute
具体参考mos
How to Recreate OCR/Voting Disk Accidentally Deleted (Doc ID 399482.1)
但是这样涉及还是恢复原有的磁盘上,如果要恢复新的磁盘(源磁盘标识符和以前不一样)需要修改/etc/oracle/ocr.loc和
paramfile.crs:CRS_OCR_LOCATIONS=/dev/rhdisk2,/dev/rhdisk3
paramfile.crs:CRS_VOTING_DISKS=/dev/rhdisk4,/dev/rhdisk5,/dev/rhdisk6