删除备份的时候无法删除
在进行备份之后,先删除了备份文件,然后在进行删除备份记录,无法删除,显示如下:
RMAN> delete copy; released channel: ORA_DISK_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=145 devtype=DISK specification does not match any archive log in the recovery catalog List of Datafile Copies Key File S Completion Time Ckp SCN Ckp Time Name ------- ---- - --------------- ---------- --------------- ---- 17 1 A 13-JUN-14 634156 13-JUN-14 +KEL/ipap/datafile/system.257.850091431 19 2 A 13-JUN-14 634203 13-JUN-14 +KEL/ipap/datafile/undotbs1.258.850091543 18 3 A 13-JUN-14 634187 13-JUN-14 +KEL/ipap/datafile/sysaux.256.850091507 20 4 A 13-JUN-14 634205 13-JUN-14 +KEL/ipap/datafile/users.259.850091545 Do you really want to delete the above objects (enter YES or NO)? y RMAN-06207: WARNING: 4 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 +KEL/ipap/datafile/system.257.850091431 RMAN-06214: Datafile Copy +KEL/ipap/datafile/undotbs1.258.850091543 RMAN-06214: Datafile Copy +KEL/ipap/datafile/sysaux.256.850091507 RMAN-06214: Datafile Copy +KEL/ipap/datafile/users.259.850091545
进行检查,检查过期的文件,然后再次进行删除即可:
RMAN> crosscheck copy; released channel: ORA_DISK_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=145 devtype=DISK specification does not match any archive log in the recovery catalog validation failed for datafile copy datafile copy filename=+KEL/ipap/datafile/system.257.850091431 recid=17 stamp=850091498 validation failed for datafile copy datafile copy filename=+KEL/ipap/datafile/undotbs1.258.850091543 recid=19 stamp=850091544 validation failed for datafile copy datafile copy filename=+KEL/ipap/datafile/sysaux.256.850091507 recid=18 stamp=850091538 validation failed for datafile copy datafile copy filename=+KEL/ipap/datafile/users.259.850091545 recid=20 stamp=850091545 Crosschecked 4 objects
RMAN> delete copy; released channel: ORA_DISK_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=145 devtype=DISK specification does not match any archive log in the recovery catalog List of Datafile Copies Key File S Completion Time Ckp SCN Ckp Time Name ------- ---- - --------------- ---------- --------------- ---- 17 1 X 13-JUN-14 634156 13-JUN-14 +KEL/ipap/datafile/system.257.850091431 19 2 X 13-JUN-14 634203 13-JUN-14 +KEL/ipap/datafile/undotbs1.258.850091543 18 3 X 13-JUN-14 634187 13-JUN-14 +KEL/ipap/datafile/sysaux.256.850091507 20 4 X 13-JUN-14 634205 13-JUN-14 +KEL/ipap/datafile/users.259.850091545 Do you really want to delete the above objects (enter YES or NO)? y deleted datafile copy datafile copy filename=+KEL/ipap/datafile/system.257.850091431 recid=17 stamp=850091498 deleted datafile copy datafile copy filename=+KEL/ipap/datafile/undotbs1.258.850091543 recid=19 stamp=850091544 deleted datafile copy datafile copy filename=+KEL/ipap/datafile/sysaux.256.850091507 recid=18 stamp=850091538 deleted datafile copy datafile copy filename=+KEL/ipap/datafile/users.259.850091545 recid=20 stamp=850091545 Deleted 4 objects在备份的时候,一种是物理备份,一种是逻辑备份
查看备份集的时候使用:
RMAN> list backup; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 3 Full 6.80M DISK 00:00:01 13-JUN-14 BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20140613T003226 Piece Name: /home/oracle/flash_recovery_area/IPAP/autobackup/2014_06_13/o1_mf_s_850091546_9sob8ck2_.bkp Control File Included: Ckp SCN: 634210 Ckp time: 13-JUN-14 SPFILE Included: Modification time: 13-JUN-14
查看镜像备份的时候使用:
RMAN> list copy; specification does not match any archive log in the recovery catalog List of Datafile Copies Key File S Completion Time Ckp SCN Ckp Time Name ------- ---- - --------------- ---------- --------------- ---- 21 1 A 13-JUN-14 634486 13-JUN-14 +KEL/orcl
删除过期的备份时候使用:
RMAN> delete expired copy; released channel: ORA_DISK_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=145 devtype=DISK specification does not match any archive log in the recovery catalog List of Datafile Copies Key File S Completion Time Ckp SCN Ckp Time Name ------- ---- - --------------- ---------- --------------- ---- 21 1 X 13-JUN-14 634486 13-JUN-14 +KEL/orcl Do you really want to delete the above objects (enter YES or NO)? y deleted datafile copy datafile copy filename=+KEL/orcl recid=21 stamp=850092105 Deleted 1 EXPIRED objects RMAN> delete expired backupset; using channel ORA_DISK_1 RMAN> delete expired backup; using channel ORA_DISK_1
for linux and python