轉:Oracle RAC 新增和刪除OCR(10g)

sun642514265發表於2013-12-04

Oracle RAC 新增和刪除OCR

Oracle RAC 備份和恢復OCR 參考:http://blog.csdn.net/laoshangxyc/article/details/8688705


Oracle Clusterware最多隻支援兩個OCR,一個普通OCR,一個映象OCR.如果採用的External Redundancy方式儲存OCR,那麼還可以新增一個映象OCR,

如果才用的Normal Redundancy的方式儲存OCR那麼則不能再新增。

新增普通OCR方法如下:

ocrconfig -replace ocr destination_file
ocrconfig -replace ocr disk
--destination_file或disk為想要新增的OCR儲存位置

新增映象OCR方法如下:

ocrconfig -replace ocrmirror destination_file 
ocrconfig -replace ocrmirror disk
--destination_file或disk為想要新增的OCR儲存位置

--以上要用root使用者執行

示例新增映象OCR:

1.檢視系統當前OCR情況

  1. [oracle@node1 ~]$ ocrcheck  
  2. Status of Oracle Cluster Registry is as follows :  
  3.          Version                  :          2  
  4.          Total space (kbytes)     :     104344  
  5.          Used space (kbytes)      :       3816  
  6.          Available space (kbytes) :     100528  
  7.          ID                       :  497615595  
  8.          Device/File Name         : /dev/raw/raw1  
  9.                                     Device/File integrity check succeeded  
  10.   
  11.                                     Device/File not configured  
  12.   
  13.          Cluster registry integrity check succeeded  

看到當前系統只有一個OCR儲存(為普通OCR),在/dev/raw/raw1.

如果此時再新增一個普通OCR,則會報如下錯誤

  1. [root@node1 bin]# ./ocrconfig -replace ocr /dev/raw/raw7  
  2. PROT-16: Internal Error  

2.新增一個映象OCR

  1. [root@node1 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw7  

3.檢視新增後的OCR情況

  1. [oracle@node1 crs_1]$ ocrcheck  
  2. Status of Oracle Cluster Registry is as follows :  
  3.          Version                  :          2  
  4.          Total space (kbytes)     :     104344  
  5.          Used space (kbytes)      :       3816  
  6.          Available space (kbytes) :     100528  
  7.          ID                       :  497615595  
  8.          Device/File Name         : /dev/raw/raw1  
  9.                                     Device/File integrity check succeeded  
  10.          Device/File Name         : /dev/raw/raw7  
  11.                                     Device/File integrity check succeeded  
  12.   
  13.          Cluster registry integrity check succeeded  

可以看到新增成功

刪除普通OCR方法如下:

ocrconfig -replace ocr

刪除映象OCR方法如下:

ocrconfig -replace ocrmirror

示例刪除普通OCR:

  1. [root@node1 bin]# ./ocrconfig -replace ocr  
  2.   
  3. [oracle@node1 crs_1]$ ocrcheck  
  4. Status of Oracle Cluster Registry is as follows :  
  5.          Version                  :          2  
  6.          Total space (kbytes)     :     153496  
  7.          Used space (kbytes)      :       3816  
  8.          Available space (kbytes) :     149680  
  9.          ID                       :  497615595  
  10.          Device/File Name         : /dev/raw/raw7  
  11.                                     Device/File integrity check succeeded  
  12.   
  13.                                     Device/File not configured  
  14.   
  15.          Cluster registry integrity check succeeded  
可以看到儲存位置為/dev/raw/raw1的普通OCR已經被刪除。

注:刪除普通OCR後,映象ocr即為普通ocr,所以此時依然無法新增普通ocr,所以ocrconfig -replace ocr destination_file這個命令可能在第一建立ocr的時候才會用到。

示例刪除映象OCR

  1. --檢視raw7為普通OCR,raw8為映象ocr  
  2. [oracle@node1 crs_1]$ ocrcheck  
  3. Status of Oracle Cluster Registry is as follows :  
  4.          Version                  :          2  
  5.          Total space (kbytes)     :     153496  
  6.          Used space (kbytes)      :       3816  
  7.          Available space (kbytes) :     149680  
  8.          ID                       :  497615595  
  9.          Device/File Name         : /dev/raw/raw7  
  10.                                     Device/File integrity check succeeded  
  11.          Device/File Name         : /dev/raw/raw8  
  12.                                     Device/File integrity check succeeded  
  13.   
  14.          Cluster registry integrity check succeeded  
  15. --刪除映象ocr  
  16. [root@node1 bin]# ./ocrconfig -replace ocrmirror  
  17. --可以看到raw8已經被刪除  
  18. [oracle@node1 crs_1]$ ocrcheck  
  19. Status of Oracle Cluster Registry is as follows :  
  20.          Version                  :          2  
  21.          Total space (kbytes)     :     153496  
  22.          Used space (kbytes)      :       3816  
  23.          Available space (kbytes) :     149680  
  24.          ID                       :  497615595  
  25.          Device/File Name         : /dev/raw/raw7  
  26.                                     Device/File integrity check succeeded  
  27.   
  28.                                     Device/File not configured  
  29.   
  30.          Cluster registry integrity check succeeded 

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

相關文章