oracle 如何不备份已经备份的归档
oracle 如何不备份已经备份的归档
在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.