dbfilesequentialread及优化-创新互联

db file sequential read:直接路径读;

创新互联公司专业IDC数据服务器托管提供商,专业提供成都服务器托管,服务器租用,服务器托管服务器托管,成都多线服务器托管等服务器托管服务。

 

官方说明如下:

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及优化

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

 

db file sequential read及优化

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

 

db file sequential read及优化

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

 

db file sequential read及优化

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

 

db file sequential read的优化方法:

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

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

本文作者:JOHN

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

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


网页名称:dbfilesequentialread及优化-创新互联
标题URL:http://scyanting.com/article/dpegie.html