Oracle RMAN清除归档日志(三)

2014-11-24 16:55:55 · 作者: · 浏览: 1
allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=1075 devtype=DISK List of Archived Log Copies Key Thrd Seq S Low Time Name ------- ---- ------- - ----------------- ---- 2167 1 91 A 20130711 01:00:48 /u02/database/GOBO1/archive/arch_816906485_1_91.arc deleted archive log archive log filename=/u02/database/GOBO1/archive/arch_816906485_1_91.arc recid=2167 stamp=820517964 Deleted 1 objects

3、清除归档日志简单的shell脚本
[python] 
#对于RAC环境或者ASM需要清除archive,使用shell脚本调用RMAN是比较妥当的方式  
#其次,如果你的archive位于闪回区,制定合理的保留策略,也可以让Oracle自动老化无用的归档日志  
robin@SZDB:~/dba_scripts/custom/bin> more clean_arch.sh   
# +-------------------------------------------------------+  
# +    Clean archived log as specified time               |  
# +    Author : Robinson                                  |  
# +    Blog   : http://blog.csdn.net/robinson_0612        |  
# +    Usage  :                                           |   
# +         clean_arch.sh $ORACLE_SID                     |  
# +-------------------------------------------------------+  
#  
#!/bin/bash   
# --------------------  
# Define variable  
# --------------------  
  
if [ -f ~/.bash_profile ]; then  
. ~/.bash_profile  
fi  
  
if [ -z "${1}" ];then  
    echo "Usage: "  
    echo "      `basename $0` ORACLE_SID"  
    exit 1  
fi  
  
ORACLE_SID=$1;                 export ORACLE_SID   
$ORACLE_HOME/bin/rman log=/users/robin/log/rman.log <

exit