How to delete expired archive log files using rman?

本文介绍如何使用Oracle Recovery Manager (RMAN) 清理数据库中过期的归档日志文件,包括列出、检查及删除这些文件的具体命令。此外还提供了当归档目的地磁盘空间不足导致数据库挂起时的解决办法。

he following commands will helpful to delete the expired archive log files using Oracle Recovery Manager(RMAN).Connect to the Rman prompt and try the bellow commands.

    RMAN>list expired archivelog all;

RMAN>crosscheck archivelog all;
RMAN>delete noprompt expired archivelog all;
RMAN>list expired archivelog all;

Sample Ouptut:

RMAN> list expired archivelog all;
specification does not match any archived log in the repository
RMAN>

In my develop environment , sometime the archive destination folder is full, caused the database hang. So I will use below command to disable it.

Disable Archive log mode

startup mount

alter database noarchivelog;

alter database open;

 

方法一:
rman target/
或rman target/@orcl
在命令窗口里面执行
delete noprompt archivelog until time 'sysdate-7'; //删除七天前的归档,果使用了闪回功能,也会删除闪回的数据。 
DELETE ARCHIVELOG FROM TIME 'SYSDATE-7'; //删除七天到现在的归档 

方法二:(rman登不进去)

执行find /archive/ -name "*.dbf"|wc –l查看有多少归档日志
删除7天之前的所有归档文件
find /archive/ -name "*.dbf" -mtime +7  -exec rm -f {} ;

将归档日志信息进行更新

asm 就得用asmcmd交互界面rm了
RMAN> crosscheck archivelog all;
RMAN> delete noprompt expired archivelog all; 
RMAN> exit
 

转载于:https://www.cnblogs.com/princessd8251/p/3808090.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值