手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle RAC OCR 的备份与恢复

[日期:2013-02-26] 来源:CSDN  作者:robinson [字体:大 中 小]

三、OCR的恢复

1、从可用的OCR镜像中恢复受损的OCR
        a、首先模拟ocr 损坏
        Oracle@bo2dbp:~> dd if=/dev/zero of=/dev/raw/raw1 bs=1024k count=10
        10+0 records in
        10+0 records out
        10485760 bytes (10 MB) copied, 0.24662 seconds, 42.5 MB/s
       
        oracle@bo2dbp:~> ocrcheck
        Status of Oracle Cluster Registry is as follows :
                Version                  :          2
                Total space (kbytes)    :    204560
                Used space (kbytes)      :      6184
                Available space (kbytes) :    198376
                ID                      : 1512159503
                Device/File Name        : /dev/raw/raw1
                                            Device/File integrity check failed
        n        Device/File Name        : /dev/raw/raw11
                                            Device/File integrity check succeeded
       
                Cluster registry integrity check succeeded
       
        oracle@bo2dbp:~> ocrcheck
        Status of Oracle Cluster Registry is as follows :
                Version                  :          2
                Total space (kbytes)    :    204560
                Used space (kbytes)      :      6184
                Available space (kbytes) :    198376
                ID                      : 1512159503
                Device/File Name        : /dev/raw/raw1
                                            Device/File needs to be synchronized with the other device
                Device/File Name        : /dev/raw/raw11
                                            Device/File integrity check succeeded
       
                Cluster registry integrity check succeeded       
       
        #尽管此时ocr文件被破坏,但整个集群依旧处于Online状态,此处不列出,读者可自行验证
        #接下来修复ocr
       
        b、校验所在的裸设备处于可用状态
        oracle@bo2dbp:~> sudo -s rcraw status | grep raw1
        root''''s password:
        /dev/raw/raw1:  bound to major 8, minor 33
        /dev/raw/raw11: bound to major 8, minor 113 

        c、校验裸设备的权限
        oracle@bo2dbp:~> ls -hltr /dev/raw/raw1
        crw-rw---- 1 oracle dba 162, 1 2013-02-05 16:00 /dev/raw/raw1 
        oracle@bo2dbp:~> ssh bo2dbs ls -hltr /dev/raw/raw1
        crw-rw---- 1 oracle dba 162, 1 2013-02-05 10:28 /dev/raw/raw1   

        d、重新初始化裸设备
        oracle@bo2dbp:~> dd if=/dev/zero of=/dev/raw/raw1 bs=1024k count=200
        dd: writing `/dev/raw/raw1': No space left on device
        200+0 records in
        199+0 records out
        209698816 bytes (210 MB) copied, 4.84775 seconds, 43.3 MB/s

        e、从镜像ocr恢复主ocr
                #实际上等同于添加一个新的ocr。此时主ocr从镜像ocr复制内容。
                #对于镜像ocr的损坏可以采用相同的方式如法炮制。
        oracle@bo2dbp:~> sudo -s /u01/oracle/crs/bin/ocrconfig -replace ocr /dev/raw/raw1
        root''''s password:
        oracle@bo2dbp:~> ocrcheck
        Status of Oracle Cluster Registry is as follows :
                Version                  :          2
                Total space (kbytes)    :    204560
                Used space (kbytes)      :      6184
                Available space (kbytes) :    198376
                ID                      : 1512159503
                Device/File Name        : /dev/raw/raw1
                                            Device/File integrity check succeeded
                Device/File Name        : /dev/raw/raw11
                                            Device/File integrity check succeeded
       
                Cluster registry integrity check succeeded

        f、校验修复情况
        oracle@bo2dbp:~> 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.         

2、从逻辑备份(导出的文件)中恢复OCR
        a、首先查看一下ocr的位置
        oracle@bo2dbp:~> more /etc/oracle/ocr.loc
        #Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw1
        ocrconfig_loc=/dev/raw/raw1
        ocrmirrorconfig_loc=/dev/raw/raw11
        local_only=false

        b、停止两个节点上的crs
        oracle@bo2dbp:~> sudo -s /u01/oracle/crs/bin/crsctl stop crs
        root''''s password:
        Stopping resources. This could take several minutes.
        Successfully stopped CRS resources.
        Stopping CSSD.
        Shutting down CSS daemon.
        Shutdown request successfully issued.
        oracle@bo2dbp:~> ps -ef | grep d.bin | grep -v grep

        oracle@bo2dbs:~> sudo -s /u01/oracle/crs/bin/crsctl stop crs
        root''''s password:
        Stopping resources. This could take several minutes.
        Successfully stopped CRS resources.
        Stopping CSSD.
        Shutting down CSS daemon.
        Shutdown request successfully issued.
        # Author : Robinson
        # Blog  : http://blog.csdn.net/robinson_0612
        oracle@bo2dbs:~> ps -ef | grep d.bin | grep -v grep

        c、尝试破坏ocr
        oracle@bo2dbp:~> dd if=/dev/zero of=/dev/raw/raw1 bs=1024k count=10
        10+0 records in
        10+0 records out
        10485760 bytes (10 MB) copied, 0.1811 seconds, 57.9 MB/s
        oracle@bo2dbp:~> dd if=/dev/zero of=/dev/raw/raw11 bs=1024k count=10
        10+0 records in
        10+0 records out
        10485760 bytes (10 MB) copied, 0.167224 seconds, 62.7 MB/s
       
        oracle@bo2dbp:~> sudo -s /u01/oracle/crs/bin/crsctl start crs
        Attempting to start CRS stack
        The CRS stack will be started shortly
        oracle@bo2dbp:~>  ps -ef | grep d.bin | grep -v grep
        oracle@bo2dbp:~> ./crs_stat.sh    #这个查看已经无法同crs通信
        Resource name                                Target    State           
        --------------                                ------    -----           
        error connecting to CRSD at [(ADDRESS=(PROTOCOL=ipc)(KEY=ora_crsqs))] clsccon 184
        oracle@bo2dbp:~> crs_stat -t
        CRS-0184: Cannot communicate with the CRS daemon.

        d、从导出的备份文件中恢复ocr
        oracle@bo2dbp:~> sudo -s /u01/oracle/crs/bin/ocrconfig -import /u02/crs_bak/ocr_bak/exp/bo2dbp/ocr_bak.dmp
        oracle@bo2dbp:~> sudo -s /u01/oracle/crs/bin/crsctl start crs
        Attempting to start CRS stack
        The CRS stack will be started shortly
        oracle@bo2dbp:~> ps -ef | grep d.bin | grep -v grep
        oracle  27209 23220  0 10:32 ?        00:00:00 /u01/oracle/crs/bin/evmd.bin
        root    27307 23392  0 10:32 ?        00:00:01 /u01/oracle/crs/bin/crsd.bin reboot
        oracle  27613 27153  0 10:32 ?        00:00:00 /u01/oracle/crs/bin/ocssd.bin

        #尝试启动第2个几点的crs
        oracle@bo2dbs:~> sudo -s /u01/oracle/crs/bin/crsctl start crs
        root''''s password:
        Attempting to start CRS stack
        The CRS stack will be started shortly
       
        e、在第二个节点上执行ocrcheck,此时显示ocrcheck成功
        oracle@bo2dbs:~> ocrcheck
        Status of Oracle Cluster Registry is as follows :
                Version                  :          2
                Total space (kbytes)    :    204560
                Used space (kbytes)      :      6184
                Available space (kbytes) :    198376
                ID                      : 1325424958
                Device/File Name        : /dev/raw/raw1
                                            Device/File integrity check succeeded
                Device/File Name        : /dev/raw/raw11
                                            Device/File integrity check succeeded
       
                Cluster registry integrity check succeeded

        oracle@bo2dbs:~> cluvfy comp ocr -n all  #使用cluvfy工具校验
       
        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.

linux
相关资讯       Oracle RAC  Oracle RAC OCR 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款