Oracle 清理归档日志

  • A+
所属分类:oracle

当oracle的归档日志所在文件系统满时,会引发数据库不可用,清理归档日志的方法如下:

优先使用rman

rman target /

delete archivelog all;

如果rman 无法连接数据库,可以先手工使用rm命令清理日志,然后做crosscheck

rm -f <归档日志>

rman target /

crosscheck archivelog all;

delete obsolete achivelog all;

delete expired achivelog all;

按照时间删除,删除一天前的日志:

delete archivelog until time 'sysdate -1';

按照日志序号删除:

delete archivelog until sequence 9310 thread 1; 

不经提示,直接删除:

delete noprompt force archivelog all;

参考资料:

Archivelog Delete Until time in Oracle Database - IT Tutorial

w3cjava