#!/bin/bash
#########################################################
## Delete the archivelog in fs and standby
## Created by lucyne, 2013-06-13
## Mail TO : dblucyne@gmail.com
#########################################################
DT=`date +%Y%m%d`
TIME=`date +%Y%m%d%H`
BASEDIR=/home/oracle/dbadmin/
ls ${BASEDIR}/logs/${DT} 1>/dev/null 2>&1|| mkdir -p ${BASEDIR}/logs/${DT}
LOGFILE=${BASEDIR}/logs/${DT}/rman_trun_arch_${TIME}.log
exec 3>&1 4>&2 1>>${LOGFILE} 2>&1
rman target / <<EOF
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog until time "sysdate-6";
exit
EOF
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26390465/viewspace-1793135/
,如需转载,请注明出处,否则将追究法律责任。