在OS手工删除归档后用RMAN备份归档报错

RMAN> backup archivelog all format '/data/backup/%d_ARC_%T_%s_%p.bak' delete all input   ;

Starting backup at 22-DEC-11
current log archived
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 12/22/2011 14:41:53
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /data/oracle/flash_recovery_area/LXC/archivelog/1_138_764162411.dbf
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

RMAN> CROSSCHECK ARCHIVELOG ALL;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
validation succeeded for archived log
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_136_764162411.dbf recid=126 stamp=770559336
validation succeeded for archived log
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_137_764162411.dbf recid=127 stamp=770559338
validation failed for archived log
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_138_764162411.dbf recid=128 stamp=770559345
validation succeeded for archived log
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_139_764162411.dbf recid=129 stamp=770560433
validation succeeded for archived log
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_1_770566677.dbf recid=130 stamp=770568113
Crosschecked 5 objects


RMAN> backup archivelog all format '/data/backup/%d_ARC_%T_%s_%p.bak' delete all input   ;

Starting backup at 22-DEC-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=136 recid=126 stamp=770559336
input archive log thread=1 sequence=137 recid=127 stamp=770559338
input archive log thread=1 sequence=139 recid=129 stamp=770560433
channel ORA_DISK_1: starting piece 1 at 22-DEC-11
channel ORA_DISK_1: finished piece 1 at 22-DEC-11
piece handle=/data/backup/LXC_ARC_20111222_16_1.bak tag=TAG20111222T144214 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_136_764162411.dbf recid=126 stamp=770559336
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_137_764162411.dbf recid=127 stamp=770559338
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_139_764162411.dbf recid=129 stamp=770560433
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=130 stamp=770568113
input archive log thread=1 sequence=2 recid=131 stamp=770568133
channel ORA_DISK_1: starting piece 1 at 22-DEC-11
channel ORA_DISK_1: finished piece 1 at 22-DEC-11
piece handle=/data/backup/LXC_ARC_20111222_17_1.bak tag=TAG20111222T144214 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_1_770566677.dbf recid=130 stamp=770568113
archive log filename=/data/oracle/flash_recovery_area/LXC/archivelog/1_2_770566677.dbf recid=131 stamp=770568133
Finished backup at 22-DEC-11

---其实只要做完crosscheck archivelog all; 就可以备份了,并不需要 delete expired archivelog all

当删除了某个归档(1_3_770566677)后 用RMAN>list archivelog all ; 查看的时候会有:

RMAN>  list archivelog all;

using target database control file instead of recovery catalog

List of Archived Log Copies
Key     Thrd Seq     S      Low Time    Name
-------     ---- -------  -           ---------        ----
132     1    3         A          22-DEC-11 /data/oracle/flash_recovery_area/LXC/archivelog/1_3_770566677.dbf
133     1    4         A          22-DEC-11 /data/oracle/flash_recovery_area/LXC/archivelog/1_4_770566677.dbf
可以看到1_138_764162411.dbf 状态是A

但是这个文件已经不在硬盘上了,

做完crosscheck archivelog all;

再 list archivelog all;看:

Key     Thrd Seq     S      Low Time    Name
-------     ---- -------  -           ---------        ----
132     1    3         X          22-DEC-11 /data/oracle/flash_recovery_area/LXC/archivelog/1_3_770566677.dbf
133     1    4         A          22-DEC-11 /data/oracle/flash_recovery_area/LXC/archivelog/1_4_770566677.dbf

状态变成X了。这个时候在用 backup archivelog all 就不会报错了。但是在 list archivelog all;里面还有这个记录

用delete expired archivelog all; 可以删掉无效的记录。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值