ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ocr备份与恢复

ocr备份与恢复

原创 Linux操作系统 作者:libingquan008 时间:2011-04-18 06:53:03 0 删除 编辑
ocr备份与恢复
自动备份与恢复

ocr默认是有自动备份的,每4个小时备份一次的
使用命令查看:
[oracle@db2 ~]$ ocrconfig -showbackup
恢复:
[oracle@db2 ~]$ ocrconfig –restore $CRS_HOME/cdata/crs/自动备份.ocr


手动备份与恢复

备份:
在每个节点上都停掉crs
[root@db2 ~]# cd /opt/oracle/product/10.2.0/crs/bin/
[root@db2 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

[root@db1 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

 用root 用户导出OCR盘
[root@db2 bin]# ./ocrconfig -export /opt/oracle/admin/ocr.bak
查看文件是否产生
[root@db2 bin]# ls /opt/oracle/admin/ocr.bak  -l

然后在所有节点上启动crs
[root@db1 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly

[root@db2 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
检查crs是否正常
[root@db1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy

当ocr损坏了,这里是模拟
[root@db1 bin]# dd if=/dev/zero f=/dev/raw/raw2 bs=8192
dd: writing `/dev/raw/raw2': No space left on device
16066+0 records in
16065+0 records out
验证ocr
[oracle@db1 crs]$ ocrcheck
PROT-602: Failed to retrieve data from the cluster registry
[root@db1 bin]# /home/oracle/clusterware/cluvfy/runcluvfy.sh comp ocr -n all

Verifying OCR integrity

ERROR:
User equivalence unavailable on all the nodes.
Verification cannot proceed.


Verification of OCR integrity was unsuccessful on all the nodes.

或者出现以下故障:
[oracle@db1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     128432
         Used space (kbytes)      :       1980
         Available space (kbytes) :     126452
         ID                       : 1241782708
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check failed

                                    Device/File not configured

         Cluster registry integrity check failed

都可以用备份进行恢复:
在每个节点上都停掉crs
[root@db2 ~]# cd /opt/oracle/product/10.2.0/crs/bin/
[root@db2 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

[root@db1 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

执行恢复命令:
那个节点损坏就在那个节点执行,都损坏两个节点都执行
root@db1 bin]# ./ocrconfig -import /opt/oracle/admin/ocr.bak
root@db2 bin]# ./ocrconfig -import /opt/oracle/admin/ocr.bak
重启crs
[root@db1 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly

[root@db2 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly

执行命令验证ocr 是否恢复了:
[oracle@db1 crs]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     128432
         Used space (kbytes)      :       4584
         Available space (kbytes) :     123848
         ID                       : 2023869408
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw3
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded

[oracle@db2 crs]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     128432
         Used space (kbytes)      :       4584
         Available space (kbytes) :     123848
         ID                       : 2023869408
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw3
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeed

[oracle@db1 crs]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    db1         
ora....B1.lsnr application    ONLINE    ONLINE    db1         
ora.db1.gsd    application    ONLINE    ONLINE    db1         
ora.db1.ons    application    ONLINE    ONLINE    db1         
ora.db1.vip    application    ONLINE    ONLINE    db1         
ora....SM2.asm application    ONLINE    ONLINE    db2         
ora....B2.lsnr application    ONLINE    ONLINE    db2         
ora.db2.gsd    application    ONLINE    ONLINE    db2         
ora.db2.ons    application    ONLINE    ONLINE    db2         
ora.db2.vip    application    ONLINE    ONLINE    db2         
ora.orcl.db    application    ONLINE    ONLINE    db1         
ora....orcl.cs application    ONLINE    ONLINE    db2         
ora....cl1.srv application    ONLINE    ONLINE    db1         
ora....cl2.srv application    ONLINE    ONLINE    db2         
ora....l1.inst application    ONLINE    ONLINE    db1         
ora....l2.inst application    ONLINE    ONLINE    db2

OK,OCR恢复回来,一切正常了。

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

上一篇: OCR恢复步骤
请登录后发表评论 登录
全部评论

注册时间:2011-02-10

  • 博文量
    46
  • 访问量
    119408