db file sequential read及优化

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管理 )  

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

时间: 2024-07-30 18:36:42

db file sequential read及优化的相关文章

详解 db file sequential read 等待事件

db file sequential read (本文由thomaswoo_dba翻译,转载请注明出处) db file sequential read 事件有三个参数:file#,first block#, block count, 在oracle 10g里,此等待事件在归于 User I/O wait class 下面的. 处理db file sequential read 事件要牢牢把握下面三个主要思想: 1)oracle 进程需要访问的block不能从SGA 中获取,因此oracle 进

db file sequential read 详解

db file sequential read (本文由thomaswoo_dba翻译,转载请注明出处) db file sequential read 事件有三个参数:file#,first block#, block count, 在oracle 10g里,此等待事件在归于 User I/O wait class 下面的. 处理db file sequential read 事件要牢牢把握下面三个主要思想:1)oracle 进程需要访问的block不能从SGA 中获取,因此oracle 进程

常识之外:全表扫描为何产生大量 db file sequential read 单块读?

原创 2016-07-05 熊军 Oracle   编辑手记:在理解Oracle技术细节时,我们不仅应该读懂概念,还要能够通过测试验证细节,理解那些『功夫在诗外』的部分,例如全表扫描和单块读. 开发人员在进行新系统上线前的数据校验测试时,发现一条手工执行的 SQL 执行了超过1小时还没有返回结果.SQL 很简单: 下面是这条 SQL 的真实的执行计划: 很显然,在这个表上建 billing_nbr 和 start_date 的复合索引,这条 SQL 就能很快执行完(实际上最后也建了索引).但是这

Resolving Issues Where Application Queries are Waiting Too Frequently for 'db file sequential read'

昨天有篇"db file sequential read"的介绍,还有一篇类似的:Resolving Issues Where Application Queries are Waiting Too Frequently for 'db file sequential read' Operations (文档 ID 1475825.1) 诊断"db file sequential read"的步骤: 简述: 低效的SQL会引起不同节点间非常多的块读. 问题确认: 花

High Waits on 'Db File Sequential Read' Due to Table Lookup Following Index Access

最近某些系统AWR的top 5中"Db File Sequential Read"占据的时间百分比非常大,通常这种等待事件是一种正常的.但当前系统性能是有些问题的,并发量大,有些缓慢,因此需要判断这种等待事件是否能够减少.MOS有几篇关于这种等待事件的介绍,这是其中一篇. High Waits on 'Db File Sequential Read' Due to Table Lookup Following Index Access (文档 ID 875472.1) 即使执行计划已经

db file sequential read等待事件

最近某个应用的AWR中总显示"db file sequential read"等待事件位于top 5之首,下面检索下MOS关于这个等待事件的说明. 等待事件: "db file sequential read" Reference Note (文档 ID 34559.1)         这种等待事件是一种IO读请求相关的等待.与"db file scattered read"不同,因为"sequential read"是将数

解决db file sequential read与db file scattered read

1.根据收集的等待事件,分析是那些对象以及对应的sql. 2.确定是那些对象,执行如下: SELECT segment_name, partition_name, p1, p2 FROM dba_extents, wait1 WHERE wait1.p2 BETWEEN block_id AND (block_id + blocks - 1) AND file_id = wait1.p1ORDER BY segment_name 3.确定执行的sql语句,执行如下: SELECT hash_va

消除11.2上的db file parallel read

客户在11.2.0.3环境中进行压力测试,发现出现大量的db file parallel read等待事件.     这个等待是11g以后才出现的,而在11g以前,一般这个等待事件发生在数据文件的恢复过程中.而11g新增了prefetch的特性,也可能导致这个等待事件的产生. 当运行压力测试时,后台的等待事件如下: SQL> select event, count(*) from v$session where username = user group by event order by 2;

db file async I/O submit 等待事件优化

db file async I/O submit 等待事件优化   一.数据发生db file async I/O submit 我们从数据库awr报告中经常会看到很高db file async I/O submit的等待事件: SQL> select event,wait_class,wait_time from v$session_wait where wait_class<>'Idle' EVENT WAIT_CLASS WAIT_TIME --------------------