spool redo_swt.rslt;

column group#        format 999 heading "Group|Number"
column thread#       format 999  heading "Thread|Number"
column sequence#     format 999,999 heading "Sequence|Number"
column bytes         format 999,999,999 heading "Size|KBytes"
column members       format 999 heading "Members"
column archived      format a3 heading "Archived?"
column status        format a8 heading "Status"
column first_change# format 999,999 heading "First|Change|Number" 
column first_time               heading "First Time Switch"
column member        format a35 heading "Group Members"

set feedback off

ttitle "Redo Log Files"

select f.group#, f.status, f.member, l.bytes/1024 bytes
from   v$logfile f, v$log l
where  f.group# = l.group#
order  by f.group#;

ttitle "Redo Log Switches"

select group#, thread#, sequence#, members,
       archived, status, first_change#, first_time
from   v$log
order  by group#;

ttitle off
set head off 

select 'Switches occur at a rate of 1 switch every '||
       round((24*60)/count(*))||' minutes over the past 24 hours'
from v$loghist
where to_date(first_time,'MM/DD/YY HH24:MI:SS') >= sysdate-1;
REM modify from 'MM/DD/YY' to 'DD/MM/YY' for Oracle8i Release 2

spool off;
commit;

