日期:2014-05-16  浏览次数:20455 次

删除archive log

两种方法:
1、配置RMAN自动管理ARCHIVELOG。也可在RMAN中将数据备份到磁带上,然后将过期的ARCHIVELOG删除;
2、可以手工来处理,步骤如下
? 1)将/oracle下的相关ARCHIVELOG日志文件移到别的文件系统下(保留一段时间的ARCHIVELOG日志即可,其他的可移走,用系统命令mv移走)。然后打包、压缩,备份到介质上,此时可将这些移出的文件删除。注意:别在原来的/oracle打包了,否则空间占满了就有些麻烦了。
? 2)以oracle用户登录,执行rman target /。如有多个实例此时执行rman target 用户名/密码@实例名,进入rman
? 3)在rman中执行
? RMAN>list archivelog all; /*列出所有的归档日志文件
? RMAN>crosscheck archivelog all; /*与物理归档日志文件保持同步,之前移走了一部分文件,因此执行此命令后会在/oracle目录下找不到的归档日志标记为expired
? RMAN>list expired archivelog all; /*列出所有expired(过期)的归档日志文件,此时你就可看到移走的归档日志文件均被标记为expired
? RMAN>delete expired archivelog all; /*在oracle中删除所有过期的expired文件
? RMAN>list archivelog all; /*再列出所有的归档日志文件,就可发现移走的日志文件被删掉了
? RMAN>exit /*退出

?

?

rman target sys/sys@dbname?
delete archivelog until time 'sysdate-1'; //it removes the archivelog from you disk until yesterday

otherwise, you have to move these archived logs to other disk or back up the recovery area to the tape device. If you move these archived logs manually, then you execute the following commands:

rman target sys/sys@dbname

?

crosscheck archivelog all ;

It will update the information in the control files of your database.

?

自我总结:必须是rman target sys/ss@yy 必须是系统用户,最好在dBserver上面弄。