
Read by other session 等待事件
Ask Oracle 社区 | www.askoracle.org
技术交流群:212299542
This wait event occurs when we are trying to access a buffer in the buffer
cache but we find that the buffer is currently being read from disk by another user
so we need to wait for that to complete before we can access it. In previous
versions, this wait was classified under the "buffer busy waits" event. However, in
Oracle 10.1 and higher, the wait time is now broken out into the "read by other
session" wait event.
Excessive waits for this event are typically due to several processes repeatedly
reading the same blocks, e.g. many sessions scanning the same index or
performing full table scans on the same table. Tuning this issue is a matter of
finding and eliminating this contention。
-----解释
当我们查询一条数据时,Oracle 第一次会从磁盘将数据读入 buffer cache。如果有
两个戒者多个 session 请求相同的信息,那么第一个 session 会将这个信息读入 buffer
cache,其他的 session 就会出现等待。 在 10g 之前,该等待事件还是在 bufferbusy waits
之下,在 Oracle 10g 之后,单独将该事件拿出并命令为 read by other session。
一般来说出现这种等待事件是因为多个迚程重复的读取相同的 blocks,比如一些
session 扫描相同的 index 戒者在相同的 block 上执行 full table scan。解决这个等待事件
最好是找到并优化相关的 SQL 诧句。
1. 如果系统中有这种等待事件,我们可以通过以下 SQL 查询 v$session_wait 得到详细信
息
SELECT p1 "file#", p2 "block#", p3 "class#"
FROM v$session_wait
WHERE event = 'read by other session';
评论