aix 定時調度刪除歸檔日誌

1.編碼寫sh腳本文件。

2. crontab -e username. #打開一個文件,

3.輸入腳本

   13 17 * * * sh /home/oracle/delOraArch.sh

4.wq #保存退出。

5.自動刪除歸檔日誌。

delOraArch.sh

----------------------------------

#!/bin/bash
. /home/oracle/.profile
export ORACLE_SID=TJFXDB1
$ORACLE_HOME/bin/rman log=/home/oracle/oraArch/deleteOraArch.log<<EOF
connect target /
run{
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog all completed before 'sysdate - 2';
}
exit;

------------------------------

參考:

https://wenku.baidu.com/view/f1ae285ccaaedd3383c4d362.html

https://blog.csdn.net/yincg/article/details/12750773

https://blog.51cto.com/liuqun/2043358

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章