-- redo_bursts.sql: X-minute windows with more than N redo log switches -- Copyright (c) HASHJOIN. MIT License (https://hashjoin.com/kb/license/) -- https://hashjoin.com/kb/oracle/log-switch-bursts/ -- -- Usage: @redo_bursts.sql -- @redo_bursts.sql 3 10 any 3-minute window with more than 10 switches -- -- Reads v$log_history: history goes back control_file_record_keep_time days. -- On RAC, every thread's switches count toward a window. set verify off set lines 132 set pages 200 select interval, &&1 minutes, count(*) switches from (select to_char(trunc(t.first_time) + floor(((t.first_time - trunc(t.first_time))*24*60)/&&1)*&&1/24/60, 'YYYY/MM/DD HH24:MI') as interval from v$log_history t -- where t.first_time between to_date('2026-01-01 00:00','YYYY-MM-DD HH24:MI') -- and to_date('2026-01-01 23:59','YYYY-MM-DD HH24:MI') ) group by interval having count(*) > &&2 order by interval desc; undefine 1 undefine 2