Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Log switches
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('-----------------------------');
![]() |
![]() |