SQL> select * from v$version;
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
RMAN 下CROSSCHECK命令 详解
(RMAN-06207 & RMAN-06208)根据蓝色字体部分决定用哪一个关键字
其中一种情况(用crosscheck copy解决)
RMAN> report obsolete;
控制文件副本 7 17-4月 -13 E:\CONTROLFILE.TXT
RMAN> delete obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
使用通道 ORA_DISK_1
删除以下已废弃的备份和副本:
类型 关键字 完成时间 文件名/句柄
-------------------- ------ ------------------ --------------------
控制文件副本 7 17-4月 -13 E:\CONTROLFILE.TXT
是否确定要删除以上对象 (输入 YES 或 NO)? yes
RMAN-06207: 警告: 由于状态不匹配, 所以不能删除 1 对象 (对于 DISK 通道)。
RMAN-06208: 请用 CROSSCHECK 命令修正状态
RMAN-06210: 不匹配对象的列表
RMAN-06211: ==========================
RMAN-06212: 对象类型 文件名/句柄
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Datafile Copy E:\CONTROLFILE.TXT
RMAN> crosscheck copy;
释放的通道: ORA_DISK_1
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=159 devtype=DISK
说明与恢复目录中的任何存档日志均不匹配
对控制文件副本的验证失败
控制文件副本文件名=E:\CONTROLFILE.TXT recid=7 stamp=812996873
已交叉检验的 1 对象
RMAN> delete obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
使用通道 ORA_DISK_1
删除以下已废弃的备份和副本:
类型 关键字 完成时间 文件名/句柄
-------------------- ------ ------------------ --------------------
控制文件副本 7 17-4月 -13 E:\CONTROLFILE.TXT
是否确定要删除以上对象 (输入 YES 或 NO)? yes
已删除控制文件副本
控制文件副本文件名=E:\CONTROLFILE.TXT recid=7 stamp=812996873
1 对象已删除
RMAN> report obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
未找到已废弃的备份
另一种情况(用crosscheck backuppiece解决)
RMAN> report obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
已废弃的备份和副本报表
类型 关键字 完成时间 文件名/句柄
-------------------- ------ ------------------ --------------------
备份集 63 09-5月 -13
备份段 62 09-5月 -13 F:\RMANBACKUP\CONTROLFILE\C-1318810635-20130509-09
RMAN> delete obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
使用通道 ORA_DISK_1
删除以下已废弃的备份和副本:
类型 关键字 完成时间 文件名/句柄
-------------------- ------ ------------------ --------------------
备份集 63 09-5月 -13
备份段 62 09-5月 -13 F:\RMANBACKUP\CONTROLFILE\C-1318810635-20130509-09
是否确定要删除以上对象 (输入 YES 或 NO)? yes
RMAN-06207: 警告: 由于状态不匹配, 所以不能删除 1 对象 (对于 DISK 通道)。
RMAN-06208: 请用 CROSSCHECK 命令修正状态
RMAN-06210: 不匹配对象的列表
RMAN-06211: ==========================
RMAN-06212: 对象类型 文件名/句柄
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Backup Piece F:\RMANBACKUP\CONTROLFILE\C-1318810635-20130509-09
RMAN> crosscheck backuppiece 'F:\RMANBACKUP\CONTROLFILE\C-1318810635-20130509-09';
使用通道 ORA_DISK_1
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=F:\RMANBACKUP\CONTROLFILE\C-1318810635-20130509-09 recid=62 stamp=814980232
已交叉检验的 1 对象
RMAN> delete obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
使用通道 ORA_DISK_1
删除以下已废弃的备份和副本:
类型 关键字 完成时间 文件名/句柄
-------------------- ------ ------------------ --------------------
备份集 63 09-5月 -13
备份段 62 09-5月 -13 F:\RMANBACKUP\CONTROLFILE\C-1318810635-20130509-09
是否确定要删除以上对象 (输入 YES 或 NO)? yes
已删除备份段
备份段 handle=F:\RMANBACKUP\CONTROLFILE\C-1318810635-20130509-09 recid=62 stamp=814980232
1 对象已删除
RMAN> report obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
未找到已废弃的备份
注: 当检查备份片的时候引号内的内容要用大写,否则报错;如下例子:
RMAN> crosscheck backuppiece 'd:\backup\orcl_78.bak';
RMAN> crosscheck backuppiece 'D:\BACKUP\ORCL_78.BAK';
使用通道 ORA_DISK_1
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=D:\BACKUP\ORCL_78.BAK recid=63 stamp=814980387
已交叉检验的 1 对象
RMAN> delete obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
使用通道 ORA_DISK_1
删除以下已废弃的备份和副本:
类型 关键字 完成时间 文件名/句柄
-------------------- ------ ------------------ --------------------
备份集 64 09-5月 -13
备份段 63 09-5月 -13 D:\BACKUP\ORCL_78.BAK
是否确定要删除以上对象 (输入 YES 或 NO)? yes
已删除备份段
备份段 handle=D:\BACKUP\ORCL_78.BAK recid=63 stamp=814980387
1 对象已删除
RMAN> report obsolete;
RMAN 保留策略将应用于该命令
将 RMAN 保留策略设置为冗余 1
未找到已废弃的备份
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
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 3 31-MAR-13 /u01/app/oracle/product/11g/dbs/arch1_26_809101738.dbf
Archive Log 4 02-APR-13 /u01/app/oracle/product/11g/dbs/arch1_27_809101738.dbf
Archive Log 5 02-APR-13 /u01/app/oracle/product/11g/dbs/arch1_28_809101738.dbf
Archive Log 6 07-APR-13 /u01/app/oracle/product/11g/dbs/arch1_29_809101738.dbf
Archive Log 7 07-APR-13 /u01/app/oracle/product/11g/dbs/arch1_30_809101738.dbf
Archive Log 8 07-APR-13 /u01/app/oracle/product/11g/dbs/arch1_31_809101738.dbf
Archive Log 9 08-APR-13 /u01/app/oracle/product/11g/dbs/arch1_32_809101738.dbf
Archive Log 10 09-APR-13 /u01/app/oracle/product/11g/dbs/arch1_33_809101738.dbf
Archive Log 11 13-APR-13 /u01/app/oracle/product/11g/dbs/arch1_34_809101738.dbf
Archive Log 12 13-APR-13 /u01/app/oracle/product/11g/dbs/arch1_35_809101738.dbf
Archive Log 13 14-APR-13 /u01/app/oracle/product/11g/dbs/arch1_36_809101738.dbf
Backup Set 21 14-APR-13
Backup Piece 21 14-APR-13 /u01/app/oracle/product/11g/dbs/0oo72338_1_1
Archive Log 14 14-APR-13 /u01/app/oracle/product/11g/dbs/arch1_37_809101738.dbf
Backup Set 22 14-APR-13
Backup Piece 22 14-APR-13 /u01/app/oracle/product/11g/dbs/0po7234g_1_1
Archive Log 15 14-APR-13 /u01/app/oracle/product/11g/dbs/arch1_38_809101738.dbf
Archive Log 16 14-APR-13 /u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf
Archive Log 17 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf
Archive Log 19 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_41_809101738.dbf
Archive Log 20 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf
Archive Log 18 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf
Archive Log 21 17-APR-13 /u01/app/oracle/product/11g/dbs/arch1_1_812827142.dbf
Archive Log 22 19-APR-13 /u01/app/oracle/product/11g/dbs/arch1_1_813017789.dbf
Archive Log 23 19-APR-13 /u01/app/oracle/product/11g/dbs/arch1_1_813137488.dbf
Archive Log 24 19-APR-13 /u01/app/oracle/product/11g/dbs/arch1_1_813138538.dbf
Archive Log 25 07-MAY-13 /u01/app/oracle/product/11g/dbs/arch1_1_813161833.dbf
Archive Log 26 07-MAY-13 /u01/app/oracle/product/11g/dbs/arch1_2_813161833.dbf
Archive Log 27 07-MAY-13 /u01/app/oracle/product/11g/dbs/arch1_3_813161833.dbf
Archive Log 28 14-MAY-13 /u01/app/oracle/product/11g/dbs/arch1_4_813161833.dbf
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 3 31-MAR-13 /u01/app/oracle/product/11g/dbs/arch1_26_809101738.dbf
Archive Log 4 02-APR-13 /u01/app/oracle/product/11g/dbs/arch1_27_809101738.dbf
Archive Log 5 02-APR-13 /u01/app/oracle/product/11g/dbs/arch1_28_809101738.dbf
Archive Log 6 07-APR-13 /u01/app/oracle/product/11g/dbs/arch1_29_809101738.dbf
Archive Log 7 07-APR-13 /u01/app/oracle/product/11g/dbs/arch1_30_809101738.dbf
Archive Log 8 07-APR-13 /u01/app/oracle/product/11g/dbs/arch1_31_809101738.dbf
Archive Log 9 08-APR-13 /u01/app/oracle/product/11g/dbs/arch1_32_809101738.dbf
Archive Log 10 09-APR-13 /u01/app/oracle/product/11g/dbs/arch1_33_809101738.dbf
Archive Log 11 13-APR-13 /u01/app/oracle/product/11g/dbs/arch1_34_809101738.dbf
Archive Log 12 13-APR-13 /u01/app/oracle/product/11g/dbs/arch1_35_809101738.dbf
Archive Log 13 14-APR-13 /u01/app/oracle/product/11g/dbs/arch1_36_809101738.dbf
Backup Set 21 14-APR-13
Backup Piece 21 14-APR-13 /u01/app/oracle/product/11g/dbs/0oo72338_1_1
Archive Log 14 14-APR-13 /u01/app/oracle/product/11g/dbs/arch1_37_809101738.dbf
Backup Set 22 14-APR-13
Backup Piece 22 14-APR-13 /u01/app/oracle/product/11g/dbs/0po7234g_1_1
Archive Log 15 14-APR-13 /u01/app/oracle/product/11g/dbs/arch1_38_809101738.dbf
Archive Log 16 14-APR-13 /u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf
Archive Log 17 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf
Archive Log 19 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_41_809101738.dbf
Archive Log 20 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf
Archive Log 18 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf
Archive Log 21 17-APR-13 /u01/app/oracle/product/11g/dbs/arch1_1_812827142.dbf
Archive Log 22 19-APR-13 /u01/app/oracle/product/11g/dbs/arch1_1_813017789.dbf
Archive Log 23 19-APR-13 /u01/app/oracle/product/11g/dbs/arch1_1_813137488.dbf
Archive Log 24 19-APR-13 /u01/app/oracle/product/11g/dbs/arch1_1_813138538.dbf
Archive Log 25 07-MAY-13 /u01/app/oracle/product/11g/dbs/arch1_1_813161833.dbf
Archive Log 26 07-MAY-13 /u01/app/oracle/product/11g/dbs/arch1_2_813161833.dbf
Archive Log 27 07-MAY-13 /u01/app/oracle/product/11g/dbs/arch1_3_813161833.dbf
Archive Log 28 14-MAY-13 /u01/app/oracle/product/11g/dbs/arch1_4_813161833.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_26_809101738.dbf RECID=3 STAMP=811521433
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_27_809101738.dbf RECID=4 STAMP=811716716
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_28_809101738.dbf RECID=5 STAMP=811720972
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_29_809101738.dbf RECID=6 STAMP=812119367
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_30_809101738.dbf RECID=7 STAMP=812119778
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_31_809101738.dbf RECID=8 STAMP=812119963
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_32_809101738.dbf RECID=9 STAMP=812197088
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_33_809101738.dbf RECID=10 STAMP=812280177
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_34_809101738.dbf RECID=11 STAMP=812625884
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_35_809101738.dbf RECID=12 STAMP=812629088
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_36_809101738.dbf RECID=13 STAMP=812712239
deleted backup piece
backup piece handle=/u01/app/oracle/product/11g/dbs/0oo72338_1_1 RECID=21 STAMP=812715115
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_37_809101738.dbf RECID=14 STAMP=812756213
deleted backup piece
backup piece handle=/u01/app/oracle/product/11g/dbs/0po7234g_1_1 RECID=22 STAMP=812715153
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_38_809101738.dbf RECID=15 STAMP=812759646
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf RECID=16 STAMP=812760114
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf RECID=17 STAMP=812824570
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_41_809101738.dbf RECID=19 STAMP=812827142
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_1_812827142.dbf RECID=21 STAMP=813017811
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_1_813017789.dbf RECID=22 STAMP=813137488
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_1_813137488.dbf RECID=23 STAMP=813138538
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_1_813138538.dbf RECID=24 STAMP=813161839
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_1_813161833.dbf RECID=25 STAMP=814803172
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_2_813161833.dbf RECID=26 STAMP=814803187
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_3_813161833.dbf RECID=27 STAMP=814803207
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_4_813161833.dbf RECID=28 STAMP=815414098
Deleted 26 objects
RMAN-06207: WARNING: 2 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/product/11g/dbs/arch1_39_809101738.dbf
RMAN-06214: Archivelog /u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf
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 18 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf
Archive Log 20 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf
RMAN> crosscheck archivelog '/u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
validation failed for archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf RECID=20 STAMP=812827142
Crosschecked 1 objects
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 18 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf
Archive Log 20 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_39_809101738.dbf RECID=20 STAMP=812827142
Deleted 1 objects
RMAN-06207: WARNING: 1 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/product/11g/dbs/arch1_40_809101738.dbf
RMAN> crosscheck archivelog '/u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf'
2> ;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
validation failed for archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf RECID=18 STAMP=812827142
Crosschecked 1 objects
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 18 15-APR-13 /u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=/u01/app/oracle/product/11g/dbs/arch1_40_809101738.dbf RECID=18 STAMP=812827142
Deleted 1 objects
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
no obsolete backups found