首页 > 数据库技术 > 详细

[转帖] db file sequential read及优化

时间:2019-10-30 09:50:42      阅读:66      评论:0      收藏:0      [点我收藏+]
http://blog.itpub.net/12679300/viewspace-1185623/

 

db file sequential read及优化

原创 Oracle 作者:wzq609 时间:2014-06-17 22:38:45  16677  0

db file sequential read:顺序读;

 

官方说明如下:

This event signifies that the user process is reading a buffer into the SGA buffer cache and is waiting for a physical I/O call to return. A sequential read is a single-block read.

Single block I/Os are usually the result of using indexes. Rarely, full table scan calls could get truncated to a single block call because of extent boundaries, or buffers present in the buffer cache. These waits would also show up as db file sequential read.

Check the following V$SESSION_WAIT parameter columns:

?P1: The absolute file number

?P2: The block being read

?P3: The number of blocks (should be 1)

 

解释:ORACLE进程需要访问block不能从SGA中获取的时候,因此oracle进程会等待block从I/O读取到SGA;

一个顺序读是一个单块读,单块I/O一般来自索引读的结果;

db file sequential read等待事件有3个参数:

?P1: The absolute file number             文件号

?P2: The block being read                first block#     

?P3: The number of blocks (should be 1)       block数量

db file sequential read等待时间是由于执行对索引,回滚(undo)段,和表(当借助rowid来访问),控制文件和数据文件头的单块读操作SQL语句(用户和递归)引起的。对于这些对象的物理I/O请求是很正常的,因此db file sequential read等待的存在不是一定意味库或应用出错了。如果会话在这事件上花了好长事件,它可能也不是一个糟糕的事情。相反,如果会话花了大量时间在equeue或latch free上,那么一定是有问题。

 

问题:AWR报告中的系统的等待事件中的db file sequential read是否合理?

根据awr报告中的以下重要参数进行解读,以11G的awr报告为例子:

技术分享图片

说明:db file sequential read是指sga中找不到相应的数据,所以跟buffer hit有很大的关系,当buffer hit命中率太低了,相应的db file sequential read就会高,一般buffer hit保持着95%以上;

 

技术分享图片

查看这个报告的db file sequential read的总时间和平均时间;

 

技术分享图片

Foreground Wait Events也会统计db file sequential read所花费的时间和平均时间

 

技术分享图片

根据SQL User I/O等待时间,查看是否有调优的空间;

 

db file sequential read的优化方法:

  1. 从读取开始,增加SGA中buffer cache的大小,避免每次都从硬盘中去读数;
  2. 优化sql语句,减少不必要的块读取;

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

本文作者:JOHN

ORACLE技术博客:ORACLE 猎人笔记               数据库技术群:367875324 (请备注ORACLE管理 )  

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[转帖] db file sequential read及优化

原文:https://www.cnblogs.com/jinanxiaolaohu/p/11750535.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!