首页 > 系统 > Linux > 正文

Linux下Oracle归档日志自动清理脚本代码(sh)

2019-10-26 18:32:02
字体:
来源:转载
供稿:网友
代码如下:
#!/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
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表