天天看點

Oracle delete input與delete all input

oracle官方文檔提示:

If you had specified DELETE INPUT rather than DELETE ALL INPUT, then RMAN would have only deleted the specific archived redo log files that it backed up. For example, RMAN would delete the logs in /arc_dest1 if these files were used as the source of the backup, but leave the contents of the /arc_dest2 intact

如果指定delete input ,則rman将僅删除已備份的歸檔日志,例如對于有兩個歸檔目錄 /arc_dest1 和 /arc_dest2 如果把/arc_dest1做為backup的源,delete input将删除 /arc_dest1 中的内容,保留dest2中的歸檔日志,通過實驗可以看出,就算有兩個歸檔位置,rman備份的時候貌似是以日志檔案為源,備份過的日志删除。

------------------------------------------------------------

If you had specified DELETE ALL INPUT RMAN backs up only one copy of each log sequence number in these archiving locations.it deletes all copies of any log that it backed up from the other archiving destinations

如果指定delete all input RMAN對于所有歸檔目錄中的日志序列号隻備份一次,同時rman會删除dest1 和dest2 中所有歸檔日志。

結論:對于僅有一個歸檔目錄 delete input 和delet all input 沒啥差別。

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

觀察如下兩條備份語句

1)backup as compressed backupset filesperset 4 incremental level=1 cumulative database plus archivelog delete input;

2)backup as compressed backupset filesperset 4 incremental level 1 database;

backup as compressed backupset archivelog all delete all input;

語句1是一個累積備份,語句2是一個差異1備份。備份結束後都希望備份歸檔日志同時在删除已備份的歸檔日志。差別在于語句1使用delete input,語句2使用delete all input

舉一列子,如周1、2、4使用語句2,進行差異備份。 周3使用語句1進行累積備份。則這樣周1、2隻會備份當天生成的歸檔日志,周3同樣隻會備份當天生成的歸檔日志,而周4會備份周3、4兩天生成的歸檔日志。

究其原因是,本身對歸檔日志實作了多路複用,即不知在FRA中生成歸檔日志,在其他路徑中同樣生成歸檔日志。而delete input 隻會删除預設路徑即FRA中的歸檔日志,其他路徑中的歸檔日志會保留。是以當周4再備份歸檔日志時,會将在其他路徑中保留的昨日的歸檔日志與今日生成的歸檔日志同時備份。此種情況會導緻歸檔日志被重複備份,浪費存儲資源。

是以當針對歸檔日志實作了多路複用時,應使用delete all input 進行歸檔日志的清理