RMAN-06207和RMAN-06208错误解决

在给一个客户的Data Guard做RMAN清除陈旧的备份文件时,报了RMAN-06207和RMAN-06208错误,错误情况如下所示:

RMAN>  delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 7
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           407    04-MAY-12
Backup Piece       407    04-MAY-12          E:\RMANBAK\20120504_CTNA3ICJ.ARC
Backup Set           414    05-MAY-12
Backup Piece       414    05-MAY-12          E:\RMANBAK\20120505_D3NA66QT.ARC
Backup Set           413    05-MAY-12
Backup Piece       413    05-MAY-12          E:\RMANBAK\20120505_D4NA66QT.ARC
Backup Set           416    05-MAY-12
Backup Piece       416    05-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120505-01
Backup Set           419    06-MAY-12
Backup Piece       419    06-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120506-00
Backup Set           420    06-MAY-12
Backup Piece       420    06-MAY-12          E:\RMANBAK\20120506_DANA8R6Q.ARC
Backup Set           421    06-MAY-12
Backup Piece       421    06-MAY-12          E:\RMANBAK\20120506_DBNA8R6Q.ARC
Backup Set           422    06-MAY-12
Backup Piece       422    06-MAY-12          E:\RMANBAK\20120506_DCNA8RFF.ARC
Backup Set           423    06-MAY-12
Backup Piece       423    06-MAY-12          E:\RMANBAK\20120506_DDNA8RM4.CTL
Backup Set           424    06-MAY-12
Backup Piece       424    06-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120506-01
Backup Set           428    16-MAY-12
Backup Piece       428    16-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120516-00
Backup Set           446    16-MAY-12
Backup Piece       446    16-MAY-12          E:\RMANBAK\20120516_E5NB5KBJ.CTL
Backup Set           447    16-MAY-12
Backup Piece       447    16-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120516-01
Backup Set           455    18-MAY-12
Backup Piece       455    18-MAY-12          E:\RMANBAK\20120518_EENBAHK1.CTL

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

RMAN-06207: WARNING: 14 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: Backup Piece    E:\RMANBAK\20120504_CTNA3ICJ.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120505_D3NA66QT.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120505_D4NA66QT.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120505-01
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120506-00
RMAN-06214: Backup Piece    E:\RMANBAK\20120506_DANA8R6Q.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120506_DBNA8R6Q.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120506_DCNA8RFF.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120506_DDNA8RM4.CTL
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120506-01
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120516-00
RMAN-06214: Backup Piece    E:\RMANBAK\20120516_E5NB5KBJ.CTL
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120516-01
RMAN-06214: Backup Piece    E:\RMANBAK\20120518_EENBAHK1.CTL

其实在这些文件在物理上都已经被清除掉了,可能有些状态不能匹配,这可能是由于我们做了主备切换导致有些日志状态出现问题.其实上面错误的地方已经告诉我们需要使用CROSSCHECK命令来修复备份片段的状态.

because the archivelog was produced by standby and crosscheck command was issued on primary OR vice-versaThis could also happen if a standby-primary switchover happened.

首先查看一下备份片段的状态,发现这里是AVAILABLE的,但是其实已经被删除掉了.后面手动做了crosscheck backuppiece操作,然后这个备份片变成了EXPIRED状态.

RMAN> list backuppiece 'E:\RMANBAK\20120504_CTNA3ICJ.ARC';

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
407     407     1   1   AVAILABLE   DISK        E:\RMANBAK\20120504_CTNA3ICJ.ARC

RMAN> crosscheck backuppiece 'E:\RMANBAK\20120504_CTNA3ICJ.ARC';

using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=E:\RMANBAK\20120504_CTNA3ICJ.ARC recid=407 stamp=782354839
Crosschecked 1 objects

RMAN> list backuppiece 'E:\RMANBAK\20120504_CTNA3ICJ.ARC';

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
407     407     1   1   EXPIRED     DISK        E:\RMANBAK\20120504_CTNA3ICJ.ARC

变成EXPIRED状态后,我们再次执行删除过期的备份,此时就成功运行了.对象从刚才的14个变成了13个.

RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 7
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           407    04-MAY-12
Backup Piece       407    04-MAY-12          E:\RMANBAK\20120504_CTNA3ICJ.ARC
Backup Set           414    05-MAY-12
Backup Piece       414    05-MAY-12          E:\RMANBAK\20120505_D3NA66QT.ARC
Backup Set           413    05-MAY-12
Backup Piece       413    05-MAY-12          E:\RMANBAK\20120505_D4NA66QT.ARC
Backup Set           416    05-MAY-12
Backup Piece       416    05-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120505-01
Backup Set           419    06-MAY-12
Backup Piece       419    06-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120506-00
Backup Set           420    06-MAY-12
Backup Piece       420    06-MAY-12          E:\RMANBAK\20120506_DANA8R6Q.ARC
Backup Set           421    06-MAY-12
Backup Piece       421    06-MAY-12          E:\RMANBAK\20120506_DBNA8R6Q.ARC
Backup Set           422    06-MAY-12
Backup Piece       422    06-MAY-12          E:\RMANBAK\20120506_DCNA8RFF.ARC
Backup Set           423    06-MAY-12
Backup Piece       423    06-MAY-12          E:\RMANBAK\20120506_DDNA8RM4.CTL
Backup Set           424    06-MAY-12
Backup Piece       424    06-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120506-01
Backup Set           428    16-MAY-12
Backup Piece       428    16-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120516-00
Backup Set           446    16-MAY-12
Backup Piece       446    16-MAY-12          E:\RMANBAK\20120516_E5NB5KBJ.CTL
Backup Set           447    16-MAY-12
Backup Piece       447    16-MAY-12          E:\RMANBAK\CONTROL_C-1813877374-20120516-01
Backup Set           455    18-MAY-12
Backup Piece       455    18-MAY-12          E:\RMANBAK\20120518_EENBAHK1.CTL

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=E:\RMANBAK\20120504_CTNA3ICJ.ARC recid=407 stamp=782354839
Deleted 1 objects

RMAN-06207: WARNING: 13 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: Backup Piece    E:\RMANBAK\20120505_D3NA66QT.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120505_D4NA66QT.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120505-01
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120506-00
RMAN-06214: Backup Piece    E:\RMANBAK\20120506_DANA8R6Q.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120506_DBNA8R6Q.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120506_DCNA8RFF.ARC
RMAN-06214: Backup Piece    E:\RMANBAK\20120506_DDNA8RM4.CTL
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120506-01
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120516-00
RMAN-06214: Backup Piece    E:\RMANBAK\20120516_E5NB5KBJ.CTL
RMAN-06214: Backup Piece    E:\RMANBAK\CONTROL_C-1813877374-20120516-01
RMAN-06214: Backup Piece    E:\RMANBAK\20120518_EENBAHK1.CTL

重复执行以上步骤,把剩余的清除掉就OK!
参考文档:

RMAN – DELETE BACKUPSET generates RMAN-06207 and RMAN-06208 errors [ID 275826.1]

DELETE OBSOLETE FAILS WITH RMAN-06207 RMAN-06208 [ID 301705.1]

分享到: 更多

Post a Comment

Your email is never published nor shared. Required fields are marked *