delete obsolete 会删除归档日志么?


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;

参考链接:

http://docs.oracle.com/database/121/RCMRF/rcmsynta015.htm#RCMRF121

对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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值