denrepo

OraclePerformance

Top wait events since startup

The 15 non-idle waits with the most total time since the instance started, with average wait in milliseconds. Averages matter: 'db file sequential read' over 10 ms suggests slow storage.

Not yet verified. How scripts are tested

ora-system-waits.sql
1CLEAR COLUMNS2SET LINESIZE 140 PAGESIZE 100 TRIMOUT ON TAB OFF3COLUMN event       FORMAT A454COLUMN wait_class  HEADING "WAIT CLASS" FORMAT A155COLUMN total_waits HEADING "WAITS"      FORMAT 999,999,999,9906COLUMN waited_s    HEADING "TOTAL S"    FORMAT 999,999,9907COLUMN avg_ms      HEADING "AVG MS"     FORMAT 999,990.998 9SELECT * FROM (10  SELECT event, wait_class, total_waits,11         ROUND(time_waited_micro / 1e6) AS waited_s,12         ROUND(time_waited_micro / NULLIF(total_waits, 0) / 1000, 2) AS avg_ms13  FROM v$system_event14  WHERE wait_class <> 'Idle'15  ORDER BY time_waited_micro DESC16) WHERE ROWNUM <= 15;

Save it as ora-system-waits.sql and run it with SQL> @ora-system-waits.

Open in denrepo

More Oracle scripts: Performance