RMAN 中delete exipired 和 delete obsolete 的區別

kingsql發表於2016-04-06

delete expired

If you run CROSSCHECK, and if RMAN cannot locate the files, then it updates their records in the RMAN repository to EXPIRED status. You can then use the DELETE EXPIRED command to remove records of expired backups and copies from the RMAN repository.

delete obsolete

The RMAN DELETE command supports an OBSOLETE option, which deletes backups that are no longer needed to satisfy specified recoverability requirements. You can delete files obsolete according to the configured default retention policy, or another retention policy that you specify as an option to the DELETE OBSOLETE command. As with other forms of the DELETE command, the files deleted are removed from backup media, deleted from the recovery catalog, and marked as DELETED in the control file.

delete expired刪除的是那些本來RMAN以為存在但是實際上在磁碟或者磁帶上已經被刪除了的資訊,刪除的只是RMAN資料庫中的記錄;delete obsolete則刪除舊於備份保留策略定義的備份資料同時也更新RMAN資料庫以及控制檔案。

 

===============================================================

EG:

#delete obsolete and expired backup and archivelog
run {
delete noprompt obsolete;
crosscheck archivelog all;
delete noprompt expired archivelog all;
crosscheck backup;
delete noprompt expired backup;
}

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28389881/viewspace-2076338/,如需轉載,請註明出處,否則將追究法律責任。

相關文章