Oracle 等待事件 gc current block busy 官方解释,作用,如何使用及优化方法

本站中文解释

Oracle应用程序中的事件gc current block busy是由gc(全局缓存)块繁忙引起的,主要发生在多会话之间分配独立的数据块上。

在Oracle数据库中, 所有用户的查询都需要读取到内存,这样就会有很多的会话在数据存储时互相影响。 如果有一个用户访问一个数据块,那么其他用户也可以访问该数据块,这就是“Global Cache”(全局缓存),即同一数据块可以被多个会话访问。 GC块繁忙就是多个会话抢夺块而发生的。

这个事件是由GC CR建立在多会话之间,用以控制块的访问的机制引起的。 这是介于一种传统的“共享读锁”机制。 当GC CR检测到一个会话试图读取另一个会话正在写的数据块时,就会抛出gc current block busy.这种情况会导致读取延迟,甚至SQL失败。

另外,有时由于指定的数据块没有被足够的GC CR锁定,导致其他会话无法访问该块时也有可能发生gc current block busy事件,这也会导致性能下降。

可以采取一些措施来优化GC CR系统,这样能够减少gc current block busy事件出现的次数。 例如,可以分析查询,加大gc_cr_blocks的大小,或者将gc_block_coalescing参数设置为TRUE。在这种情况下,增大参数gc_db_locks,以此来减少此事件。

如果仍然出现gc current block busy事件,则可以考虑更改数据库优化器模式来改善查询性能,或者最好是重写SQL语句。 同时,避免会话把一个表锁定,应该尽量使用行级锁,这样可以避免多个会话间的锁竞争以及gc current block busy的出现。

总的来说,可以采取多种措施来优化Oracle数据库中的gc current block busy事件,以避免这种情况发生,最终提高数据库性能。

官方英文解释

This event indicates that the requested current buffer was transferred from another instance in the cluster, but the request had to be put on hold at the serving instance.

This could happen when a dirty buffer had to be transferred, in which case REDO needs to be flushed before the Cache Fusion transfer could be processed. This could also happen if the requested buffer was being held by another process on the remote instance. The serving instance would transfer the requested buffer once the REDO flush is complete, or once the buffer is released by the holding process.

Wait Time: The wait time is the actual time it took to receive the requested buffer.

Parameter Description

file#

See “file#”

block#

See “block#”

id#

Block class and global access mode held and requested


数据运维技术 » Oracle 等待事件 gc current block busy 官方解释,作用,如何使用及优化方法