修复OCR和VOTING

ora.cssd 起不来一般是voting disk数量不够,或者voting disk盘头损坏
ora.crsd 起不来一般是集群的配置信息损坏,ocr损坏

1.使用ocrconfig -showbackup确认ocr备份信息

#/opt/grid/products/12.1.0/bin/ocrconfig -showbackup
rac2     2015/08/16 05:41:40     /opt/grid/products/12.1.0/cdata/rac-cluster/backup00.ocr     0
rac2     2015/08/16 01:41:40     /opt/grid/products/12.1.0/cdata/rac-cluster/backup01.ocr     0
rac2     2015/08/15 21:41:39     /opt/grid/products/12.1.0/cdata/rac-cluster/backup02.ocr     0
rac2     2015/08/15 05:41:37     /opt/grid/products/12.1.0/cdata/rac-cluster/day.ocr     0
rac1     2015/08/03 18:36:46     /opt/grid/products/12.1.0/cdata/rac-cluster/week.ocr     0
PROT-25: Manual backups for the Oracle Cluster Registry are not available

2.停掉所有节点集群

crsctl stop crs -f

如果停不掉:
ps -elf | egrep "PID|d.bin|ohas|oraagent|orarootagent|cssdagent|cssdmonitor" | grep -v grep
ps -elf | egrep "d.bin|ohas|oraagent|orarootagent|cssdagent|cssdmonitor" | grep -v grep |awk '{print $4}' |xargs -n 10  kill -9

3.独占模式启动crs
crsctl start crs -excl -nocrs
会启动ASM实例,如果磁盘组都良好,也会挂载ASM DG
-excl 表示用独占模式启动CRS,不需要OCR和Voting disk。
-nocrs 表示不启动crsd.bin

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     16384    10489                0           10489              0             N  DG_DATA/

crsctl query css votedisk
Located 0 voting disk(s).

没有voting盘也可以起得来

crsctl stat res -t -init
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details      
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.asm
      1        ONLINE  ONLINE       qc1                      Started,STABLE
ora.cluster_interconnect.haip
      1        ONLINE  ONLINE       qc1                      STABLE
ora.crf
      1        OFFLINE OFFLINE                               STABLE
ora.crsd
      1        OFFLINE OFFLINE                               STABLE
ora.cssd
      1        ONLINE  ONLINE       qc1                      STABLE
ora.cssdmonitor
      1        ONLINE  ONLINE       qc1                      STABLE
ora.ctssd
      1        ONLINE  ONLINE       qc1                      ACTIVE:0,STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.drivers.acfs
      1        ONLINE  ONLINE       qc1                      STABLE
ora.evmd
      1        ONLINE  INTERMEDIATE qc1                      STABLE
ora.gipcd
      1        ONLINE  ONLINE       qc1                      STABLE
ora.gpnpd
      1        ONLINE  ONLINE       qc1                      STABLE
ora.mdnsd
      1        ONLINE  ONLINE       qc1                      STABLE
ora.storage
      1        OFFLINE OFFLINE                               STABLE
--------------------------------------------------------------------------------



CREATE DISKGROUP ocrtest normal REDUNDANCY
  failgroup ocr1 disk
  '/dev/asm-diskb'
  failgroup ocr2 disk
  '/dev/asm-diskc'
  failgroup ocr3 disk
  '/dev/asm-diskd'
  attribute
  'au_size'='1M',
            'compatible.asm' = '12.1',
            'compatible.rdbms' = '12.1';

Diskgroup created.



4.先修复ocr再修复voting disk


#ocrconfig -restore  /opt/grid/products/11.2.0/cdata/qdata/backup_20150527_130321.ocr
cluvfy comp ocr -n all
ocrcheck


-----12C没有这个异常
#crsctl replace votedisk +ocrvote
CRS-4602: Failed 27 to add voting file 5a71f4b0868e4f8abfc4808566c5c7fa.
CRS-4602: Failed 27 to add voting file 66699f04c8a74f57bf08e0682294e449.
CRS-4602: Failed 27 to add voting file 7181a4d009884fecbff2cab4c69f2de2.
Failed to replace voting disk group with +ocrvote.
CRS-4000: Command Replace failed, or completed with errors.

SQL> show parameter disk

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
asm_diskgroups                       string
OCRVOTE
asm_diskstring                       string

SQL> alter system set asm_diskstring='/dev/qdata/*';

SQL> create spfile from memory;
System altered.

#crsctl replace votedisk +ocrvote
Successful addition of voting disk 05e07048c0b14f8dbffd4e78783dbd67.
Successful addition of voting disk b15b269bbdec4f61bf9843f707d37882.
Successful addition of voting disk 35b632b097584f09bff462e4b9340ea7.
Successfully replaced voting disk group with +ocrvote.
CRS-4266: Voting file(s) successfully replaced

crsctl query css votedisk

5.关闭crs
crsctl stop crs -f

6.正常模式启动集群,每个节点执行
crsctl start crs


至此完事




手工备份ocr
ocrconfig -export /tmp/ocr.bak
ocrconfig -import file_name
 
ohasd
#vi /etc/init/oracle-ohasd.conf
# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
#
# Oracle OHASD startup

start on runlevel [35]
stop  on runlevel [!35]
respawn
exec /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null



Oracle集群每4个小时自动备份一次。在任一时刻,Oracle集群总会保存3份备份文件。他们分别是最近4小时,最近1天和最近1周的备份文件。

#ocrconfig -showbackup
rac2     2015/08/16 05:41:40     /opt/grid/products/12.1.0/cdata/rac-cluster/backup00.ocr     0
rac2     2015/08/16 01:41:40     /opt/grid/products/12.1.0/cdata/rac-cluster/backup01.ocr     0
rac2     2015/08/15 21:41:39     /opt/grid/products/12.1.0/cdata/rac-cluster/backup02.ocr     0
rac2     2015/08/15 05:41:37     /opt/grid/products/12.1.0/cdata/rac-cluster/day.ocr     0
rac1     2015/08/03 18:36:46     /opt/grid/products/12.1.0/cdata/rac-cluster/week.ocr     0
PROT-25: Manual backups for the Oracle Cluster Registry are not available


[ root@qc1 ~]# kfed read /dev/asm-diskb | grep -E 'vfstart|vfend'
kfdhdb.vfstart:                     192 ; 0x0ec: 0x000000c0
kfdhdb.vfend:                       224 ; 0x0f0: 0x000000e0
[ root@qc1 ~]# kfed read /dev/asm-diskc | grep -E 'vfstart|vfend'
kfdhdb.vfstart:                     192 ; 0x0ec: 0x000000c0
kfdhdb.vfend:                       224 ; 0x0f0: 0x000000e0
[ root@qc1 ~]# kfed read /dev/asm-diskd | grep -E 'vfstart|vfend'
kfdhdb.vfstart:                     192 ; 0x0ec: 0x000000c0
kfdhdb.vfend:                       224 ; 0x0f0: 0x000000e0
[ root@qc1 ~]# kfed read /dev/asm-diske | grep -E 'vfstart|vfend'
kfdhdb.vfstart:                       0 ; 0x0ec: 0x00000000
kfdhdb.vfend:                         0 ; 0x0f0: 0x00000000

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22034023/viewspace-1784147/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22034023/viewspace-1784147/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值