一個刪除重做日誌檔案的參考指令碼

chance2000發表於2006-03-26

適用於windows作業系統,如果是unix系統需修改。

[@more@]

set feedback off
set linesize 300
set pagesize 3000
set serveroutput on
spool d:deletefile.cmd
declare
filepath varchar2(100) ;
begin
filepath := '&1' ;
for rec in (select thread#,sequence#
from v$log_history
where trunc(first_time) = trunc(sysdate - 1)
and sequence# > 991)
loop
dbms_output.put_line('del ' || filepath || '' || rec.thread#
|| '_' || rec.sequence# || '.dbf') ;
end loop ;
end ;
/
spool off
set feedback on
set linesize 80
set pagesize 14
$d:deletefile.cmd
$del d:deletefile.cmd
exit

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

相關文章