Oracle RAC OCR 的管理與維護

來源:互聯網
上載者:User

OCR相當於Windows的註冊表。對於Windows而言,所有的軟體資訊,使用者,配置,安全等等統統都放到註冊表裡邊。而叢集呢,同樣如此,所有和叢集相關的資源,配置,節點,RAC資料庫統統都放在這個倉庫裡。如果OCR被破壞則導致叢集服務啟動異常,需要修複OCR。因此OCR的管理與維護對於整個叢集而言,是相當重要的。本文主要描述了Oracle 10g RAC下的OCR的管理與維護。

OCR 相關參考:

Oracle RAC OCR 與健忘症

Oracle RAC OCR 的備份與恢複

1、環境
 oracle@bo2dbp:~> cat /etc/issue
 Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64) - Kernel \r (\l).
 
 oracle@bo2dbp:~> crsctl query crs activeversion
 CRS active version on the cluster is [10.2.0.3.0]

2、校正OCR檔案
 oracle@bo2dbp:~> ocrcheck
 Status of Oracle Cluster Registry is as follows :
          Version                  :          2
          Total space (kbytes)    :    204560
          Used space (kbytes)      :      6160
          Available space (kbytes) :    198400
          ID                      : 1512159503
          Device/File Name        : /dev/raw/raw1                <-- OCR (primary)
                                    Device/File integrity check succeeded
 
                                    Device/File not configured  <-- OCR Mirror (not configured)
 
          Cluster registry integrity check succeeded
 
 #如果clusterware處於關閉狀態也可通過查詢ocr.loc獲得ocr檔案所在的位置
 oracle@bo2dbp:~> more /etc/oracle/ocr.loc
 ocrconfig_loc=/dev/raw/raw1
 local_only=FALSE       
 
 #校正OCR產生的記錄檔
 $ORA_CRS_HOME/log/<hostname>/client/ocrcheck_<pid>.log

3、dump OCR的內容
 #預設情況下,ocrdump命令匯出檔案被命名為OCRDUMPFILE,其檔案類型為ASCII檔案,如果預設檔案已存在,則收到PROT-303檔案存在提示
 
 #匯出ocr到預設檔案
 oracle@bo2dbp:~> ocrdump
 oracle@bo2dbp:~> ls -hltr OCRDUMPFILE
 -rw-r--r-- 1 oracle oinstall 44K 2013-01-07 14:13 OCRDUMPFILE
 oracle@bo2dbp:~> file OCRDUMPFILE
 OCRDUMPFILE: ASCII text
 
 #匯出ocr到指定檔案
 oracle@bo2dbp:~> ocrdump /tmp/`hostname`_ocrdump_`date +%Y%m%d:%H%M`
 oracle@bo2dbp:~> ls /tmp/*ocr*
 /tmp/bo2dbp_ocrdump_20130107:1415
 
 #匯出ocr中system.css項的內容
 oracle@bo2dbp:~> ocrdump -stdout -keyname SYSTEM.css -xml >ocrdump.xml
 oracle@bo2dbp:~> more ocrdump.xml
 <OCRDUMP>
 
 <TIMESTAMP>01/07/2013 14:15:42</TIMESTAMP>
 <COMMAND>/u01/oracle/crs/bin/ocrdump.bin -stdout -keyname SYSTEM.css -xml </COMMAND>
 
 <KEY>
 <NAME>SYSTEM.css</NAME>
 <VALUE_TYPE>UNDEF</VALUE_TYPE>
 <VALUE><![CDATA[]]></VALUE>
 <USER_PERMISSION>PROCR_ALL_ACCESS</USER_PERMISSION>
 <GROUP_PERMISSION>PROCR_READ</GROUP_PERMISSION>
 <OTHER_PERMISSION>PROCR_READ</OTHER_PERMISSION>
 <USER_NAME>root</USER_NAME>
 <GROUP_NAME>root</GROUP_NAME>
 ............
 
 #匯出ocr中關於ocr的備份情況
 oracle@bo2dbp:~> ocrdump -stdout -keyname SYSTEM.OCR -xml>ocrdump_bak.xml

4、添加OCR檔案
 #注,下面的描述中crs在所有的節點處於online狀態,即對於ocr的添加,移動,代替crs無需處於offline狀態
 oracle@bo2dbp:~> crsctl check crs
 CSS appears healthy
 CRS appears healthy
 EVM appears healthy
 oracle@bo2dbp:~> ssh bo2dbs crsctl check crs
 CSS appears healthy
 CRS appears healthy
 EVM appears healthy
 
 ocrconfig -replace ocrmirror <destination_file>
 ocrconfig -replace ocrmirror <disk>
 
 oracle@bo2dbp:~> sudo -s rcraw status
 root'''s password:
 /dev/raw/raw1:  bound to major 8, minor 33
 /dev/raw/raw2:  bound to major 8, minor 49
 /dev/raw/raw11: bound to major 8, minor 113
 /dev/raw/raw21: bound to major 8, minor 129
 /dev/raw/raw22: bound to major 8, minor 145
                                                                      running
 
 oracle@bo2dbp:~> sudo -s /u01/oracle/crs/bin/ocrconfig -replace ocrmirror /dev/raw/raw11
 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  #新的ocr鏡像已經被添加
                                    Device/File integrity check succeeded
 
          Cluster registry integrity check succeeded
 
 #下面是串連到第二個節點查看
 oracle@bo2dbp:~> ssh 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  #新的ocr鏡像已經被添加
                                    Device/File integrity check succeeded
 
          Cluster registry integrity check succeeded
 
 #從兩個節點查看ocr.loc檔案記錄的ocr位置是否發生變化                                                                             
 oracle@bo2dbp:~> more /etc/oracle/ocr.loc
 #Device/file  getting replaced by device /dev/raw/raw11
 ocrconfig_loc=/dev/raw/raw1
 ocrmirrorconfig_loc=/dev/raw/raw11  #可以看到增加了ocrmirror位置
 local_only=false
 
 oracle@bo2dbp:~> ssh bo2dbs cat /etc/oracle/ocr.loc
 #Device/file  getting replaced by device /dev/raw/raw11
 ocrconfig_loc=/dev/raw/raw1
 ocrmirrorconfig_loc=/dev/raw/raw11
 
 #下面來嘗試多添加一個ocrmirror,我們使用裸裝置為raw21的做為鏡像
 oracle@bo2dbp:~> sudo -s /u01/oracle/crs/bin/ocrconfig -replace ocrmirror /dev/raw/raw21
 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/raw21  #可以看到原來的raw11已經被替代了
                                    Device/File integrity check succeeded
 
          Cluster registry integrity check succeeded
 
 #從上面的描述可知,ocr磁碟只能有兩個,一個作為primary,一個作為mirror

  • 1
  • 2
  • 3
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.