BUFFER CACHE之主要的等待事件

原因:资源紧张,等待其释放。

原因的原因:1. lgwr和DBWn进程写太慢;2. Buffer和latch不可用

原因的原因的原因:全表扫描、library cache latches数太多等。

视图:V$SYSTEM_EVENT (instance-level waits), V$SESSION_EVENT (session-level waits)

注意: 等待与共享池和缓冲池中的高命中率(high hit ratios)无关!换句话说,高命中率也会有长时间的等待。

* Buffer Busy Waits

This wait indicates that there are some buffers in the buffer cache that multiple

processes are attempting to access concurrently. To determine the wait statistics for

each class of buffer, query the v$waitstat view. Common buffer classes that have

buffer busy waits include:

缓冲池中的buffer块被多个进程并发访问,用v$waitstat视图查看各类buffer的等待统计数据。

- Data Block

If the contention is on tables or indexes (not the segment header):

Check for SQL statements using unselective indexes.

Check for right-hand-indexes (that is, indexes that are inserted at the same

point by many processes; for example, those which use sequence number

generators for the key values).

Consider using automatic segment-space management or increasing free lists to

avoid multiple processes attempting to insert into the same block.

- Data Block (continued)

The v$session_wait view will provide the file and block numbers (in the

P* columns) for those blocks that have the most frequent block waits. These

blocks can then be mapped to which object they belong.

- Undo Header

Displays contention on rollback segment header: If you are not using automatic

undo management, then add more rollback segments.

- Undo Block

Displays contention on rollback segment block: If you are not using automatic

undo management, consider making rollback segment sizes larger.

* Free Buffer Inspected

This is a measure of how many buffers on the LRU list are inspected by a process

looking for a free buffer (writing a new block) before triggering DBWn to flush the

dirty buffers to disk.

* Free Buffer Waits

This wait event indicates that a server process was unable to find a free buffer and

has requested the database writer to make free buffers by writing out dirty buffers. A

dirty buffer is a buffer whose contents have been modified. Dirty buffers are freed

for reuse when DBWn has written the blocks to disk.

To resolve the contention, DBWn has to make buffers available faster for

overwriting. To achieve this, examine ways of speeding up the write process. This

event is also an indication that the buffer cache is too small. Examine the hit ratios

for the buffer cache to determine if the cache should be resized.

If this event occurs frequently, examine the session waits for DBWn to determine

whether there is anything delaying DBWn.

Causes

DBWn may not be keeping up with writing dirty buffers in the following situations:

- The I/O system is slow.

Solution: Check that the files are equally distributed across all devices. If that

produces no effect get faster disks or place offending files onto faster disks.

- The I/O is waiting for resources, such as latches.

Solution: Check that the files are equally distributed across all devices. If that

produces no effect get faster disks or place offending files onto faster disks.

- The buffer cache is so small that DBWn spends most of its time cleaning out

buffers for server processes.

Solution: Increase the buffer cache size.

- The buffer cache is so large that one DBWn process cannot free enough buffers

in the cache to satisfy requests.

Solution: Decrease the buffer cache size or initialize more database writer

processes.

时间: 2024-08-28 11:57:02

BUFFER CACHE之主要的等待事件的相关文章

cache buffer 相关的闩锁等待事件(cache buffers lru chain/cache buffers chain)

cache buffers lru chain原因高负荷的cache吞吐量,效率差的sql语句(全表扫描,或不正确的index range scans)dbwr写出速度太慢,前台进程花费很多时间持有latch查找free buffer. cache buffers lru chain保护buffer的链表在cache中,当增加,移除,移动一个buffer从list时,cblc latch必须被获取.在SMP(对称多处理)的系统上,oracle自动设置LRU latche数量是cpu个数的一半.在

关于cursor: pin S wait on X 和 library cache pin 及其他等待事件

cursor: pin S wait on X 也好,library cache pin 也罢,这都是shared pool 的等待事件,关于此类的等待事件,阅读的书有:<<oracle 内核技术揭秘>>,<<高级owi与oracle性能调整>> 其中,<<oracle 内核技术揭秘>> 是吕海波大师所著,吕大师也是我的OCM培训老师,在此向吕大师致敬. <<高级owi与oracle性能调整>> 是Oracle

Oracle常见等待事件说明

Oracle的等待事件是衡量Oracle运行状况的重要依据及指标.等待事件的概念是在Oracle7.0.1.2中引入的,大致有100个等待事件.在Oracle 8.0中这个数目增加到了大约150个,在Oracle8i中大约有200个事件,在Oracle9i中大约有360个等待事件.主要有两种类别的等待事件,即空闲(idle)等待事件和非空闲(non-idle)等待事件. 空闲事件指Oracle正等待某种工作,在诊断和优化数据库的时候,我们不用过多注意这部分事件. 常见的空闲事件有: ? disp

DBA_Oracle Event等待事件分析(概念)

2014-12-18 BaoXinjian 一.摘要 Oracle的等待事件是衡量Oracle运行状况的重要依据及指标. 等待事件的概念是在Oracle7.0.1.2中引入的,大致有100个等待事件. 在Oracle 8.0中这个数目增加到了大约150个,在Oracle8i中大约有200个事件,在Oracle9i中大约有360个等待事件. 二.等待事件分类 主要有两种类别的等待事件,即空闲(idle)等待事件和非空闲(non-idle)等待事件. 1. 空闲事件指Oracle正等待某种工作,在诊

系统遇到read by other session等待事件

今天用户反应系统很慢,做了一个AWR发现有大量read by other session等待事件,伴有大量的db file sequential read的等待事件: read by other session等待事件说明: 当我们请求一个数据时,Oracle 第一次会从磁盘将数据读入buffer cache.如果有两个或者多个session 请求相同的信息,那么第一个session 会将这个信息读入buffer cache,其他的session 就会出现等待. 在10g之前,该等待事件还是在b

Oracle常见的几种等待事件

1. CPU time 正常情况,在等待事件中排首位 NUM_CPU_SOCKETS    物理CPU的数目 NUM_CPU_CORES       CPU的核数 NUM_CPUS                  逻辑CPU的数目 2. Buffer busy waits (Buffer busy wait / read by other session) 一般这2个等待事件可以归为一起处理,建议进行监控 . 可能是如下操作引起 select/select --- read by other

Buffer Cache

Buffer Cache Buffer Cache是SGA区中专门用于存放从数据文件中读取的的数据块拷贝的区域.Oracle进程如果发现需要访问的数据块已经在buffer cache中,就直接读写内存中的相应区域,而无需读取数据文件,从而大大提高性能(内存的读取效率是磁盘读取效率的14000倍).Buffer cache对于所有oracle进程都是共享的,即能被所有oracle进程访问. 一.CBC.Hash Bucket与Hash Chain List     CBC链,用来查找block是否

常见的global cache等待事件

gc cr disk read事件 当node 1需要读取的block在node 2的buffer cache里,且block中包含尚未提交的事务,那么node 2的LMS进程需要使用undo record将该block回滚至node 1发起那一时刻的内容后再传给node 1,假如这时undo record所在的undo block不在node 2的buffer cache里,node 1上就会出现gc cr disk read事件,表示node 1正等待node 2的LMS授予其直接从磁盘读取

Oracle 等待事件之 buffer busy waits

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 classe