direct path read直接路径读

http://blog.itpub.net/12679300/viewspace-1188072/
原创 Oracle 作者:wzq609 时间:2014-06-18 14:24:12  3034  0

前言:传统的数据库读取的方式是先在内存中搜索,如果搜索不到数据,那么就在把数据从磁盘读到内存中,然后PGA再中SGA中获取数据,这样数据就缓存到内存中了,下次再次访问的时候,就可以直接从SGA中获取,不用再进行物理读;

direct path read(直接路径读):直接路径读是违反传统的数据读取方式的,指服务器进程直接读取数据文件到PGA的内存,不经过buffer cache,以下是数据库读取数据的三种方式;

官方说明介绍:When a session is reading buffers from disk directly into the PGA (opposed to the buffer cache in SGA), it waits on this event. If the I/O subsystem does not support asynchronous I/Os, then each wait corresponds to a physical read request.

If the I/O subsystem supports asynchronous I/O, then the process is able to overlap issuing read requests with processing the blocks existing in the PGA. When the process attempts to access a block in the PGA that has not yet been read from disk, it then issues a wait call and updates the statistics for this event. Hence, the number of waits is not necessarily the same as the number of read requests (unlike db file scattered read and db file sequential read).

Check the following V$SESSION_WAIT parameter columns:

?P1: File_id for the read call

?P2: Start block_id for the read call

?P3: Number of blocks in the read call

直接路径读的优势:存在即合理,相信这个算法的产生也肯定是有原因的;

总结优势如下:

1、采用直接路径读取后,总能保证读取的块数是多块读参数设置的大小,提高了读取的效率;

2、大大的降低了对于latch的使用,进而避免了可能导致的latch竞争(cbc latch等);

3、降低了全表扫描对buffer cache的冲击;

4、降低了buffer pin的开销,有可能降低buffer busy waits等相关等待;

当然这种方法也是有副作用的:

1、会发生段一级的检查点(后面详细介绍),因此在查询真正开始执行前,会做这个额外的准备工作。而且可能会造成IO抖动,因为要写脏数据;

2、如果你的表需要频繁的全表扫描读取,还是用传统的读取方式比较好;

3、在MOS中搜索direct path read,会发现它可能会导致多次的延迟块清除;

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

本文作者:JOHN

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

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

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

[转帖]direct path read直接路径读的更多相关文章

  1. oracle 11g禁用和强制direct path read

    一般在混合型环境中,大表在进行全表扫描或者走并行的时候一般会出现direct path read等待事件,如果在OLTP或者纯粹的DSS环境中,出现大量的direct path read直接路径读取, ...

  2. Oracle 数据库禁止全表访问的时候direct path read /////

    一般在OLAP环境中,大表在进行全表扫描的时候一般会出现direct path read等待事件,如果在OLTP环境中,出现大量的direct path read直接路径读取,这样就有问题了.一般在O ...

  3. direct path read/write (直接路径读/写)

    转载:http://www.dbtan.com/2010/04/direct-path-readwrite.html direct path read/write (直接路径读/写): 直接路径读(d ...

  4. direct path read

    在11g中,全表扫描可能使用direct path read方式,绕过buffer cache,这样的全表扫描就是物理读了. 在10g中,都是通过gc buffer来读的,所以不存在direct pa ...

  5. 深入解析direct path read (转)

    文章转自:http://www.itpub.net/thread-1815281-1-1.html 传统读取数据的方式是服务器进程通过读取磁盘,然后把数据加载到共享内存中,这样后面的进程就可以通过共享 ...

  6. Oracle 直接路径读

    在11g中,全表扫描可能使用direct path read方式,绕过buffer cache,这样的全表扫描就是物理读了. 在10g中,都是通过gc buffer来读的,所以不存在direct pa ...

  7. Oracle 11g全表扫描以Direct Path Read方式执行

    在Oracle Database 11g中有一个新特性,全表扫描可以通过直接路径读的方式来执行(Direct Path Read),这是一个合理的变化,如果全表扫描的大量数据读取是偶发性的,则直接路径 ...

  8. 11g直接路径读、相关参数、10949事件介绍

    转载自刘向兵老师:http://www.askmaclean.com/archives/11g-direct-path-read-10949-_small_table_threshold-_seria ...

  9. oracle等待事件-direct path read/write

    转://http://blog.chinaunix.net/uid-23177306-id-2531235.html 一.direct path read1.与直接读取相关联的等待事件.当ORACLE ...

随机推荐

  1. webapi行程开发文档

    1.新建webapi项目 2.项目中controllers 中有一个values的为webapi接口 3.areas中域中有helppage为生成文档可以直接运行localhost/help,就会生成 ...

  2. Maven项目配置Logback输出JSON格式日志

    最近,项目提出需求,日志需要固定输出为JSON格式,以便后端Flink程序解析. 项目背景 项目为简单的Maven项目,日志由Filebeat采集,因此不需要配置输出至Logstash. 下面为pom ...

  3. Linux命令查找文件目录

    座右铭:长风破浪会有时,直挂云帆济沧海. linux一般查看文件或者目录有几种方法. /查看文件类容--------cat/more/less/head/tail   只能查看文本型(txt) (1) ...

  4. 字符串比较==和equals的区别

    <Stack Overflow 上 370万浏览量的一个问题:如何比较 Java 的字符串?> 比较详细的比较了==和equals方法的区别. 那借此机会,我就来梳理一下 Stack Ov ...

  5. 性能测试基础---ant集成2

    ·自定义报告模板:因为默认的ant提供的报告模板,是没有tps和90%line这样的数据.但是在实际工作中,这两个统计数据又是必须的,那么我们可以通过自定义(修改)的方式来进行修改,达到我们的目的. ...

  6. 第07节-开源蓝牙协议BTStack框架代码阅读(上)

    首先来看一下,对于硬件操作,它是如何来进行处理的.在上篇文章中曾说过,在main函数里面它会调用硬件相关的代码,调用操作系统相关的代码.在BTStack中,可以搜索一下main.c,将会发现有很多ma ...

  7. 201871010135 张玉晶 《面向对象程序设计(java)》第二周学习总结

    201871010135 张玉晶 <面向对象程序设计(java)>第二周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ ...

  8. Discuz!开发之模板标签语法学习

    一.加载模板 使用template()函数显示已存在模板: 在Discuz!程序执行中可以通过 include template('模板文件夹/模板名称无后缀');的方式进行解析! template( ...

  9. Linux 换 jdk 版本 环境没有生效

    Linux 换 jdk 版本 环境没有生效 把 jdk 1.7 换成 1.8, 路径设置好了后 用了下面两个都没有生效 . /etc/profile source ~/.bashrc 还是 jdk 1 ...

  10. matlab-线性回归

    1.调用函数regress(Y,X,alpha),plpha是置信度,如果直接用regress(Y,X)则默认置信度为0.05,Y是一个 的列向量,X是一个 的矩阵,其中第一列是全1向量. 2.函数返 ...