Oracle 10g RAC OCR 和 VotingDisk 的備份與恢復
Oracle 10g RAC OCR 和 VotingDisk 的備份與恢復 收藏
300) { text = text + "\r\n\n本文來自CSDN部落格,轉載請標明出處:" + location.href; clipboardData.setData("text", text); } }, 100); } }
Oracle RAC 中OCR 和Voting Disk 備份在我的blog: Oracle RAC 常用維護工具和命令 中已經有說明,現在再次把它單獨拿出做一個說明, 因為OCR 和 Voting Disk 對於RAC 系統來說太重要了。
Oracle RAC 常用維護工具和命令
http://blog.csdn.net/tianlesoftware/archive/2010/03/09/5358573.aspx
一 Voting Disk
Voting Disk 這個檔案主要用於記錄節點成員狀態,在出現腦裂時,決定那個Partion獲得控制權,其他的Partion必須從叢集中剔除。Voting disk使用的是一種“多數可用演算法”,如果有多個Voting disk,,則必須一半以上的Votedisk同時使用,Clusterware才能正常使用。 比如配置了4個Votedisk,壞一個Votedisk,叢集可以正常工作,如果壞了2個,則不能滿足半數以上,叢集會立即宕掉,所有節點立即重啟,所以如果新增Votedisk,儘量不要只新增一個,而應該新增2個。這點和OCR 不一樣。OCR 只需配置一個。
檢視votedisk的位置:
[root@rac1 ~]# crsctl query css votedisk
0. 0 /dev/raw/raw2
located 1 votedisk(s).
備份votedisk盤:
[root@raw1 bin]# dd if=/dev/raw/raw2 of=/home/oracle/voting_disk.bak
294912+0 records in
294912+0 records out
恢復votedisk盤:
[root@raw1 bin]# dd if=/home/oracle/voting_disk.bak of=/dev/raw/raw2
294912+0 records in
294912+0 records out
透過Strings 命令來檢視 voting disk 的內容
[root@raw1 oracle]# strings voting_disk.bak |sort -u
fSLC
ssLckcoT
SslcLlik
sSlcrEp0
}|{z
二 OCR
Oracle Clusterware把整個叢集的配置資訊放在共享儲存上,這個儲存就是OCR Disk. 在整個叢集中,只有一個節點能對OCR Disk 進行讀寫操作,這個節點叫作Master Node,所有節點都會在記憶體中保留一份OCR的複製,同時有一個OCR Process 從這個記憶體中讀取內容。 OCR 內容發生改變時,由Master Node的OCR Process負責同步到其他節點的OCR Process。
因為OCR的內容如此重要,所以Oracle 每4個小時對其做一次備份,並且保留最後的3個備份,以及前一天,前一週的最後一個備份。 這個備份由Master Node CRSD程式完成,備份的預設位置是$CRS_HOME\crs\cdata\
[root@raw1 crs]# pwd
/u01/app/oracle/product/crs/cdata/crs
[root@raw1 crs]# ls -lrt
total 22632
-rw-r--r-- 1 root root 4595712 Mar 9 01:03 backup02.ocr
-rw-r--r-- 1 root root 4620288 Mar 9 21:20 backup01.ocr
-rw-r--r-- 1 root root 4632576 Apr 8 19:46 backup00.ocr
-rw-r--r-- 1 root root 4632576 Apr 8 19:46 day.ocr
-rw-r--r-- 1 root root 4632576 Apr 8 19:46 week.ocr
在安裝clusterware過程中,如果選擇External Redundancy冗餘方式,則只能輸入一個OCR磁碟位置。 但是Oracle允許配置兩個OCR 磁碟互為映象,以防止OCR 磁碟的單點故障。 OCR 磁碟和Votedisk磁碟不一樣,OCR磁碟最多隻能有兩個,一個Primary OCR 和一個Mirror OCR。
Oracle 推薦在對叢集做調整時,比如增加,刪除節點之前,應該對OCR做一個備份,可以使用export 備份到指定檔案,如果做了replace或者restore 等操作,Oracle 建議使用 cluvfy comp ocr -n all 命令來做一次全面的檢查。對OCR的備份與恢復,我們可以使用ocrconfig 命令。
[root@raw1 bin]# ./ocrconfig --help
Name:
ocrconfig - Configuration tool for Oracle Cluster Registry.
Synopsis:
ocrconfig [option]
option:
-export
- Export cluster register contents to a file
-import
-upgrade [
- Upgrade cluster registry from previous version
-downgrade [-version
- Downgrade cluster registry to the specified version
-backuploc
-showbackup - Show backup information
-restore
-replace ocr|ocrmirror [
-overwrite - Overwrite OCR configuration on disk
-repair ocr|ocrmirror
-help - Print out this help information
Note:
A log file will be created in
$ORACLE_HOME/log/
you have file creation privileges in the above directory before
running this tool.
OCR 備份與恢復
-- 檢視自助備份
[root@raw1 bin]# ./ocrconfig -showbackup
1) 首先關閉所有節點的CRS
[root@raw1 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
2) 用root 使用者匯出OCR內容
[root@raw1 bin]# ./ocrconfig -export /u01/ocr.exp
3) 重啟CRS
[root@raw1 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
4) 檢查CRS 狀態
[root@raw1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
5)破壞OCR內容
[root@raw1 bin]# dd if=/dev/zero of=/dev/raw/raw1 bs=1024 count=102400
102400+0 records in
102400+0 records out
6) 檢查OCR一致性
[root@raw1 bin]# ./ocrcheck
PROT-601: Failed to initialize ocrcheck
7)使用cluvfy 工具檢查一致性
[root@raw1 cluvfy]# ./runcluvfy.sh comp ocr -n all
Verifying OCR integrity
Unable to retrieve nodelist from Oracle clusterware.
Verification cannot proceed.
8) 使用Import 恢復OCR 內容
[root@raw1 bin]# ./ocrconfig -import /u01/ocr.exp
如果不用import , 也使用恢復命令
[root@raw1 bin]# ./ocrconfig –restore $CRS_HOME/cdata/crs/自動備份.ocr
9)再次檢查OCR
[root@raw1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 147352
Used space (kbytes) : 4364
Available space (kbytes) : 142988
ID : 610419116
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
10) 使用cluvfy工具檢查
[root@raw1 cluvfy]# ./runcluvfy.sh comp ocr -n all來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-672218/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle RAC OCR 和 VotingDisk 的備份與恢復Oracle
- Oracle 10G RAC的ocr備份恢復Oracle 10g
- Oracle Rac Ocr VotingDisk 備份Oracle
- Votingdisk, OCR, ASM 相關資訊及備份與恢復ASM
- Oracle OCR的備份與恢復Oracle
- Oracle RAC備份與恢復Oracle
- Oracle 無備份情況恢復ocr和olrOracle
- oracle rac 在asm下的備份與恢復OracleASM
- Oracle 10g rac+asm 磁碟頭備份與恢復實驗Oracle 10gASM
- Oracle 10gR2 RAC 沒有備份的情況下恢復ocr和voteOracle 10g
- ORACLE RAC資料庫的備份與恢復(6)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(5)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(4)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(3)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(2)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(1)Oracle資料庫
- Oracle 12c 備份恢復OCR(Oracle Cluster Registry)Oracle
- Oracle 備份和恢復Oracle
- Oracle10g RAC voting disk及OCR 的映象,備份恢復[final]Oracle
- oracle 10g RMAN備份及恢復Oracle 10g
- Oracle 備份 與 恢復 概述Oracle
- Oracle備份與恢復 (zt)Oracle
- Oracle備份與恢復案例Oracle
- Oracle備份與恢復(轉)Oracle
- 【備份恢復】Oracle 資料備份與恢復微實踐Oracle
- zt_oracle10g rac real application cluster ocr and voting disk備份恢復OracleAPP
- oracle冷備份、恢復和異機恢復Oracle
- 備份與恢復oracle_homeOracle
- Oracle 備份與恢復(一):概念Oracle
- oracle備份與恢復雜記Oracle
- Oracle備份與恢復入門Oracle
- Oracle備份與恢復案例 (zt)Oracle
- Oracle資料庫備份與恢復之三:OS備份/使用者管理的備份與恢復Oracle資料庫
- Oracle 備份和恢復介紹Oracle
- 備份與恢復--利用備份的控制檔案恢復
- 備份與恢復系列 十一 控制檔案的備份與恢復
- Oracle備份恢復之熱備份恢復及異機恢復Oracle
- Oracle備份與恢復【丟失控制檔案的恢復】Oracle