oracle ocr掉盘,OCR磁盘损坏的恢复

当Oracle OCR磁盘损坏时,可通过以下步骤恢复:1) 检查OCR备份;2) 关闭所有节点及资源;3) 启动ASM;4) 创建新磁盘组,将参数文件移到新组;5) 恢复CRS;6) 恢复voting disk。过程中涉及ASM、crsctl等工具操作,确保数据完整性。
摘要由CSDN通过智能技术生成

思路:

1.ocr被破坏(采用dd破坏磁盘的方式)

2.所有节点的cluster都关闭,资源都关闭,db也关闭了。

3.选一个节点执行crsctl start crs -excl -nocrs 启动asm

4.as sysasm 进入后,创建新的磁盘组,并将asm参数文件的spfile创建到新磁盘组里,然后shutdown immdiate关闭asm,再startup启动,以使用新参数文件。

5.恢复crs

6.恢复voting disk

步骤:

在破坏ocr之前,我们得先看看我们的ocr备份是否存在,备份有2种,手动和自动备份。

先简单查看ocr磁盘的冗余模式

这个是我的测试环境,ocr是normal方式的。

SQL> select name,type from v$asm_diskgroup;

NAME                           TYPE

------------------------------ ------

DATA                           NORMAL

这是另一个环境,ocr是外部冗余方式的。

SQL> select name,type from v$asm_diskgroup;

NAME                           TYPE

------------------------------ ------

DATA_PTL                       EXTERN

OCR_PTL                        EXTERN

查看自动备份

默认的自动备份路径是$CRS_HOME/cdata/$CRS_NAME

自动备份只会在一个节点执行。如果用于备份的节点出现异常,则oracle会自动切换到其他节点进行备份。

默认情况下,oracle会保留最近5份ocr备份:3份最近的、一份昨天和一份上周的。

[root@host01 bin]# ./ocrconfig -showbackup

host01     2016/03/24 06:48:42     /u01/app/11.2.0/grid/cdata/cluster01/backup00.ocr

host01     2016/03/24 02:48:42     /u01/app/11.2.0/grid/cdata/cluster01/backup01.ocr

host01     2016/03/23 22:48:41     /u01/app/11.2.0/grid/cdata/cluster01/backup02.ocr

host01     2016/03/23 14:48:40     /u01/app/11.2.0/grid/cdata/cluster01/day.ocr

host01     2016/03/23 14:48:40     /u01/app/11.2.0/grid/cdata/cluster01/week.ocr

PROT-25: Manual backups for the Oracle Cluster Registry are not available

[root@host01 bin]# ll /u01/app/11.2.0/grid/cdata/cluster01/

total 43344

-rw------- 1 root root 7385088 Mar 24 06:48 backup00.ocr

-rw------- 1 root root 7385088 Mar 24 02:48 backup01.ocr

-rw------- 1 root root 7385088 Mar 23 22:48 backup02.ocr

-rw------- 1 root root 7385088 Mar 24 02:48 day_.ocr

-rw------- 1 root root 7385088 Mar 23 14:48 day.ocr

-rw------- 1 root root 7385088 Mar 23 14:48 week.ocr

检查ocr的完整性:

[oracle@host01 bin]$ pwd

/u01/app/11.2.0/grid/bin

[oracle@host01 bin]$ ./cluvfy comp ocr -n all

Verifying OCR integrity

Checking OCR integrity...

Checking the absence of a non-clustered configuration...

All nodes free of non-clustered, local-only configurations

ASM Running check passed. ASM is running on all specified nodes

Checking OCR config file "/etc/oracle/ocr.loc"...

OCR config file "/etc/oracle/ocr.loc" check successful

Disk group for ocr location "+DATA" available on all the nodes

NOTE:

This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR.

OCR integrity check passed

Verification of OCR integrity was successful.

也可以使用ocrcheck检查ocr的完整性:

[oracle@host01 bin]$ ./ocrcheck

Status of Oracle Cluster Registry is as follows :

Version                  :          3

Total space (kbytes)     :     262120

Used space (kbytes)      :       3064

Available space (kbytes) :     259056

ID                       :  764742178

Device/File Name         :      +DATA

Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Device/File not configured

Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check bypassed due to non-privileged user

[oracle@host01 bin]$

[root@host02 ~]# /u01/app/11.2.0/grid/bin/ocrcheck

Status of Oracle Cluster Registry is as follows :

Version                  :          3

Total space (kbytes)     :     262120

Used space (kbytes)      :       3064

Available space (kbytes) :     259056

ID                       :  764742178

Device/File Name         :      +DATA

Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Device/File not configured

<
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值