系统大全为您提供
说明 /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;
以上就是系统大全给大家介绍的如何使的方法都有一定的了解了吧,好了,如果大家还想了解更多的资讯,那就赶紧点击系统大全官网吧。
本文来自系统大全http://www.win7cn.com/如需转载请注明!推荐:win7纯净版