誤刪歸檔日誌除導致備份歸檔日誌失敗

wzq609發表於2014-06-23

背景:

       測試環境的歸檔日誌無意被刪除了,導致備份歸檔日誌的時候報RMAN-06059的錯誤,詳細的日誌:

RMAN> connect target *

2>

3> RUN {

4> ALLOCATE CHANNEL CH1 TYPE 'SBT_TAPE';

5> ALLOCATE CHANNEL CH2 TYPE 'SBT_TAPE';

6> SEND DEVICE TYPE 'SBT_TAPE' 'NSR_ENV=(NSR_CLIENT=joeonepiq)';

7> BACKUP ARCHIVELOG ALL filesperset 1 format 'PIQ_ARCH_%s_%p_%t' delete input;

8> BACKUP format 'PIQ_CONTROL_%s_%p_%T'  current controlfile;

9> RELEASE CHANNEL CH1;

10> RELEASE CHANNEL CH2;

11> }

12>

connected to target database: PIQ (DBID=1615856458)

using target database control file instead of recovery catalog

   

allocated channel: CH1

channel CH1: SID=88 device type=SBT_TAPE

channel CH1: NMDA Oracle v1.5.0

sent command to channel: CH1

   

allocated channel: CH2

channel CH2: SID=169 device type=SBT_TAPE

channel CH2: NMDA Oracle v1.5.0

sent command to channel: CH2

   

sent command to channel: CH1

sent command to channel: CH2

   

Starting backup at 23-JUN-14

released channel: CH1

released channel: CH2

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 06/23/2014 08:47:30

RMAN-06059: expected archived log not found, loss of archived log compromises recoverability

ORA-19625: error identifying file /oracle/PIQ/oraarch/PIQarch1_32074_791218442.dbf

ORA-27037: unable to obtain file status

IBM AIX RISC System/6000 Error: 2: A file or directory in the path name does not exist.

Additional information: 3

 

解決方法:

     RMAN>crosscheck archivelog all;

進行歸檔日誌的校驗;

     RMAN>delete expired archivelog all;

刪除失效的歸檔日誌;

 

RMAN> delete expired archivelog all;

   

released channel: ORA_DISK_1

released channel: ORA_DISK_2

released channel: ORA_DISK_3

released channel: ORA_DISK_4

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=88 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=169 device type=DISK

allocated channel: ORA_DISK_3

channel ORA_DISK_3: SID=244 device type=DISK

allocated channel: ORA_DISK_4

channel ORA_DISK_4: SID=330 device type=DISK

List of Archived Log Copies for database with db_unique_name PIQ

=====================================================================

Key Thrd Seq S Low Time

------- ---- ------- - ---------

31915 1 32074 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32074_791218442.dbf

 

31916 1 32075 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32075_791218442.dbf

 

31917 1 32076 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32076_791218442.dbf

 

31918 1 32077 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32077_791218442.dbf

 

31919 1 32078 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32078_791218442.dbf

 

31920 1 32079 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32079_791218442.dbf

 

31921 1 32080 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32080_791218442.dbf

 

31922 1 32081 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32081_791218442.dbf

 

31923 1 32082 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32082_791218442.dbf

 

31924 1 32083 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32083_791218442.dbf

 

31925 1 32084 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32084_791218442.dbf

 

31926 1 32085 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32085_791218442.dbf

 

31927 1 32086 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32086_791218442.dbf

 

31928 1 32087 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32087_791218442.dbf

 

31929 1 32088 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32088_791218442.dbf

 

31930 1 32089 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32089_791218442.dbf

 

31931 1 32090 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32090_791218442.dbf

 

31932 1 32091 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32091_791218442.dbf

Do you really want to delete the above objects (enter YES or NO)? YES

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32074_791218442.dbf RECID=31915 STAMP=845742679

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32075_791218442.dbf RECID=31916 STAMP=845742682

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32076_791218442.dbf RECID=31917 STAMP=845742686

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32077_791218442.dbf RECID=31918 STAMP=845742707

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32078_791218442.dbf RECID=31919 STAMP=845742710

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32079_791218442.dbf RECID=31920 STAMP=845742713

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32080_791218442.dbf RECID=31921 STAMP=845742719

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32081_791218442.dbf RECID=31922 STAMP=845742793

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32082_791218442.dbf RECID=31923 STAMP=845742796

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32083_791218442.dbf RECID=31924 STAMP=845742800

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32084_791218442.dbf RECID=31925 STAMP=845742952

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32085_791218442.dbf RECID=31926 STAMP=845742958

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32086_791218442.dbf RECID=31927 STAMP=845743016

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32087_791218442.dbf RECID=31928 STAMP=845743362

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32088_791218442.dbf RECID=31929 STAMP=845743365

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32089_791218442.dbf RECID=31930 STAMP=845743370

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32090_791218442.dbf RECID=31931 STAMP=845743372

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32091_791218442.dbf RECID=31932 STAMP=845743376

Deleted 18 EXPIRED objects

 

原因分析:

資料庫的archivelog檔案被手工刪除,但是控制檔案仍然記錄了歸檔日誌的備份資訊,rman做歸檔備份時還是要備份被無意刪除的檔案,但檔案已經被物理刪除,磁碟上找不到就會報錯,透過rman crosscheck archivelog all也可以看到檔案已經失效,所以備份之前先將歸檔檔案從控制檔案中刪除,然後備份就會成功;

 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

本文作者:JOHN

ORACLE技術部落格:ORACLE 獵人筆記               資料庫技術群:367875324 (請備註ORACLE管理 )  

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

相關文章