【OCR】OCR備份策略及備份介質有效性驗證
Oracle RAC的OCR存放著叢集和資料庫的重要配置資訊。因此掌握其備份和恢復的方法甚是重要。我們可以對OCR進行手工邏輯備份,也可以依賴系統的自動備份策略。
系統對OCR的自動備份策略如下:
①.每4個小時自動生成一份OCR備份,並保留最後3個備份。
②.CRSD程式還會在每天開始時生成OCR備份,並保留最後2個備份。
③.CRSD程式還會在每週開始時生成OCR備份,並保留最後2個備份。
因此正常情況下OCR的備份目錄下應該有最近7個備份。
在此,給出OCR的備份和恢復策略。
1.為了安全起見,生成一份OCR的邏輯備份
[root@rac1 ~]# /oracle/app/crs/bin/ocrconfig -export ocr_logical_backup
[root@rac1 ~]# ls -l ocr_logical_backup
-rw-r--r-- 1 root root 103969 Nov 5 20:10 ocr_logical_backup
2.確定OCR的物理備份資訊
[root@rac1 ~]# /oracle/app/crs/bin/ocrconfig -showbackup
rac1 2010/10/26 05:20:57 /oracle/app/crs/cdata/crs
rac1 2010/10/26 01:20:56 /oracle/app/crs/cdata/crs
rac2 2010/10/24 22:34:18 /oracle/app/crs/cdata/crs
rac1 2010/10/26 01:20:56 /oracle/app/crs/cdata/crs
rac1 2010/10/22 23:54:15 /oracle/app/crs/cdata/crs
[root@rac1 ~]# ls -l /oracle/app/crs/cdata/crs
total 23560
-rw-r--r-- 1 root root 4812800 Oct 26 05:20 backup00.ocr
-rw-r--r-- 1 root root 4812800 Oct 26 01:20 backup01.ocr
-rw-r--r-- 1 root root 4812800 Oct 24 15:54 backup02.ocr
-rw-r--r-- 1 root root 4812800 Oct 27 02:10 day_.ocr
-rw-r--r-- 1 root root 4812800 Oct 26 01:20 day.ocr
-rw-r--r-- 1 root root 4812800 Oct 29 23:04 week_.ocr
-rw-r--r-- 1 root root 4812800 Oct 22 23:54 week.ocr
以上三個備份即為系統自動生成的7個備份。
3.在RAC的所有節點上停止CRS資源。完成確認CRS狀態
1)停止CRS資源之前狀態
RACDB1@rac1 /home/oracle$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE ONLINE rac2
ora.RACDB.db application ONLINE ONLINE rac2
ora....DB1.srv application ONLINE ONLINE rac1
ora....DB2.srv application ONLINE ONLINE rac2
ora.....taf.cs application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
2)分別停止兩個節點上的CRS資源
RACDB1@rac1 /home/oracle$ srvctl stop nodeapps -n rac1
RACDB1@rac1 /home/oracle$ srvctl stop nodeapps -n rac2
3)確認CRS資源已經停止完畢
RACDB1@rac1 /home/oracle$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application OFFLINE OFFLINE
ora....B2.inst application OFFLINE OFFLINE
ora.RACDB.db application OFFLINE OFFLINE
ora....DB1.srv application OFFLINE OFFLINE
ora....DB2.srv application OFFLINE OFFLINE
ora.....taf.cs application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
4.停止兩個節點上的CRS
1)停止第一個節點上的CRS
[root@rac1 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
2)停止第二個節點上的CRS
[root@rac2 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
5.使用最近的一次備份恢復OCR
[root@rac1 ~]# /oracle/app/crs/bin/ocrconfig -restore /oracle/app/crs/cdata/crs/backup00.ocr
[root@rac1 ~]#
6.重新啟動兩個節點上的CRS
1)啟動第一個節點上的CRS
[root@rac1 ~]# crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
此處稍等幾分鐘後,確認第一節點上的CRS資源已經成功啟動。
[root@rac1 ~]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE OFFLINE
ora.RACDB.db application ONLINE ONLINE rac1
ora....DB1.srv application ONLINE ONLINE rac1
ora....DB2.srv application ONLINE OFFLINE
ora.....taf.cs application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE OFFLINE
ora....C2.lsnr application ONLINE OFFLINE
ora.rac2.gsd application ONLINE OFFLINE
ora.rac2.ons application ONLINE OFFLINE
ora.rac2.vip application ONLINE ONLINE rac1
2)啟動第二個節點上的CRS
[root@rac2 ~]# crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
此處需要稍等幾分鐘,然後確認所有節點上的CRS資源均已成功啟動。
[root@rac1 ~]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE ONLINE rac2
ora.RACDB.db application ONLINE ONLINE rac1
ora....DB1.srv application ONLINE ONLINE rac1
ora....DB2.srv application ONLINE ONLINE rac2
ora.....taf.cs application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
7.檢視RAC所有節點上OCR的狀態是否正常
[root@rac1 bin]# su - oracle
RACDB1@rac1 /home/oracle$ /oracle/app/crs/bin/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.
到此,OCR恢復成功。
8.小結
鑑於OCR的重要性,Oracle預設提供了系統級別的備份方法。這樣可以避免故障出現時由於沒有備份導致OCR無法恢復的煩惱。即便如此,OCR的備份是否生成成功和其有效性檢查伊然重要。與此同時亦可以結合手工備份來保證備份萬無一失。
Good luck.
secooler
10.11.05
-- The End --
系統對OCR的自動備份策略如下:
①.每4個小時自動生成一份OCR備份,並保留最後3個備份。
②.CRSD程式還會在每天開始時生成OCR備份,並保留最後2個備份。
③.CRSD程式還會在每週開始時生成OCR備份,並保留最後2個備份。
因此正常情況下OCR的備份目錄下應該有最近7個備份。
在此,給出OCR的備份和恢復策略。
1.為了安全起見,生成一份OCR的邏輯備份
[root@rac1 ~]# /oracle/app/crs/bin/ocrconfig -export ocr_logical_backup
[root@rac1 ~]# ls -l ocr_logical_backup
-rw-r--r-- 1 root root 103969 Nov 5 20:10 ocr_logical_backup
2.確定OCR的物理備份資訊
[root@rac1 ~]# /oracle/app/crs/bin/ocrconfig -showbackup
rac1 2010/10/26 05:20:57 /oracle/app/crs/cdata/crs
rac1 2010/10/26 01:20:56 /oracle/app/crs/cdata/crs
rac2 2010/10/24 22:34:18 /oracle/app/crs/cdata/crs
rac1 2010/10/26 01:20:56 /oracle/app/crs/cdata/crs
rac1 2010/10/22 23:54:15 /oracle/app/crs/cdata/crs
[root@rac1 ~]# ls -l /oracle/app/crs/cdata/crs
total 23560
-rw-r--r-- 1 root root 4812800 Oct 26 05:20 backup00.ocr
-rw-r--r-- 1 root root 4812800 Oct 26 01:20 backup01.ocr
-rw-r--r-- 1 root root 4812800 Oct 24 15:54 backup02.ocr
-rw-r--r-- 1 root root 4812800 Oct 27 02:10 day_.ocr
-rw-r--r-- 1 root root 4812800 Oct 26 01:20 day.ocr
-rw-r--r-- 1 root root 4812800 Oct 29 23:04 week_.ocr
-rw-r--r-- 1 root root 4812800 Oct 22 23:54 week.ocr
以上三個備份即為系統自動生成的7個備份。
3.在RAC的所有節點上停止CRS資源。完成確認CRS狀態
1)停止CRS資源之前狀態
RACDB1@rac1 /home/oracle$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE ONLINE rac2
ora.RACDB.db application ONLINE ONLINE rac2
ora....DB1.srv application ONLINE ONLINE rac1
ora....DB2.srv application ONLINE ONLINE rac2
ora.....taf.cs application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
2)分別停止兩個節點上的CRS資源
RACDB1@rac1 /home/oracle$ srvctl stop nodeapps -n rac1
RACDB1@rac1 /home/oracle$ srvctl stop nodeapps -n rac2
3)確認CRS資源已經停止完畢
RACDB1@rac1 /home/oracle$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application OFFLINE OFFLINE
ora....B2.inst application OFFLINE OFFLINE
ora.RACDB.db application OFFLINE OFFLINE
ora....DB1.srv application OFFLINE OFFLINE
ora....DB2.srv application OFFLINE OFFLINE
ora.....taf.cs application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
4.停止兩個節點上的CRS
1)停止第一個節點上的CRS
[root@rac1 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
2)停止第二個節點上的CRS
[root@rac2 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
5.使用最近的一次備份恢復OCR
[root@rac1 ~]# /oracle/app/crs/bin/ocrconfig -restore /oracle/app/crs/cdata/crs/backup00.ocr
[root@rac1 ~]#
6.重新啟動兩個節點上的CRS
1)啟動第一個節點上的CRS
[root@rac1 ~]# crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
此處稍等幾分鐘後,確認第一節點上的CRS資源已經成功啟動。
[root@rac1 ~]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE OFFLINE
ora.RACDB.db application ONLINE ONLINE rac1
ora....DB1.srv application ONLINE ONLINE rac1
ora....DB2.srv application ONLINE OFFLINE
ora.....taf.cs application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE OFFLINE
ora....C2.lsnr application ONLINE OFFLINE
ora.rac2.gsd application ONLINE OFFLINE
ora.rac2.ons application ONLINE OFFLINE
ora.rac2.vip application ONLINE ONLINE rac1
2)啟動第二個節點上的CRS
[root@rac2 ~]# crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
此處需要稍等幾分鐘,然後確認所有節點上的CRS資源均已成功啟動。
[root@rac1 ~]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE ONLINE rac2
ora.RACDB.db application ONLINE ONLINE rac1
ora....DB1.srv application ONLINE ONLINE rac1
ora....DB2.srv application ONLINE ONLINE rac2
ora.....taf.cs application ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
7.檢視RAC所有節點上OCR的狀態是否正常
[root@rac1 bin]# su - oracle
RACDB1@rac1 /home/oracle$ /oracle/app/crs/bin/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.
到此,OCR恢復成功。
8.小結
鑑於OCR的重要性,Oracle預設提供了系統級別的備份方法。這樣可以避免故障出現時由於沒有備份導致OCR無法恢復的煩惱。即便如此,OCR的備份是否生成成功和其有效性檢查伊然重要。與此同時亦可以結合手工備份來保證備份萬無一失。
Good luck.
secooler
10.11.05
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28389881/viewspace-1251206/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- (轉)【OCR】OCR備份策略及備份介質有效性驗證
- Oracle Rac Ocr VotingDisk 備份Oracle
- OCR自動備份目錄cdata下出現大量的OCR備份檔案問題
- Oracle OCR的備份與恢復Oracle
- Oracle10g OCR及Voting Disk的備份Oracle
- Oracle備份及備份策略及基於Linux下 Oracle 備份策略(RMAN)OracleLinux
- oracle11g rman驗證備份有效性Oracle
- Votingdisk, OCR, ASM 相關資訊及備份與恢復ASM
- 【rman備份策略】實驗
- RMAN 驗證 資料檔案 和 備份 的有效性
- Oracle 無備份情況恢復ocr和olrOracle
- Oracle 10G RAC的ocr備份恢復Oracle 10g
- Oracle 12c 備份恢復OCR(Oracle Cluster Registry)Oracle
- Oracle RAC OCR 和 VotingDisk 的備份與恢復Oracle
- 2 Day DBA-管理方案物件-執行備份和恢復-備份資料庫-驗證備份並測試你的備份策略物件資料庫
- oracle rman備份驗證和備份進度監控Oracle
- RAC關鍵資訊(OCR/VOTE DISK/ASM DISK HEADER)備份ASMHeader
- 【OCR】無法轉儲OCR備份檔案內容——PROT-302: Failed to initialize ocrdumpAI
- 備份保留策略
- rman 備份策略
- ORACLE備份策略Oracle
- Mac備份策略:更好的Mac備份指南Mac
- 驗證oracle 11g資料庫的RMAN備份的有效性Oracle資料庫
- oracle rman備份及策略設定Oracle
- Oracle10g RAC環境OCR的新增、刪除、備份Oracle
- RMAN說,我能備份(9)--RMAN增量備份與備份保留策略
- oracle rman備份驗證和備份/恢復進度監控Oracle
- Oracle10g RAC voting disk及OCR 的映象,備份恢復[final]Oracle
- SQL Server 備份與恢復之六:介質集與備份集SQLServer
- oracle備份和恢復策略簡介Oracle
- oracle 增量備份恢復驗證Oracle
- ORACLE備份策略(轉)Oracle
- linux 備份策略Linux
- 資料備份策略
- SQL Server 備份策略SQLServer
- ORACLE備份策略(1)Oracle
- ORACLE備份策略(2)Oracle
- ORACLE備份策略(3)Oracle