oracle10g rac导出ocr,Oracle RAC 备份和恢复OCR(10g)

Oracle RAC 备份和恢复OCR

1.OCR有两种备份方式,一种是自动备份,一种是手动备份。

自动备份:

Oracle Clusterware automatically creates OCR backups every 4 hours. At any one time, Oracle Clusterware always retains the latest 3 backup copies of the OCR that are 4 hours old, 1 day old, and 1 week old.

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

可以用下面的方式查看自动备份的文件

ocrconfig -showbackup

手动备份:

可以用下面的方式export OCR的内容到一个文件,backup_file_name是备份的文件的名字

ocrconfig -export backup_file_name

提示:你需要用root用户执行此命令

示例:

进入CRS_HOME/bin--备份

[root@node1 bin]# ./ocrconfig -export /home/oracle/backup/ocrbackup1.bak

--查看备份文件

[oracle@node1 backup]$ ll

total 104632

-rw-r--r-- 1 root root     86056 Mar 18 20:18 ocrbackup1.bak

2.OCR有两种恢复方式,一种是从自动备份中恢复,一种是手动备份中恢复。

从自动备份中恢复:

用下面的方式恢复OCR

ocrconfig -restore file_name提示:用root用户执行,file_name为你想要从哪个备份文件中恢复的备份文件名

1.两个节点关闭CRS

[root@node1 bin]# ./crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

[root@node2 bin]# ./crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.2.恢复OCR

①模拟破坏OCR所在裸设备数据,本例采用的非冗余。

[root@node1 bin]# dd if=/dev/urandom of=/dev/raw/raw1

dd: writing to `/dev/raw/raw1': No space left on device

208865+0 records in

208864+0 records out

106938368 bytes (107 MB) copied, 123.665 seconds, 865 kB/s

--破坏后crs无法启动。

②恢复OCR

[root@node1 bin]# ./ocrconfig -restore /home/oracle/oracle/product/10.2.0/crs_1/cdata/crs/backup00.ocr③验证OCR完整性

[oracle@node1 crs]$ 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.

Uniqueness check for OCR device passed.

Checking the version of OCR...

OCR of correct Version "2" exists.

Checking data integrity of OCR...

Data integrity check for OCR passed.

OCR integrity check passed.

Verification of OCR integrity was successful.----恢复后能启动

从手动备份中恢复:

用下面的方法从手动备份中恢复,file_name为备份的文件名

ocrconfig -import file_name示例:

[root@node1 bin]# ./ocrconfig -import /home/oracle/backup/ocrbackup1.bak

[oracle@node1 crs]$ 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.

Uniqueness check for OCR device passed.

Checking the version of OCR...

OCR of correct Version "2" exists.

Checking data integrity of OCR...

Data integrity check for OCR passed.

OCR integrity check passed.

Verification of OCR integrity was successful.恢复后可以启动

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值