delete obsolete 会删除归档日志么?
答案是:会的。
确切的是说,delete obsolete;删除归档日志的判断完全是依据RMAN的"backup retention policy"来的。
再进一步说,delete obsolete;删除归档日志的依据,仅仅是RMAN的"backup retention policy",不包括rman的ARCHIVELOG DELETION POLICY。(请详细阅读本文末尾的英文就可以得知delete obsolete;删除归档日志的依据不包括rman的ARCHIVELOG DELETION POLICY)
比如如下的情况
一个新库,"backup retention policy" 就是默认的redundancy 1.
1.开启归档模式,
2.切换归档日志,假设在归档路径下生成的归档日志为:+FRA/orcl/archivelog/2015_10_25/thread_1_seq_9.256.894038911
3.做rman的备份,
4.备份归档日志,所用命令为backup format '/rmanbak/orcl_arch_inc_%U' archivelog all;也就是说不删除
5.delete obsolete;---该命令会删除掉2中生成的归档日志。
rman中的log 为:
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 25-OCT-15 +FRA/orcl/archivelog/2015_10_25/thread_1_seq_9.256.894038911
deleted archived log
archived log file name=+FRA/orcl/archivelog/2015_10_25/thread_1_seq_9.256.894038911 RECID=1 STAMP=894038912
Deleted 1 objects
因此,至少有如下几个命令会删除归档日志:
backup format '/rmanbak/orcl_arch_inc_%U' archivelog all delete input;
delete archivelog all;
delete obsolete;
对obsolete的解释:
Deletes data file backups and copies recorded in the RMAN repository that are obsolete, that is, no longer needed (see Example 2-76). RMAN also deletes obsolete archived redo log files and log backups.
RMAN determines which backups and copies of data files are no longer needed, which in turn determines when logs (and backups of logs) are no longer needed. RMAN considers the creation of a data file as a backup when deciding which logs to keep.
RMAN first uses the options specified with obsOperandList to determine which files are obsolete. If you do not specify options in obsOperandList, then RMAN uses the options specified in CONFIGURE RETENTION POLICY.
Note: DELETE OBSOLETE considers only the backup retention policy and does not use the configured archived log deletion policy to determine which logs are obsolete. In contrast, DELETE ARCHIVELOG ALL considers only the configured archived log deletion policy.
Note: If you make a backup with the KEEP UNTIL TIME clause, then this backup becomes obsolete after the specified KEEP time passes and is removed by DELETE OBSOLETE. RMAN does not consider the backup retention policy for archival backups whose KEEP time has expired.
Note: The DELETE...OBSOLETE command cannot be used when backups are stored to Zero Data Loss Recovery Appliance, commonly known as Recovery Appliance.