oracle 归档日志清理
归档日志检查
查看设置的归档日志大小
123456SQL> show parameter db_recovery_file_dest_size;NAME TYPE VALUE------------------------------------ ----------- ------------------------------db_recovery_file_dest_size big integer 600G查看已使用大小
12345SQL> select sum(a.BLOCK_SIZE*a.BLOCKS)/1024/1024 as userSize from v$archived_log a where a.DELETED='NO';SUM(A.BLOCK_SIZE*A.BLOCKS)/1024/1024------------------------------------614363.783查看归档日志保存地址
1234567891011121314151617181920212223242526-- 查看 归档日志基本信息SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 20931Next log sequence to archive 20931Current log sequence 20933-- 查看archive destination的值,查看是删除USE_SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 20931Next log sequence to archive 20931Current log sequence 20933-- 查看位置及使用大小SQL> show parameter DB_RECOVERY_FILE_DESTNAME TYPE VALUE------------------------------------ ----------- ------------------------------db_recovery_file_dest string /home/oracle/app/flash_recovery_areadb_recovery_file_dest_size big integer 600G2
oracle 归档日志处理 已满 处理方式
扩展归档日志大小
更改归档日志大小
12345678910111213-- 切换到oracle用户su - oracle-- 登陆oraclesqlplus /nologconn /as sysdba-- 设置归档日志大小alter system set db_recovery_file_dest_size=5G scope=spfile;-- 重启oracle-- 关闭shutdown immediate-- 打开startup
删除以前的归档日志
进入rman命令状态
[oracle@localhost ~]$ rman target/
查看所有LOG文件
RMAN> crosscheck archivelog all;
删除所有LOG文件
RMAN> delete archivelog all; (或者删除前10天的日志 DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-10'; )