程序员人生 网站导航

Oracle 清理归档脚本

栏目:数据库应用时间:2015-03-19 08:41:03

$ vi clean.sh

#!/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 - 3' ; exit EOF


$ chmod 777 clean.sh

$ sh clean.sh

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐