标签:
1 #!/usr/bin/bash 2 3 export ORACLE_BASE=/opt/ora10; 4 export ORACLE_HOME=$ORACLE_BASE/product/10g; 5 export ORACLE_SID=standby; 6 export ORACLE_TERM=xterm; 7 export PATH=/bin:/usr/bin:/usr/sbin:$PATH; 8 export PATH=$ORACLE_HOME/bin:$PATH; 9 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; 10 export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; 11 export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK; 12 13 del_seq=`ls /smsdb/arch_log/|head -1|cut -f2 -d_` 14 echo $del_seq 15 $ORACLE_HOME/bin/sqlplus "/ as sysdba" <<eof >/smsdb/arch_log/max_sn.log 16 set head off; 17 set feedback; 18 select max(sequence#) from v\$log_history; 19 exit; 20 eof 21 max_sn=`cat /smsdb/arch_log/max_sn.log|awk ‘{print $1}‘|grep ^[0-9]` 22 max_sn=`expr $max_sn - 30` 23 echo $max_sn 24 while [ $del_seq -lt $max_sn ] 25 do 26 rm -rf /smsdb/arch_log/1_"$del_seq"_770554846.dbf 27 del_seq=`expr $del_seq + 1` 28 echo $del_seq 29 done
标签:
原文地址:http://www.cnblogs.com/zhuhaiqing/p/5790213.html