oracle 10g cluster 如何替換ocr 主檔案 (crs offline狀態)

paulyibinyi發表於2010-06-02

      在上一篇文章中  oracle 10g cluster 如何替換ocr主檔案   http://space.itpub.net/7199859/viewspace-663991

  是採用crs online的狀態來替換ocr主檔案的,這篇我們寫的是在crs offline的狀態下如何替換ocr主檔案

  命令如下:

./ocrconfig -repair ocr /dev/rhdisk8
./ocrconfig -overwrite

[root@p650:/crs/app/oracle/product/crs_1/bin]#./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     130852
         Used space (kbytes)      :       4636
         Available space (kbytes) :     126216
         ID                       : 1542042236
         Device/File Name         : /dev/rhdisk11
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded

     原來是hdisk11,替換成hdisk8

1.賦予hdisk8 相關 許可權(假設hdisk8已經從儲存上劃分lun出來)

chown root:oinstall /dev/rhdisk8

chmod 640 /dev/rhdisk8

2.兩邊節點停止crs

 crs stop crs

3.用ocrconfig -repair ocr命令來替換


[root@p520:/crs/app/oracle/product/crs_1/bin]#./ocrconfig -repair ocr /dev/rhdisk8
[root@p520:/crs/app/oracle/product/crs_1/bin]#./ocrcheck
PROT-601: Failed to initialize ocrcheck
[root@p520:/crs/app/oracle/product/crs_1/bin]#./ocrconfig -overwrite
PROT-1: Failed to initialize ocrconfig
報PROT-1: Failed to initialize ocrconfig錯誤,這時我們還需要對ocr盤做個restore

./ocrconfig -showbackup

[root@p650:/crs/app/oracle/product/crs_1/cdata/crs]#ls -ltr
total 54424
-rw-r--r--    1 root     system      3477504 May 26 13:59 week.ocr
-rw-r--r--    1 root     system      4861952 May 27 14:09 backup02.ocr
-rw-r--r--    1 root     system      4878336 May 28 14:48 backup01.ocr
-rw-r--r--    1 root     system      4882432 Jun 02 17:15 backup00.ocr
-rw-r--r--    1 root     system      4882432 Jun 02 17:15 day.ocr
[root@p650:/crs/app/oracle/product/crs_1/bin]#./ocrconfig -restore /crs/app/oracle/product/crs_1/cdata/crs/week_.ocr

[root@p650:/crs/app/oracle/product/crs_1/bin]#./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     130852
         Used space (kbytes)      :       4636
         Available space (kbytes) :     126216
         ID                       : 1542042236
         Device/File Name         : /dev/rhdisk8
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded

已經替換過來,這時我們查

[root@p650:/crs/app/oracle/product/crs_1/log/p650/client]#more  ocrconfig_827524.log

日誌記錄有Exiting [status=success]... 的記錄

4.啟動crs

    crsctl start crs

crs能正常啟動,替換成功。

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-664283/,如需轉載,請註明出處,否則將追究法律責任。

相關文章