Skip to content

Oracle Wait Events Cheat Sheet - Performance Tuning Quick Reference

Quick reference for understanding and troubleshooting Oracle database wait events.

-- Current top wait events
SELECT
EVENT,
TOTAL_WAITS,
TIME_WAITED_MICRO/1000000 AS time_waited_sec,
AVERAGE_WAIT/100 AS avg_wait_sec,
WAIT_CLASS
FROM V$SYSTEM_EVENT
WHERE WAIT_CLASS != 'Idle'
ORDER BY TIME_WAITED_MICRO DESC
FETCH FIRST 20 ROWS ONLY;

Wait ClassDescriptionCommon Events
User I/ODisk reads for user queriesdb file sequential read, db file scattered read
System I/OBackground process I/Olog file sync, control file I/O
ConcurrencyLock contentionbuffer busy waits, library cache lock
CommitTransaction commitlog file sync
ApplicationApplication-level waitsenq: TX - row lock contention
ConfigurationResource limitslog buffer space
NetworkNetwork waitsSQL*Net message
IdleSession waiting for workSQL*Net message from client

Single block read (index lookup)

-- Find sessions waiting on db file sequential read
SELECT SID, SERIAL#, USERNAME, SQL_ID, EVENT, P1, P2, P3
FROM V$SESSION
WHERE EVENT = 'db file sequential read';
-- P1=file#, P2=block#, P3=blocks
-- Find hot objects causing waits
SELECT
o.OWNER,
o.OBJECT_NAME,
o.OBJECT_TYPE,
COUNT(*) AS wait_count
FROM V$ACTIVE_SESSION_HISTORY ash
JOIN DBA_OBJECTS o ON ash.CURRENT_OBJ# = o.OBJECT_ID
WHERE ash.EVENT = 'db file sequential read'
AND ash.SAMPLE_TIME > SYSDATE - 1/24
GROUP BY o.OWNER, o.OBJECT_NAME, o.OBJECT_TYPE
ORDER BY COUNT(*) DESC
FETCH FIRST 10 ROWS ONLY;

Resolution: Tune SQL, add indexes, increase buffer cache, faster storage.


Multi-block read (full table scan)

-- Find full table scans causing waits
SELECT
o.OWNER,
o.OBJECT_NAME,
s.SQL_ID,
s.SQL_TEXT
FROM V$SESSION s
JOIN DBA_OBJECTS o ON s.ROW_WAIT_OBJ# = o.OBJECT_ID
WHERE s.EVENT = 'db file scattered read';

Resolution: Add indexes, partition tables, increase DB_FILE_MULTIBLOCK_READ_COUNT.


Parallel queries, temp segments, LOBs

-- Check parallel operations
SELECT
SID,
SQL_ID,
EVENT,
P1TEXT || '=' || P1 AS detail
FROM V$SESSION
WHERE EVENT LIKE 'direct path%';

Resolution: Normal for parallel queries. For temp waits, increase temp tablespace or tune queries.


Waiting for redo to write to disk on COMMIT

-- Check log file sync waits
SELECT
EVENT,
TOTAL_WAITS,
AVERAGE_WAIT/100 AS avg_wait_sec
FROM V$SYSTEM_EVENT
WHERE EVENT = 'log file sync';
-- Check log writer performance
SELECT
NAME,
VALUE
FROM V$SYSSTAT
WHERE NAME LIKE 'redo%';

Resolution: Faster redo log storage (SSD), reduce commit frequency, batch commits.


Log buffer too small

-- Check log buffer configuration
SHOW PARAMETER log_buffer;
-- Check log buffer waits
SELECT * FROM V$SYSSTAT WHERE NAME LIKE '%log buffer%';

Resolution: Increase LOG_BUFFER or use faster redo storage.


-- log file switch (checkpoint incomplete)
-- Log files too small, checkpoint not complete
SELECT GROUP#, STATUS, BYTES/1024/1024 AS size_mb FROM V$LOG;

Resolution: Add more/larger redo log groups, tune checkpoint.


Contention on hot blocks

-- Find hot blocks
SELECT
o.OWNER,
o.OBJECT_NAME,
o.OBJECT_TYPE,
ash.CURRENT_FILE#,
ash.CURRENT_BLOCK#,
COUNT(*) AS waits
FROM V$ACTIVE_SESSION_HISTORY ash
JOIN DBA_OBJECTS o ON ash.CURRENT_OBJ# = o.OBJECT_ID
WHERE ash.EVENT = 'buffer busy waits'
AND ash.SAMPLE_TIME > SYSDATE - 1/24
GROUP BY o.OWNER, o.OBJECT_NAME, o.OBJECT_TYPE, ash.CURRENT_FILE#, ash.CURRENT_BLOCK#
ORDER BY COUNT(*) DESC
FETCH FIRST 10 ROWS ONLY;

Resolution: Reduce contention via partitioning, reverse key indexes, hash partitioning.


No free buffers in buffer cache

-- Check buffer cache usage
SELECT
NAME,
BLOCK_SIZE,
CURRENT_SIZE/1024/1024 AS current_mb,
BUFFERS
FROM V$BUFFER_POOL;

Resolution: Increase buffer cache (DB_CACHE_SIZE), check for inefficient queries.


Block being read by another session

-- Find concurrent block readers
SELECT SID, SERIAL#, EVENT, P1, P2, SQL_ID
FROM V$SESSION
WHERE EVENT = 'read by other session';

Resolution: Usually transient. If persistent, investigate the SQL reading the same blocks.


Row-level lock contention

-- Find blocking sessions
SELECT
s1.SID AS blocked_sid,
s1.USERNAME AS blocked_user,
s2.SID AS blocking_sid,
s2.USERNAME AS blocking_user,
s1.EVENT,
s1.SQL_ID
FROM V$SESSION s1
JOIN V$SESSION s2 ON s1.BLOCKING_SESSION = s2.SID
WHERE s1.EVENT LIKE 'enq: TX%';

Resolution: Application design, reduce transaction scope, timeout handling.


Table-level lock (usually DML on unindexed FK)

-- Find missing indexes on foreign keys
SELECT
c.TABLE_NAME,
c.CONSTRAINT_NAME,
cc.COLUMN_NAME
FROM DBA_CONSTRAINTS c
JOIN DBA_CONS_COLUMNS cc ON c.CONSTRAINT_NAME = cc.CONSTRAINT_NAME
WHERE c.CONSTRAINT_TYPE = 'R'
AND NOT EXISTS (
SELECT 1 FROM DBA_IND_COLUMNS ic
WHERE ic.TABLE_NAME = c.TABLE_NAME
AND ic.COLUMN_NAME = cc.COLUMN_NAME
);

Resolution: Add indexes on foreign key columns.


Shared pool contention

-- Check library cache stats
SELECT
NAMESPACE,
GETS,
GETHITS,
PINS,
PINHITS,
INVALIDATIONS
FROM V$LIBRARYCACHE;

Resolution: Reduce hard parsing (use bind variables), increase shared pool.


Idle wait - client think time

This is an idle wait. High values indicate application processing time between database calls.


Sending data to client

-- Check network waits
SELECT EVENT, TIME_WAITED_MICRO/1000000 AS secs
FROM V$SESSION_EVENT
WHERE SID = &sid
AND EVENT LIKE 'SQL*Net%';

Resolution: Network latency, result set size, fetch size.


Large result sets

Resolution: Reduce result set size, increase SDU_SIZE.


Global cache block contention

-- Check GC waits
SELECT EVENT, TOTAL_WAITS, TIME_WAITED_MICRO/1000000 AS secs
FROM V$SYSTEM_EVENT
WHERE EVENT LIKE 'gc%'
ORDER BY TIME_WAITED_MICRO DESC;

Receiving blocks from remote instance

Resolution: Reduce inter-instance traffic, application partitioning.


SELECT
SID,
SERIAL#,
USERNAME,
STATUS,
EVENT,
WAIT_CLASS,
SECONDS_IN_WAIT,
STATE,
SQL_ID
FROM V$SESSION
WHERE USERNAME IS NOT NULL
AND WAIT_CLASS != 'Idle'
ORDER BY SECONDS_IN_WAIT DESC;
SELECT
EVENT,
COUNT(*) AS samples,
ROUND(COUNT(*) * 100 / SUM(COUNT(*)) OVER(), 2) AS pct
FROM V$ACTIVE_SESSION_HISTORY
WHERE SAMPLE_TIME > SYSDATE - 1/24
AND WAIT_CLASS != 'Idle'
GROUP BY EVENT
ORDER BY COUNT(*) DESC
FETCH FIRST 10 ROWS ONLY;

Wait EventLikely CauseResolution
db file sequential readIndex lookups, disk I/OTune SQL, increase buffer cache
db file scattered readFull table scansAdd indexes, partition
log file syncSlow redo writesFaster storage, batch commits
buffer busy waitsHot blocksPartitioning, hash clusters
enq: TX - row lockRow contentionApplication design
library cache lockHard parsingBind variables
latch: cache buffers chainsBuffer chain contentionReduce logical I/O
cursor: pin S wait on XCursor contentionReduce version count