Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Log switches

RE: Log switches

From: Stuart Graham <sgraham_at_intertrain.net>
Date: Fri, 24 Aug 2001 09:26:37 -0700
Message-ID: <F001.00377122.20010824094641@fatcity.com>

Here is a script that I use, which creates a procedure called logtime. You call it, providing it with a parameter which is the last x log switches you want to know the time of...
 

create or replace procedure logtime(p_logs in number default 20) as
 
   v_no_of_logs number

:=p_logs;
 
   v_buffersize number :=

v_no_of_logs*35;
 
   cursor cur_countlog

is   select count(*) cnt     from
v$log_history;
 
   cursor cur_gettimes(p_count

number) is   select rpad(sequence#,8)
seq,         
to_char(first_time,'DD-MON-YYYY:HH24:MI:SS') TIME     from v$log_history    where
rownum<=p_count   minus   select
rpad(sequence#,8) seq,         
to_char(first_time,'DD-MON-YYYY:HH24:MI:SS') TIME     from v$log_history    where
rownum<=p_count-v_no_of_logs;
 

begin
 
  

dbms_output.enable(v_buffersize);   
dbms_output.put_line('SEQ#     TIME');   
dbms_output.put_line('-----------------------------');

 
   for cur_countlogrec in

cur_countlog loop
 
      for

cur_gettimesrec in cur_gettimes(cur_countlogrec.cnt) loop
 

<FONT face="Courier New"
size=2>        
dbms_output.put_line(cur_gettimesrec.seq||' '||cur_gettimesrec.time);
 
      end

loop;
 
   end loop;
 

end;/ Received on Fri Aug 24 2001 - 11:26:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US