rman 删除指定时间点的归档日志

在论坛上看到有人提问要删除指定时间点之前的归档日志,根据大家的回答,我也简单的进行了以下测试,以下是测试过程:

RMAN> list archivelog all;


List of Archived Log Copies
Key     Thrd Seq     S Low Time            Name
------- ---- ------- - ------------------- ----
74      1    47      A 2012-11-23 02:45:35 /ora10g/arch/1_47_797703448.dbf
75      1    48      A 2012-11-26 19:19:02 /ora10g/arch/1_48_797703448.dbf
76      1    49      A 2012-11-26 19:41:53 /ora10g/arch/1_49_797703448.dbf
77      1    50      A 2012-11-27 01:53:45 /ora10g/arch/1_50_797703448.dbf
78      1    51      A 2012-11-28 01:00:44 /ora10g/arch/1_51_797703448.dbf
79      1    52      A 2012-11-28 22:27:35 /ora10g/arch/1_52_797703448.dbf
80      1    53      A 2012-11-29 05:50:56 /ora10g/arch/1_53_797703448.dbf
81      1    54      A 2012-11-29 22:00:33 /ora10g/arch/1_54_797703448.dbf

RMAN>

RMAN> delete archivelog all completed before 'trunc(sysdate-1)+2/24';

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=257 devtype=DISK

List of Archived Log Copies
Key     Thrd Seq     S Low Time            Name
------- ---- ------- - ------------------- ----
74      1    47      A 2012-11-23 02:45:35 /ora10g/arch/1_47_797703448.dbf
75      1    48      A 2012-11-26 19:19:02 /ora10g/arch/1_48_797703448.dbf
76      1    49      A 2012-11-26 19:41:53 /ora10g/arch/1_49_797703448.dbf
77      1    50      A 2012-11-27 01:53:45 /ora10g/arch/1_50_797703448.dbf
78      1    51      A 2012-11-28 01:00:44 /ora10g/arch/1_51_797703448.dbf

Do you really want to delete the above objects (enter YES or NO)? yes
deleted archive log
archive log filename=/ora10g/arch/1_47_797703448.dbf recid=74 stamp=800392743
deleted archive log
archive log filename=/ora10g/arch/1_48_797703448.dbf recid=75 stamp=800394114
deleted archive log
archive log filename=/ora10g/arch/1_49_797703448.dbf recid=76 stamp=800416426
deleted archive log
archive log filename=/ora10g/arch/1_50_797703448.dbf recid=77 stamp=800499645
deleted archive log
archive log filename=/ora10g/arch/1_51_797703448.dbf recid=78 stamp=800576855
Deleted 5 objects

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11590946/viewspace-750335/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/11590946/viewspace-750335/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值