Linux下Oracle归档日志自动清理脚本代码(sh)
时间:2020-11-22 22:29:53|栏目:Shell|点击: 次
复制代码 代码如下:
#!/bin/sh
export BACK_DATE=`date +%Y%m%d`
export BACKUP_PATH=/home/oracle/dbbak
echo `mkdir -p ${BACKUP_PATH}/archivelog/${BACK_DATE}`
rman msglog=$BACKUP_PATH/archivelog/${BACK_DATE}/arch_0_$BACK_DATE.log << EOF
connect target /;
delete expired archivelog all;
delete noprompt archivelog until time 'sysdate - 1' ;
exit
EOF
上一篇:Linux下去掉^M的四种方法
栏 目:Shell
本文标题:Linux下Oracle归档日志自动清理脚本代码(sh)
本文地址:http://www.codeinn.net/misctech/25079.html