C/C++教程

windows下oracle定时删除归档日志

本文主要是介绍windows下oracle定时删除归档日志,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
D:\delete_archivelog.txt cmdfile内容:
connect target  /
run{
    crosscheck archivelog all;
    DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';
    delete expired archivelog all;
}


del_archivelog.bat脚本:
@echo off
set "filename=del_archivelog_%date:~0,4%%date:~5,2%%date:~8,2%.txt"
(
echo.
echo =========================  正在清除过期归档文件,请稍等...... %date% %time%  =========================
echo.
rman cmdfile=D:\delete_archivelog.txt
echo.
echo =========================              【结束清理 %date% %time%】                  =========================
echo.
)>>D:\%filename% 2>&1<nul
pause

  

这篇关于windows下oracle定时删除归档日志的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!