背景:
测试环境的归档日志无意被删除了,导致备份归档日志的时候报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管理 )
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++