RMAN ---delete obsolete 不能删除 控制文件copy

RMAN ---delete obsolete  不能删除 控制文件copy


说明 /tmp/contrlfile   /tmp/controlfile.bkp    /home/oracle/control01.ctl  已经通过os命令删除了
现在的疑问是如何删除这些 obsolete的记录:

以下是测试结果:

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
-------------------- ------ ------------------ --------------------
Control File Copy     2      22-APR-13          /tmp/contrlfile.
Control File Copy     3      22-APR-13          /tmp/controlfile.bkp
Control File Copy     4      23-JUL-13          /home/oracle/control01.ctl


RMAN>  delete obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     2      22-APR-13          /tmp/contrlfile.
Control File Copy     3      22-APR-13          /tmp/controlfile.bkp
Control File Copy     4      23-JUL-13          /home/oracle/control01.ctl
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: Datafile Copy   /tmp/contrlfile.
RMAN-06214: Datafile Copy   /tmp/controlfile.bkp
RMAN-06214: Datafile Copy   /home/oracle/control01.ctl


----根据上面的提示,使用crosscheck 检测

RMAN> crosscheck backup of database;
specification does not match any backup in the repository

RMAN>  crosscheck backup of controlfile;
specification does not match any backup in the repository

RMAN> delete expired backup;
specification does not match any backup in the repository

RMAN> list backup summary;

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
40      B  F  A DISK        19-NOV-13       1       1       NO         TAG20131119T072057
RMAN>

请教下大家如何删除以上的 obsolete 记录!

 

 

解决方法:

RMAN> CROSSCHECK COPY;

specification does not match any datafile copy in the repository
specification does not match any archived log in the repository
validation failed for control file copy
control file copy file name=/home/oracle/control01.ctl RECID=4 STAMP=821523959
validation failed for control file copy
control file copy file name=/tmp/controlfile.bkp RECID=3 STAMP=813384451
validation failed for control file copy
control file copy file name=/tmp/contrlfile. RECID=2 STAMP=813384351
Crosschecked 3 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
-------------------- ------ ------------------ --------------------
Control File Copy     2      22-APR-13          /tmp/contrlfile.
Control File Copy     3      22-APR-13          /tmp/controlfile.bkp
Control File Copy     4      23-JUL-13          /home/oracle/control01.ctl

RMAN> delete expired copy;

specification does not match any datafile copy in the repository
specification does not match any archived log in the repository
List of Control File Copies
===========================

Key     S Completion Time Ckp SCN    Ckp Time      
------- - --------------- ---------- ---------------
4       X 23-JUL-13       2243850    23-JUL-13      
        Name: /home/oracle/control01.ctl
        Tag: TAG20130723T090559

3       X 22-APR-13       1495438    22-APR-13      
        Name: /tmp/controlfile.bkp
        Tag: TAG20130422T040730

2       X 22-APR-13       1490032    22-APR-13      
        Name: /tmp/contrlfile.
        Tag: TAG20130422T040550


Do you really want to delete the above objects (enter YES or NO)? yes
deleted control file copy
control file copy file name=/home/oracle/control01.ctl RECID=4 STAMP=821523959
deleted control file copy
control file copy file name=/tmp/controlfile.bkp RECID=3 STAMP=813384451
deleted control file copy
control file copy file name=/tmp/contrlfile. RECID=2 STAMP=813384351
Deleted 3 EXPIRED objects


RMAN> report expired;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "expired": expecting one of: "device, need, obsolete, schema, unrecoverable"
RMAN-01007: at line 1 column 8 file: standard input

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
no obsolete backups found

RMAN>

 

 

总结:

Crosschecking Backups

The CROSSCHECK command checks whether RMAN backups and copies in the repository are still readable by RMAN. Assuming that you have configured automatic channels, you can run these commands:

RMAN> CROSSCHECK BACKUP; # checks RMAN backups on configured devices
RMAN> CROSSCHECK COPY; # checks RMAN image copies on configured devices

这两个命令还是有点区别的,主要还是要认清楚备份的类型。

If backups are stored with a media manager and sbt channels are not configured, then you must allocate a maintenance channel before CROSSCHECK and DELETE commands on sbt devices:

RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;---如果使用磁带库来备份,需要开一个专用的维护通道。
RMAN> CROSSCHECK BACKUP;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值