-- -----------------------------------------------------------------------------------
-- File Name    : event_histogram.sql
-- Author       : DBA Learning Hub
-- Description  : Displays histogram of the event waits times.
-- Requirements : Access to the V$ views.
-- Call Syntax  : @event_histogram "(event-name)"
-- Last Modified: 15/07/2025
-- -----------------------------------------------------------------------------------

SET VERIFY OFF
COLUMN event FORMAT A30

SELECT event#,
       event,
       wait_time_milli,
       wait_count
FROM   v$event_histogram
WHERE  event LIKE '%&1%'
ORDER BY event, wait_time_milli;

COLUMN FORMAT DEFAULT
SET VERIFY ON