在Oracle數據庫備份歸檔日志時,通常會保存最近幾天的歸檔日志文件不刪除。
如:
backup archivelog all;
delete noprompt archivelog all completed before 'sysdate -14'; 在本地保留14天的歸檔日志.
再備份時,歸檔會重復再備份一次。
加上一個子句 not backed up 1 times,就可以實現不備份已經歸檔的日志。
命令如下:
backup archivelog all not backed up 1 times; 不備份上次已經備份的歸檔
Backing Up Only Archived Redo Logs That Need Backups
You can indicate that RMAN should automatically skip backups of archived redo logs in the following ways:
Configuring backup optimization
As explained in "Configuring Backup Optimization", if you enable backup optimization, then the BACKUP ARCHIVELOG command skips backing up files when an identical archived log has already been backed up to the specified device type. An archived log is considered identical to another when it has the same DBID, thread, sequence number, and RESETLOGS SCN and time.
Configure an archived redo log deletion policy
As explained in "Configuring an Archived Redo Log Deletion Policy", if the deletion policy is configured with the BACKED UP integer TIMES clause, then a BACKUP ARCHIVELOG command copies the logs unless integer backups already exist on the specified device type. If integer backups of the logs exist, then the BACKUP ARCHIVELOG command skips the logs.
The BACKUP ... NOT BACKED UP integer TIMES command specifies that RMAN should back up only those archived log files that have not been backed up at least integer times to the specified device. To determine the number of backups for a file, RMAN only considers backups created on the same device type as the current backup.
The BACKED UP clause is a convenient way to back up archived logs to a specified device type. For example, you can specify that RMAN should keep two copies of each archived redo log on tape and skip additional backups.