批处理自动执行rman删除归档日志

由于oracle的归档日志不停增加导致服务器硬盘满了,数据库不能使用。做此bat脚本,删除一周前的oracle archive log归档日志,设置window执行计划自动执行。

1.delete_archivelog.rman:

delete noprompt archivelog all completed before 'sysdate-7';


2.run_delete_archivelog.bat:

rman target / @delete_archivelog.rman



参考阅读:
http://bbs.51cto.com/thread-887442-1.html
(你在資料夾上刪除后還需要在RMAN里運行以下語句:
crosscheck archivelog all;
delete expired archivelog all;
這樣才算完整刪除或者直接在RMAN里用以下語句刪除
delete archivelog all completed before 'sysdate-n'(n為天數,意思為多少天前的歸檔)

http://blog.csdn.net/yuzhenhuan01/article/details/5268443
(修改语言环境后验证成功:

C:/Documents and Settings/zhenhuan_yu>set nls_lang=american_america.zhs16gbk



http://www.fatihacar.com/blog/delete-archivelog-using-rman-in-oracle/
(Note : Also, you can use noprompt statement for do not yes-no question.
RMAN>delete noprompt archivelog until time ‘SYSDATE-10′;


http://www.blogjava.net/wxqxs/archive/2008/09/14/231317.html
(  1、直接在系统下执行:

    C:\Documents and Settings\wangxiaoqi> D:
    D:\> cd oracle\oradata\dodo\rmanback
    D:\oracle\oradata\dodo\rmanback> rman target / @test.rman

你可能感兴趣的:(oracle,脚本,rman,archivelog)