Professional Documents
Culture Documents
V$SYSTEM_EVENT V$SESSION_EVENT
Content: system-level data Content: session-level granularity
V$SESSION_WAIT (X$KSUSECST)
Content: Fine-grain data
Common Wait Events
Events to ignore:
KXFX: Execution Message Dequeue – Slave
PX Deq: Execution Msg
Events to monitor: KXFQ: kxfqdeq - normal deqeue
PX Deq: Table Q Normal
db file sequential read
Wait for credit - send blocked
db file scattered read PX Deq Credit: send blkd
Wait for credit - need buffer to send
latch free
PX Deq Credit: need buffer
direct path read Wait for credit - free buffer
PX Deq Credit: free buffer
direct path write parallel query dequeue wait
Enqueue PX Deque wait
Parallel Query Idle Wait – Slaves
library cache pin PX Idle Wait slave wait
buffer busy waits dispatcher timer virtual circuit status
pipe get rdbms ipc message
free buffer waits rdbms ipc reply pmon timer
smon timer PL/SQL lock timer
WMON goes to sleep client message
SQL*Net message from client (* debatable)
Null event (* debatable)
Handling Wait Events
Db file sequential read & Db file scattered read
What are they a symptom of? Handling these wait events requires
a) Low cache hit ratio you to know:-
b) Slow I/O subsystem 1. The amount of time the events
are costing the process.
c) Physical I/O calls
2. The SQL statement that is
d) Small block size
associated with the events.
e) Small buffer cache
Contention for the Shared Pool & Library Cache latches is symptomatic of?
a) Hard parses – literal SQL statements.
b) Soft parses.
c) Oversized shared pool.
d) Bad application.
Solution: If not symptom c), the real fix has to come from the application.
Workarounds:
• Set CURSOR_SHARING = FORCE
• Set SESSION_CACHED_CURSORS
Handling Wait Events
Latch Free: Cache Buffers Chains
Solutions:
• Tune the application and SQL statements.
• Reduce the level of concurrency.
Workarounds:
• Spread the hot blocks across multiple CBC latches.
• Increase the _SPIN_COUNT (9i and above, use
_LATCH_CLASS and _LATCH_CLASSES).
• Increase _DB_BLOCK_HASH_BUCKETS.
• Increase _DB_BLOCK_HASH_LATCHES.
Handling Wait Events
Buffer Busy Waits
BBW contention is symptomatic of?
a) Read/read, read/write, or write/write contention.
b) Corrupted buffer pin.
c) Insufficient INITRANS.
d) Large block size.
BBW contention for data block class (class #1), reason code 220
• Reduce the level of concurrency or change the partitioning
method.
• Reduce the number of rows in the block.
• Rebuild the object in another tablespace with a smaller block
size (Oracle9i and above).
Handling Wait Events
Buffer Busy Waits
Solutions depend on the class of block and reason code:
BBW contention for data segment header (class #4)
• Increase the number of FREELISTS and FREELIST GROUPS of
the identified object.
• Ensure the gap between PCTFREE and PCTUSED is not too small.
• Ensure the next extent size is not too small.
Solutions:
• Optimize the SQL statements.
• Increase the number of DBWR processes.
• Use appropriate I/O operation (async or sync).
• Lower the FAST_START_MTTR_TARGET value.
• Reduce the buffer cache size.
• Increase the buffer cache size.
• Pre-scan the table after each load.
Handling Wait Events
Log File Sync
Log File Sync wait is symptomatic of?
a) Oversized log buffer.
b) High commit frequency.
c) Bad application.
d) Slow LGWR process.
Handling the Log File Sync event requires you to know:-
1. The amount of time a session spent waiting on the event.
2. The type of job (batch or OLTP) that is associated with the event.
Solution:
• Reduce the commit frequency.
Workarounds:
• Reduce the log buffer size or lower the _LOG_IO_SIZE.
• Increase LGWR I/O throughput.
Handling Wait Events
Enqueue
Enqueue contention is symptomatic of?
a) Concurrent access to the DBMS_AQ package.
b) Concurrent transactions with incompatible lock requests for a
database resource.
c) Concurrent transactions with incompatible lock requests for a
latch.
d) Poor application design.