Oracle 11gR2 RAC恢复OCR和VOTE DISK

原文链接:

http://www.askmaclean.com/archives/11-2-lost-ocr-votedisk-group-recovery.html

之前有同学在我的Oracle Allstarts群里讨论关于丢失包含ocr和votedisk的ASM diskgroup导致11gR2 RAC cluster无法正常启动的问题,最早我在《在11gR2 RAC中修改ASM DISK Path磁盘路径》一文中介绍了,如何在不启动CRS的情况下启动11.2中的ASM实例并实施操作, 这里也需要用到同样的命令”crsctl start crs -excl -nocrs “;

注意以下的恢复手段,针对ASM中单独的ocr或者单独的votedisk丢失也有效,因为11.2中普遍把ocr和votedisk存放在ASM中,而ASM的启动又依赖于ocr和votedisk,所以在丢失ocr或votedisk仍一一者都会导致cluter无法正常启动;这里我们仅仅讨论如何让CRS正常启动,如果丢失的diskgroup中还存放有数据库的话,数据的恢复不属于本篇文章的讨论范畴。

前提:恢复的前提是你仍有和故障前一样多的ASM LUN DISK,且你有OCR的自动备份,注意默认情况下每4个小时会自动备份一次,只要你没有删除$GI_HOME,一般都会有备份可用;不要求有votedisk备份

恢复场景: 利用dd命令清空ocr和votedisk所在diskgroup header,模拟diskgroup corruption:

1. 检查votedisk和 ocr备份

[root@vrh1 ~]# crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group
—  ——    ————————                ———— ———
1. ONLINE   a853d6204bbc4feabfd8c73d4c3b3001 (/dev/asm-diskh) [SYSTEMDG]2. ONLINE   a5b37704c3574f0fbf21d1d9f58c4a6b (/dev/asm-diskg) [SYSTEMDG]3. ONLINE   36e5c51ff0294fc3bf2a042266650331 (/dev/asm-diski) [SYSTEMDG]4. ONLINE   af337d1512824fe4bf6ad45283517aaa (/dev/asm-diskj) [SYSTEMDG]5. ONLINE   3c4a349e2e304ff6bf64b2b1c9d9cf5d (/dev/asm-diskk) [SYSTEMDG]
Located 5 voting disk(s).

[grid@vrh1 ~]$ ocrconfig -showbackup

PROT-26: Oracle Cluster Registry backup locations were retrieved from a local copy
vrh1     2012/08/09 01:59:56     /g01/11.2.0/maclean/grid/cdata/vrh-cluster/backup00.ocr
vrh1     2012/08/08 21:59:56     /g01/11.2.0/maclean/grid/cdata/vrh-cluster/backup01.ocr
vrh1     2012/08/08 17:59:55     /g01/11.2.0/maclean/grid/cdata/vrh-cluster/backup02.ocr
vrh1     2012/08/08 05:59:54     /g01/11.2.0/grid/cdata/vrh-cluster/day.ocr
vrh1     2012/08/08 05:59:54     /g01/11.2.0/grid/cdata/vrh-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available

2. 彻底关闭所有节点上的clusterware ,OHASD 

[root@vrh1 ~]$crsctl stop has -f

3. 请养成良好的习惯,做危险操作前备份asm header

4. 使用dd 命令 破坏ocr和votedisk所在diskgroup

[root@vrh1 ~]# dd if=/dev/zero of=/dev/asm-diskh bs=1024k count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00423853 seconds, 247 MB/s[root@vrh1 ~]# dd if=/dev/zero of=/dev/asm-diskg bs=1024k count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0045179 seconds, 232 MB/s[root@vrh1 ~]# dd if=/dev/zero of=/dev/asm-diski bs=1024k count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00469976 seconds, 223 MB/s[root@vrh1 ~]# dd if=/dev/zero of=/dev/asm-diskj bs=1024k count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00344262 seconds, 305 MB/s[root@vrh1 ~]# dd if=/dev/zero of=/dev/asm-diskk bs=1024k count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0053518 seconds, 196 MB/s

5. 在一个节点上尝试重新启动HAS

[root@vrh1 ~]# crsctl start has

CRS-4123: Oracle High Availability Services has been started.

但是因为ocr和votedisk所在diskgroup丢失,所以CSS将无法正常启动,如以下日志所示:

查看日志:alertvrh1.log 

[cssd(5162)]CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /g01/11.2.0/grid/log/vrh1/cssd/ocssd.log
2012-08-09 03:35:41.207
[cssd(5162)]CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /g01/11.2.0/grid/log/vrh1/cssd/ocssd.log
2012-08-09 03:35:56.240
[cssd(5162)]CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /g01/11.2.0/grid/log/vrh1/cssd/ocssd.log
2012-08-09 03:36:11.284
[cssd(5162)]CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /g01/11.2.0/grid/log/vrh1/cssd/ocssd.log
2012-08-09 03:36:26.305
[cssd(5162)]CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /g01/11.2.0/grid/log/vrh1/cssd/ocssd.log
2012-08-09 03:36:41.328

ocssd.log:

2012-08-09 03:40:26.662: [    CSSD][1078700352]clssnmReadDiscoveryProfile: voting file discovery string(/dev/asm*)
2012-08-09 03:40:26.662: [    CSSD][1078700352]clssnmvDDiscThread: using discovery string /dev/asm* for initial discovery
2012-08-09 03:40:26.662: [   SKGFD][1078700352]Discovery with str:/dev/asm*:
2012-08-09 03:40:26.662: [   SKGFD][1078700352]UFS discovery with :/dev/asm*:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diskf:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diskb:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diskj:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diskh:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diskc:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diskd:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diske:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diskg:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diski:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Fetching UFS disk :/dev/asm-diskk:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]OSS discovery with :/dev/asm*:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Handle 0xdf22a0 from lib :UFS:: for disk :/dev/asm-diskf:
2012-08-09 03:40:26.665: [   SKGFD][1078700352]Handle 0xf412a0 from lib :UFS:: for disk :/dev/asm-diskb:
2012-08-09 03:40:26.666: [   SKGFD][1078700352]Handle 0xf3a680 from lib :UFS:: for disk :/dev/asm-diskj:
2012-08-09 03:40:26.666: [   SKGFD][1078700352]Handle 0xf93da0 from lib :UFS:: for disk :/dev/asm-diskh:
2012-08-09 03:40:26.667: [    CSSD][1078700352]clssnmvDiskVerify: Successful discovery of 0 disks
2012-08-09 03:40:26.667: [    CSSD][1078700352]clssnmCompleteInitVFDiscovery: Completing initial voting file discovery
2012-08-09 03:40:26.667: [    CSSD][1078700352]clssnmvFindInitialConfigs: No voting files found
2012-08-09 03:40:26.667: [    CSSD][1078700352](:CSSNM00070:)clssnmCompleteInitVFDiscovery: Voting file not found. Retrying discovery in 15 seconds

正式的恢复ocr和votedisk所在diskgroup的步骤如下:

1. 以-excl -nocrs 方式启动cluster,这将可以启动ASM实例 但不启动CRS

 [root@vrh1 vrh1]# crsctl start crs -excl -nocrs 

CRS-4123: Oracle High Availability Services has been started.
CRS-2672: Attempting to start ‘ora.mdnsd’ on ‘vrh1’
CRS-2676: Start of ‘ora.mdnsd’ on ‘vrh1’ succeeded
CRS-2672: Attempting to start ‘ora.gpnpd’ on ‘vrh1’
CRS-2676: Start of ‘ora.gpnpd’ on ‘vrh1’ succeeded
CRS-2672: Attempting to start ‘ora.cssdmonitor’ on ‘vrh1’
CRS-2672: Attempting to start ‘ora.gipcd’ on ‘vrh1’
CRS-2676: Start of ‘ora.cssdmonitor’ on ‘vrh1’ succeeded
CRS-2676: Start of ‘ora.gipcd’ on ‘vrh1’ succeeded
CRS-2672: Attempting to start ‘ora.cssd’ on ‘vrh1’
CRS-2672: Attempting to start ‘ora.diskmon’ on ‘vrh1’
CRS-2676: Start of ‘ora.diskmon’ on ‘vrh1’ succeeded
CRS-2676: Start of ‘ora.cssd’ on ‘vrh1’ succeeded
CRS-2679: Attempting to clean ‘ora.cluster_interconnect.haip’ on ‘vrh1’
CRS-2672: Attempting to start ‘ora.ctssd’ on ‘vrh1’
CRS-2681: Clean of ‘ora.cluster_interconnect.haip’ on ‘vrh1’ succeeded
CRS-2672: Attempting to start ‘ora.cluster_interconnect.haip’ on ‘vrh1’
CRS-2676: Start of ‘ora.ctssd’ on ‘vrh1’ succeeded
CRS-2676: Start of ‘ora.cluster_interconnect.haip’ on ‘vrh1’ succeeded
CRS-2672: Attempting to start ‘ora.asm’ on ‘vrh1’
CRS-2676: Start of ‘ora.asm’ on ‘vrh1’ succeeded

2.重建原ocr和votedisk所在diskgroup,注意compatible.asm必须是11.2:

[root@vrh1 vrh1]# su - grid[grid@vrh1 ~]$ sqlplus  / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on Thu Aug 9 04:16:58 2012
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> create diskgroup systemdg high redundancy
disk ‘/dev/asm-diskh’,’/dev/asm-diskg’,’/dev/asm-diski’,’/dev/asm-diskj’,’/dev/asm-diskk’ATTRIBUTE ‘compatible.rdbms’ = ’11.2’, ‘compatible.asm’ = ’11.2’;

3.从ocr backup中恢复ocr并做ocrcheck检验:

[root@vrh1 ~]# ocrconfig -restore /g01/11.2.0/grid/cdata/vrh-cluster/backup00.ocr

[root@vrh1 ~]# ocrcheck

Status of Oracle Cluster Registry is as follows :Version                  :          3Total space (kbytes)     :     262120Used space (kbytes)      :       3180Available space (kbytes) :     258940ID                       : 1238458014Device/File Name         :  +systemdgDevice/File integrity check succeededDevice/File not configuredDevice/File not configuredDevice/File not configuredDevice/File not configuredCluster registry integrity check succeededLogical corruption check succeeded

4. 准备恢复votedisk ,可能会遇到下面的错误:

[grid@vrh1 ~]$ crsctl replace votedisk  +SYSTEMDG

CRS-4602: Failed 27 to add voting file 2e4e0fe285924f86bf5473d00dcc0388.
CRS-4602: Failed 27 to add voting file 4fa54bb0cc5c4fafbf1a9be5479bf389.
CRS-4602: Failed 27 to add voting file a109ead9ea4e4f28bfe233188623616a.
CRS-4602: Failed 27 to add voting file 042c9fbd71b54f5abfcd3ab3408f3cf3.
CRS-4602: Failed 27 to add voting file 7b5a8cd24f954fafbf835ad78615763f.
Failed to replace voting disk group with +SYSTEMDG.
CRS-4000: Command Replace failed, or completed with errors.

需要重新配置一下ASM的参数,并重启ASM:

SQL> alter system set asm_diskstring=‘/dev/asm*’;
System altered.SQL> create spfile from memory;
File created.SQL>  startup force mount;
ORA-32004: obsolete or deprecated parameter(s) specified for ASM instance
ASM instance started
Total System Global Area  283930624 bytes
Fixed Size                  2227664 bytes
Variable Size             256537136 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mountedSQL> show parameter spfile
NAME                                 TYPE        VALUE
—————————————————— ————— ———————————————
spfile                               string      /g01/11.2.0/grid/dbs/spfi                                                   le+ASM1.ora[grid@vrh1 trace]$  crsctl replace votedisk  +SYSTEMDG
CRS-4256: Updating the profile
Successful addition of voting disk 85edc0e82d274f78bfc58cdc73b8c68a.
Successful addition of voting disk 201ffffc8ba44faabfe2efec2aa75840.
Successful addition of voting disk 6f2a25c589964faabf6980f7c5f621ce.
Successful addition of voting disk 93eb315648454f25bf3717df1a2c73d5.
Successful addition of voting disk 3737240678964f88bfbfbd31d8b3829f.
Successfully replaced voting disk group with +SYSTEMDG.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced

5. 重启has服务,检验cluster是否正常:

[root@vrh1 ~]# crsctl check crs

CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

[root@vrh1 ~]# crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group
———————————————  ——    ————————                ———— ————1. ONLINE   85edc0e82d274f78bfc58cdc73b8c68a (/dev/asm-diskh) [SYSTEMDG]2. ONLINE   201ffffc8ba44faabfe2efec2aa75840 (/dev/asm-diskg) [SYSTEMDG]3. ONLINE   6f2a25c589964faabf6980f7c5f621ce (/dev/asm-diski) [SYSTEMDG]4. ONLINE   93eb315648454f25bf3717df1a2c73d5 (/dev/asm-diskj) [SYSTEMDG]5. ONLINE   3737240678964f88bfbfbd31d8b3829f (/dev/asm-diskk) [SYSTEMDG]
Located 5 voting disk(s).

[root@vrh1 ~]# crsctl stat res -t

————————————————————————————————————————
NAME           TARGET  STATE   SERVER   STATE_DETAILS  Local Resources
————————————————————————————————————————
ora.BACKUPDG.dg    ONLINE  ONLINE       vrh1
ora.DATA.dg        ONLINE  ONLINE       vrh1
ora.LISTENER.lsnr  ONLINE  ONLINE       vrh1
ora.LSN_MACLEAN.lsnr ONLINE  ONLINE       vrh1
ora.SYSTEMDG.dg     ONLINE  ONLINE       vrh1
ora.asm             ONLINE  ONLINE       vrh1
......

转载于:https://blog.51cto.com/tiany/1566416

Oracle 11gR2 RAC恢复OCR和VOTE DISK相关推荐

  1. oracle 11g votedisk,Oracle 11gR2 RAC恢复OCR和VOTE DISK

    Oracle 11gR2 RAC恢复OCR和VOTE DISK 原文链接: http://www.askmaclean.com/archives/11-2-lost-ocr-votedisk-grou ...

  2. Openfiler + Redhat 5.4 Oracle 11gR2 RAC 安装文档

    Oracle 11gR2 RAC 的安装. 这个实验采用的架构: 虚拟机VMServer 2.0 + REDHAT 5.4 +Oracle 11gR2+openfiler存储 + DNS server ...

  3. Linux平台 Oracle 11gR2 RAC安装Part1:准备工作

    一.实施前期准备工作 1.1 服务器安装操作系统 1.2 Oracle安装介质 1.3 共享存储规划 1.4 网络规范分配 二.安装前期准备工作 2.1 各节点系统时间校对 2.2 各节点关闭防火墙和 ...

  4. 一步一步搭建 oracle 11gR2 rac+dg之grid安装(四)

    一步一步在RHEL6.5+VMware Workstation 10上搭建 oracle 11gR2 rac + dg 之grid安装 (四) 本章目录结构: 这一步也比较重要,主要是安装ASM,如果 ...

  5. 1.5小时,一键部署Oracle 11GR2 RAC 集群

    无人值守安装Oracle 11GR2 RAC集群,只需要1.5小时?没错,通过脚本静默安装,只需要1.5小时,包括安装补丁,建库. 脚本下载链接:SHELL脚本进行oracle数据库一键安装,实现真正 ...

  6. 1.5小时!一键部署Oracle 11GR2 RAC 集群

    无人值守安装Oracle 11GR2 RAC集群,只需要1.5小时?没错,通过脚本静默安装,只需要1.5小时,包括安装补丁,建库. 脚本下载链接:SHELL脚本进行oracle数据库一键安装,实现真正 ...

  7. 【RAC】Oracle 11gR2 RAC 中的 Grid Plug and Play(GPnP) 是什么?

    [RAC]Oracle 11gR2 RAC 中的 Grid Plug and Play(GPnP) 是什么? 一. 什么是GPnP? Grid Plug and Play (GPnP):Foundat ...

  8. oracle 11gR2 RAC root.sh 错误 ORA-15072 ORA-15018

    Oracle  11gR2 RAC 安装Clusterware 结束, 在第二个节点执行root.sh脚本的是报如下错误: DiskGroup DATA1 creation failed with t ...

  9. oracle报错ora-00200,oracle 11gR2 rac 创建database报ORA-00200错误

    oracle 11gR2 rac创建数据库时,报ORA-00200错误,提示权限不够 NOTE: MARK has subscribed NOTE: Loaded library: System SU ...

最新文章

  1. 同源策略Same-origin policy
  2. python常用标准库有哪些-Python 200个标准库汇总
  3. Http中Get/Post请求区别
  4. C++中重载与重写函数区别及虚函数(转载)
  5. 高糊马赛克秒变高清,表情帝:这还是我吗?
  6. anaconda3 tensorflow安装踩坑记(WIN10+tensorflow带gpu版本)
  7. leetcode combinations java_[LeetCode][Java] Combinations
  8. redis客户端-服务端协议(RESP协议)
  9. ubuntu安装nginx及其默认目录结构
  10. 解决 No module named ‘tensorflow.examples.tutorials‘
  11. java基础编程思想题目
  12. Matlab自带的曲线拟合程序
  13. Java 复制文件并改名
  14. Adaptive AUTOSAR和Classic AUTOSAR
  15. java毕业设计车辆违规信息管理系统Mybatis+系统+数据库+调试部署
  16. C语言学习笔记-有符号数和无符号数相加的问题
  17. 加密市场中的14个心智模型
  18. 2022年废纸价格预测
  19. Vue学习笔记(六)--- 前端路由 Vue Router
  20. 201871010105-曹玉中《面向对象程序设计(java)》第四周学习总结

热门文章

  1. go语言在windows编译在linux上运行的可执行程序
  2. 二叉树的广度优先遍历(层序遍历)
  3. 数据可视化【十四】交互式过滤地区分布图
  4. C++关于虚基类、构造函数、析构函数、成员对象的两个程序浅析
  5. 小白创建网站的曲折之路
  6. 传输层:IP 地址解析 路由转发
  7. 小程序 setData 中的坑,其实好像...
  8. k8s的ingress使用
  9. net core 获取网站目录
  10. Facade(外观模式)