等待模拟-read by other session

简介: 表TEST是一个130M的表。create or replace procedure test_buffer_readis begin   for x in (select * from test) loop    null;  end loop;end;var job_no number;begin   for idx in 1.
表TEST是一个130M的表。

create or replace procedure test_buffer_read
is 
begin 
  for x in (select * from test) loop
    null;
  end loop;
end;

var job_no number;
begin 
  for idx in 1..20 loop
      dbms_job.submit(:job_no,'test_buffer_read;');
end loop;
commit;
end;

然后手动执行一次 execute test_buffer_read
select * from v$session_event a,(select SID from v$mystat where rownum
where a.SID=b.sid;

对于这样的,很可能会出现很多等待,
EVENT
----------------------------------------------------------------
latch: cache buffers chains
latch: cache buffers chains
latch: cache buffers chains
db file scattered read
read by other session
read by other session
db file sequential read
latch: cache buffers chains
read by other session
db file scattered read
read by other session
job scheduler coordinator slave wait

往往这些等待同时出现,需要知道他们是息息相关的


可以用如下语句查看,当前会话中的等待对象如果等待的是data block的话,但是速度很慢。。
    
    SELECT a.segment_name,b.wait_time,'LOG READ' FROM DBA_EXTENTS a,
    (select p1,p2,WAIT_TIME from v$session_wait where event in  ('read by other session','buffer busy waits') and p3=1) b
    where a.file_id=b.p1 and b.p2 between a.block_id and a.block_id+a.blocks-1
    union all
    SELECT a.segment_name,b.wait_time,'phy READ' FROM DBA_EXTENTS a,
    (select p1,p2,WAIT_TIME from v$session_wait where event in  ('db file scattered read','db file sequential read')) b
    where a.file_id=b.p1 and b.p2 between a.block_id and a.block_id+a.blocks-1
    order by wait_time; 
阅读(2116) | 评论(0) | 转发(0) |
相关文章
|
安全 Linux Shell
Read-only file system 问题分析与解决
Read-only file system 问题分析与解决
Read-only file system 问题分析与解决
|
3月前
|
Linux C语言 Python
perf_event_open 学习 —— 通过read的方式读取硬件技术器
perf_event_open 学习 —— 通过read的方式读取硬件技术器
|
存储 缓存
【什么是Read Write Through机制】
【什么是Read Write Through机制】
163 0
|
缓存 Linux 数据安全/隐私保护
实战分享|Write Cache设置效果为何有差异?
sdparm和hdparm去修改HDD的write cache,发现在系统下write cache设置的效果有差异。
|
安全 Linux Shell
Read-only file system 问题分析与解决| 学习笔记
快速学习 Read-only file system 问题分析与解决。
 Read-only file system 问题分析与解决| 学习笔记
|
物联网 Linux C语言
验证 read 阻塞|学习笔记
快速学习验证 read 阻塞
|
SQL Oracle NoSQL
gdb调试之--read by other session 等待事件的重现
发生read by other session 等待事件,肯定是两个会话同时物理读同一个数据块,假设有两个会话,会话1发生物理读,会话2正要去物理读发现会话1正在物读理产生,此时会话2发生等待,此等待就是read by other session 等待事件。
|
SQL NoSQL Oracle
[20180305]手工模拟buffer busy wait.txt
[20180305]手工模拟buffer busy wait.txt --//一般出现buffer busy wait原因,主要是对热块,大量dml操作. --//一种提法:oracle读不会阻塞写,写不会阻塞读,实际上写一定程度会阻塞读,只不过时间很短罢了.
1136 0
|
SQL NoSQL Oracle
[20180301]模拟cursor pin S wait on X.txt
[20180301]模拟cursor pin S wait on X等待事件.txt --//昨天看链接http://www.askmaclean.com/archives/cursor-pin-s-wait-on-x.
1983 0