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. JAVA集合框架的特点及实现原理简介

    1.集合框架总体架构 集合大致分为Set.List.Queue.Map四种体系,其中List,Set,Queue继承自Collection接口,Map为独立接口 Set的实现类有:HashSet,Li ...

  2. javascript高级程序设计学习历程

    第三章 基本概念 3.1 语法 3.1.1 区分大小写 ECMAScript中的一切(变量,函数,操作符)都区分大小写的 3.1.2 标识符 标识符:变量,函数,属性的名字以及函数的参数. 标识符的命 ...

  3. Excel单元格锁定及解锁

    Excel VBA 宏 学习使用: 一.工作表单元格的锁定: 1.选择需要锁定的单元格. 2.鼠标右键----设置单元格格式. 3.设置  “保护”--锁定 -- 确定. 4.回到表头,[审阅]--- ...

  4. 结对编程(Python实现)

    一.Github地址:https://github.com/nullcjm/mypage 项目搭档:3117004662梁子豪 3117004648陈俊铭 二.PSP表格: PSP2.1 Person ...

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

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

  6. USACO Buying Feed, II

    洛谷 P2616 [USACO10JAN]购买饲料II Buying Feed, II 洛谷传送门 JDOJ 2671: USACO 2010 Jan Silver 2.Buying Feed, II ...

  7. Sublime Text2中的快捷方式及html各种标签(待完善)

    快捷方式 1.xhtml+tab 2.自动补全标签 Alt + .  补全标签 标签 1.<p>段落标签 ,前后换行 <h1.2.3.4.5>标题标签 h1最大,一级标题 2. ...

  8. 自用ftp上传脚本

    #!/bin/sh backupserver=$1 #localdir=ftp_result_tmp username=$3 password=$4 #remodir='./Log/2018-01-2 ...

  9. ACE在Ubuntu下的安装和编译

    之前写了很多linux下的底层网络API的demo,这些demo可用于了解底层的网络通信过程,但是想做出好的服务器用于实际业务还是非常困难的,需要大量的代码实现,移植性也非常差,想要写出高性能架构的服 ...

  10. [题解向] Luogu4092 [HEOI2016/TJOI2016]树

    #\(\mathcal{\color{red}{Description}}\) \(Link\) 给定一棵以\(1\)为根的树,有两种操作: \(C: \ \ x\)给点\(x\)打上花标记. \(Q ...