This article explains about the wait event “read by other session”. In this article I will explain how to further investigate about SQLs and segments involved in this wait event. This should be noted that unless this wait event is the result of slow IO performance, this wait event has to be tuned at the application side or by tuning the segment. To find out which SQLs and which table/index are causing this wait, we can query v$active_session_history (or DBA_HIST_ACTIVE_SESS_HISTORY); SAMPLE_TIME column can be used in WHERE clause to restrict rows for the event details during a specific period. Alternatively, we can also query v$session_wait to find out sessions currently waiting on this wait event.
SQL> select p1, p1text, p2,
p2text, p3, p3text,sql_id from v$active_session_history where event='read by
other session' |
As you can see above, we
have found SQLs as well as blocks and datafile that are involved in wait. You
can further execute following query to find out the segments with the hot
blocks causing this wait event. I executed the query once for the block
returned by v$active_session_history, and once for the block returned by
v$session_wait. In both cases, I found out the same segment/table.
SQL> select
owner,segment_name,segment_type from dba_extents where file_id=10 and
1244164 between block_id and block_id
+ Blocks -1; |
Tuning read by other session
Since we have found out
the SQLs and segment involved in this wait event, we can fix this either by
tuning the SQL such that it accesses fewer number of rows/blocks, thus reducing
the chance of contributing to the hot blocks. In case this wait event is caused
by hot index blocks, recreating the index as reverse key index to spread the
load on hot blocks to several different blocks could also help eliminating this
wait event. Creating index on a table (with hot blocks) to avoid full table
scan should also be helpful.
You may also try creating
SQL Profile for the SQL causing the issue
No comments:
Post a Comment