在dataguard上,使用rman串連catalog資料庫進行備份。備份的時候,rman的日誌報錯如下:
Starting backup at 2014/04/23-10:02:02
archived log /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201410_9ofpggpg_.arc not found or out of sync with catalog
skipping inaccessible file /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201410_9ofpggpg_.arc
archived log /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201411_9ofqblsm_.arc not found or out of sync with catalog
skipping inaccessible file /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201411_9ofqblsm_.arc
archived log /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201412_9ofr6px7_.arc not found or out of sync with catalog
skipping inaccessible file /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201412_9ofr6px7_.arc
archived log /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201413_9ofs2v2m_.arc not found or out of sync with catalog
skipping inaccessible file /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201413_9ofs2v2m_.arc
RMAN-06061: WARNING: skipping archived log compromises recoverability
released channel: ch00
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 04/23/2014 10:02:23
RMAN-00600: internal error, arguments [13200] [] [] [] []
一開始,根據文檔:341337.1,以為造成這個報錯的原因是,註冊在catalog庫中的資訊,在備份時被調用,由於備份是在dataguard庫發起,在dataguard主機上去找對應的路徑,就認為歸檔日誌被人為的刪除了。因此就報錯inaccessible。
建議把生產和dataguard的FRA區設定同一目錄。(或者用link指向同一目錄),然後在rman中:
1. Resync catalog
2. Crosscheck archivelog all
3. Delete expired archivelog all;
但是後來這樣處理後還是繼續報錯。
最後發現,還是DB_UNIQUE_NAME的問題,由於沒有配置DB_UNIQUE_NAME參數,導致串連到CATALOG庫備份時,同一個記錄檔會出現兩個位置,引起備份異常:
g3ah1040:mobprd > rman target / catalog catuser/catpwd@cattns
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Apr 23 10:31:53 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: mobprd (DBID=3585792802)
connected to recovery catalog database
RMAN> list archivelog sequence 201410; <<<<<<由於dataguard沒有配置DB_UNIQUE_NAME,同一個sequence#的歸檔在catalog庫有2條記錄。
List of Archived Log Copies for database with db_unique_name mobprd
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
539685219 1 201410 A 23-APR-14
Name: /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201410_9ofpggpg_.arc
539722379 1 201410 A 23-APR-14
Name: /aabb/qb/mobprd/log/fra/mobprd/archivelog/2014_04_23/o1_mf_1_201410_9ofpghkq_.arc
題外話:關於DB_UNIQUE_NAME,一些公司為了減輕對生產的壓力,選擇備份在dataguard上進行,主庫是rac+asm,備庫是檔案系統。在進行備份的恢複測試時,如果沒有設定DB_UNIQUE_NAME,即使備份是檔案系統上的檔案,但是在restore的時候,會遇到restore去asm的路徑的問題,但是這個asm的路徑其實是不存在的。