Class Notes2
Class Notes2
causes for wait events, along with explanations and potential solutions:
2. DB File Sequential ReadThis event generally indicates a single block read (an
index read, for example). A large number of waits here could indicate poor joining
orders of tables, or unselective indexing. It is normal for this number to be large
for a high-transaction, well-tuned system, but it can indicate problems in some
circumstances. You should correlate this wait statistic with other known issues within
the Statspack report, such as inefficient SQL. Check to ensure that index scans are
necessary, and check join orders for multiple table joins. The DB_CACHE_SIZE will
also be a determining factor in how often these waits show up. Problematic hash-
area joins should show up in the PGA memory, but they're also memory hogs that
could cause high wait numbers for sequential reads. They can also show up as direct
path read/write waits.
3. Free BufferThis indicates your system is waiting for a buffer in memory, because
none is currently available. Waits in this category may indicate that you need to
increase the DB_BUFFER_CACHE, if all your SQL is tuned. Free buffer waits could
also indicate that unselective SQL is causing data to flood the buffer cache with index
blocks, leaving none for this particular statement that is waiting for the system to
process. This normally indicates that there is a substantial amount of DML
(insert/update/delete) being done and that the Database Writer (DBWR) is not
writing quickly enough; the buffer cache could be full of multiple versions of the
same buffer, causing great inefficiency. To address this, you may want to consider
accelerating incremental checkpointing, using more DBWR processes, or
increasing the number of physical disks.
4. Buffer BusyThis is a wait for a buffer that is being used in an unshareable way or
is being read into the buffer cache. Buffer busy waits should not be greater
than 1 percent. Check the Buffer Wait Statistics section (or V$WAITSTAT) to find
out if the wait is on a segment header. If this is the case, increase the freelist groups
or increase the pctused to pctfree gap. If the wait is on an undo header, you can
address this by adding rollback segments; if it's on an undo block, you need to
reduce the data density on the table driving this consistent read or increase the
DB_CACHE_SIZE. If the wait is on a data block, you can move data to another block
to avoid this hot block, increase the freelists on the table, or use Locally Managed
Tablespaces (LMTs). If it's on an index block, you should rebuild the index, partition
the index, or use a reverse key index. To prevent buffer busy waits related to data
blocks, you can also use a smaller block size: fewer records fall within a single block
in this case, so it's not as "hot." When a DML (insert/update/ delete) occurs, Oracle
Database writes information into the block, including all users who are "interested" in
the state of the block (Interested Transaction List, ITL). To decrease waits in this
area, you can increase the initrans, which will create the space in the block to allow
multiple ITL slots. You can also increase the pctfree on the table where this block
exists (this writes the ITL information up to the number specified by maxtrans, when
there are not enough slots built with the initrans that is specified).
6. Enqueue
7. Log Buffer SpaceThis wait occurs because you are writing the log buffer faster
than LGWR can write it to the redo logs, or because log switches are too slow. To
address this problem, increase the size of the log files, or increase the size of the log
buffer, or get faster disks to write to. You might even consider using solid-state
disks, for their high speed.
8. Log File SwitchAll commit requests are waiting for "logfile switch (archiving
needed)" or "logfile switch (chkpt. Incomplete)." Ensure that the archive disk is not
full or slow. DBWR may be too slow because of I/O. You may need to add more or
larger redo logs, and you may potentially need to add database writers if the DBWR
is the problem.
9. Log File Sync.When a user commits or rolls back data, the LGWR flushes the
session's redo from the log buffer to the redo logs. The log file sync process must
wait for this to successfully complete. To reduce wait events here, try to commit
more records (try to commit a batch of 50 instead of one at a time, for example).
Put redo logs on a faster disk, or alternate redo logs on different physical disks, to
reduce the archiving effect on LGWR. Don't use RAID 5, since it is very slow for
applications that write a lot; potentially consider using file system direct I/O or raw
devices, which are very fast at writing information.
10. Idle Event.There are several idle wait events listed after the output; you can
ignore them. Idle events are generally listed at the bottom of each section and
include such things as SQL*Net message to/from client and other background-
related timings. Idle events are listed in the stats$idle_event table.