刪除歸檔,保留最近的5個歸檔日誌

perfychi發表於2012-10-12
. /home/oracle/.bash_profile
export ORACLE_SID=compiere

 # echo $STATUS
    LOG_SEQUENCE=`sqlplus -s sys/H2oiswater as sysdba <                        set pagesize 0
                        set feedback off
                        set trimspool on
                        set linesize 1000
                        set heading off
                        set termout off
                        select max(sequence#)-5 from v\\$archived_log ;
                         exit;
                      !
                   `
echo $LOG_SEQUENCE

#刪除 歸檔是在rman裡用名利刪除,不能要在作業系統上直接刪除
     l_rman_st=`rman target sys/HHHr <                 delete force noprompt archivelog high sequence $LOG_SEQUENCE;
                 exit;
                !
               `

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-746288/,如需轉載,請註明出處,否則將追究法律責任。

相關文章