buffer busy waits
This wait indicates that there are some buffers in the buffer cache that multiple processes are attempting to access concurrently. Query
V$WAITSTAT
for the wait statistics for each class of buffer. Common buffer classes that have buffer busy waits include data
block
, segment
header
, undo
header
, and undo
block
.
多个进程同时访问Buffer cache中的相同数据导致。常见的遭遇buffer busy waits 的缓冲类包括:
data
block
, segment
header
, undo
header
, 和undo
block
Check the following
V$SESSION_WAIT
parameter columns:
P1
: File IDP2
: Block IDP3
: Class ID
Causes
To determine the possible causes, first query V$SESSION
to identify the value of ROW_WAIT_OBJ#
when the session waits for buffer
busy
waits
. For example:
确定问题的原因,需要结合V$SESSION
和DBA_OBJECTS,详细参见如下示例:
SELECT row_wait_obj#
FROM V$SESSION
WHERE EVENT = 'buffer busy waits';
To identify the object and object type contended for, query DBA_OBJECTS
using the value for ROW_WAIT_OBJ#
that is returned from V$SESSION
. For example:
SELECT owner, object_name, subobject_name, object_type
FROM DBA_OBJECTS
WHERE data_object_id = &row_wait_obj;
Actions
The action required depends on the class of block contended for and the actual segment.
解决方法依赖于class of block contended 和actual segment。
segment header
If the contention is on the segment header, then this is most likely free list contention.
Automatic segment-space management in locally managed tablespaces eliminates the need to specify the PCTUSED
, FREELISTS
, and FREELIST
GROUPS
parameters. If possible, switch from manual space management to automatic segment-space management (ASSM).
尽可能的将MSSM转化为ASSM.
The following information is relevant if you are unable to use ASSM (for example, because the tablespace uses dictionary space management).
A free list is a list of free data blocks that usually includes blocks existing in several different extents within the segment. Free lists are composed of blocks in which free space has not yet reached PCTFREE or used space has shrunk below PCTUSED. Specify the number of process free lists with the FREELISTS
parameter. The default value of FREELISTS
is one. The maximum value depends on the data block size.
To find the current setting for free lists for that segment, run the following:
SELECT SEGMENT_NAME, FREELISTS
FROM DBA_SEGMENTS
WHERE SEGMENT_NAME = segment name
AND SEGMENT_TYPE = segment type;
Set free lists, or increase the number of free lists. If adding more free lists does not alleviate the problem, then use free list groups (even in single instance this can make a difference). If using Oracle RAC, then ensure that each instance has its own free list group(s)
data block
If the contention is on tables or indexes (not the segment header):
若争用是在表或者索引上(非segment header)
-
Check for right-hand indexes. These are indexes that are inserted into at the same point by many processes. For example, those that use sequence number generators for the key values.
检查右侧 indexe
-
Consider using ASSM, global hash partitioned indexes, or increasing free lists to avoid multiple processes attempting to insert into the same block.
使用ASSM,全局hash分区索引或者是增加free list 来避免多个进程插入相同的块。
undo header
For contention on rollback segment header:
-
If you are not using automatic undo management, then add more rollback segments.
若未使用auto undo management就增加更多的rollback segments。