------------------------------------------------------------------------------------------------- -- Script : dump_last_log.sql ------------------------------------------------------------------------------------------------- -- This script will dump the last log file. -- If the log file is big with enormous activity, this might take much resource. -- -- -- Author : Riyaj Shamsudeen -- No implied or explicit warranty ! ------------------------------------------------------------------------------------------------- set serveroutput on size 1000000 declare v_sqltext varchar2(255); begin select 'alter system dump logfile '||chr(39)||member||chr(39) into v_sqltext from v$log lg, v$logfile lgfile where lg.group# = lgfile.group# and lg.sequence# = (select sequence#-1 from v$log where status='CURRENT' and thread#=(select thread# from v$instance ) and lg.thread#=(select thread# from v$instance) and rownum <2 ; dbms_output.put_line ('Executing :'||v_sqltext); execute immediate v_sqltext; end; / -------------------------------------------------------------------------------------------------