oracle 删除归档日志
删除归档日志
一、查看是否开启归档日志
查看是否开启归档 #sqlplus /nolog SQL>connect / as sysdba; SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination /arch Oldest online log sequence 1564 Next log sequence to archive 1566 Current log sequence 1566
二、删除数据库归档文件。
1
2
3
4
5
|
cd / arch 执行下面命令删除 7 天以前的归档日志: find . - xdev - mtime + 7 - name "*.dbf" - exec rm - f {} \; 等同于 DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7' ; |
三、执行rman逻辑上删除过期日志
rman RMAN> connect target / >crosscheck archivelog all; #删除所有超期的归档日志 >delete expired archivelog all; #删除7天以外的日志 >delete archivelog all completed before 'sysdate-7'; >quit