db file scattered read,direct path read 等待事件的原因以及解决方法

db file sequential read (single block read into one SGA buffer)

db file scattered read (multiblock read into many discontinuous SGA buffers)

direct read (single or multiblock read into the PGA, bypassing the SGA)

direct path read and direct path read temp
direct path write and direct path write temp

[@more@]

10G

通过 v$session 查询
SELECT a.owner, a.object_name, a.subobject_name, a.object_type,b.sid,b.program
FROM DBA_OBJECTS a, V$SESSION b
WHERE data_object_id = b.row_wait_obj and b.EVENT = 'db file scattered read';


通过 v$session_wait 查询 等待事件db file scattered read 对应的sql
select /*+ ORDERED */ sql_text from v$sqltext a
where a.hash_value = (
select sql_hash_value from v$session b where sid='34'
)
order by piece asc


sql 所执行的 io 太多 (物理io,逻辑 io)

不是最优的sql :
1) 没有使用索引
2)高并行度的表的查询
3)统计信息不对
4)DB_FILE_MULTIBLOCK_READ_COUNT 设置的太大,使sql 倾向于全表扫描

db file sequential read (single block read into one SGA buffer)

db file scattered read (multiblock read into many discontinuous SGA buffers)

direct read (single or multiblock read into the PGA, bypassing the SGA)


direct path read and direct path read temp
direct path write and direct path write temp

以下情况可以发生该等待时间
大量的排序使排序的数据直接写入磁盘,需要的时候又从磁盘中直接读入pga
多并行度扫描表
磁盘io 太慢

解决方法:

优化sql,增大pga (看pga 是自动管理还是手工管理),增大Hash Area Size 大小

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/66233/viewspace-1022965/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/66233/viewspace-1022965/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值