RMAN: Use CROSSCHECK command to fix status

What to do when an obsolete rman object can't be found.

Make sure ORACLE_HOME, ORACLE_SID and PATH are set correctly

 - rman also comes with X11R6 so make sure that ORACLE_HOME/bin is first in your PATH

Log Into RMAN

rman target /

Find the mismatched objects

 

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log          90     16-AUG-11          /u01/app/oracle/arch1/1_5_759334699.dbf
Archive Log          91     16-AUG-11          /u01/app/oracle/orch2/1_5_759334699.dbf
Archive Log          92     16-AUG-11          /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_08_16/o1_mf_1_5_74n5v4dh_.arc

有三个archive log文件已过时。。

RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log          90     16-AUG-11          /u01/app/oracle/arch1/1_5_759334699.dbf
Archive Log          91     16-AUG-11          /u01/app/oracle/orch2/1_5_759334699.dbf
Archive Log          92     16-AUG-11          /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_08_16/o1_mf_1_5_74n5v4dh_.arc

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

RMAN-06207: WARNING: 3 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Archivelog      /u01/app/oracle/arch1/1_5_759334699.dbf
RMAN-06214: Archivelog      /u01/app/oracle/orch2/1_5_759334699.dbf
RMAN-06214: Archivelog      /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_08_16/o1_mf_1_5_74n5v4dh_.arc

此时报错,无法删除

RMAN-06207: WARNING: 3 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status  

提示用crosscheck命令核对

RMAN> crosscheck archivelog '/u01/app/oracle/arch1/1_5_759334699.dbf';

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=159 devtype=DISK
validation failed for archived log
archive log filename=/u01/app/oracle/arch1/1_5_759334699.dbf recid=90 stamp=759337700
Crosschecked 1 objects

RMAN> delete noprompt obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log          90     16-AUG-11          /u01/app/oracle/arch1/1_5_759334699.dbf
Archive Log          91     16-AUG-11          /u01/app/oracle/orch2/1_5_759334699.dbf
Archive Log          92     16-AUG-11          /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_08_16/o1_mf_1_5_74n5v4dh_.arc
deleted archive log
archive log filename=/u01/app/oracle/arch1/1_5_759334699.dbf recid=90 stamp=759337700
Deleted 1 objects


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26043157/viewspace-705004/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26043157/viewspace-705004/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值