zoukankan      html  css  js  c++  java
  • Oracle等待事件之db file scattered read

    1、产生原因

    该等待事件通常发生在数据库多块读时,表示发生了与全表扫描快速索引扫描相关的等待。通常意味着全表扫描过多,或者I/O 能力不足,或者I/O 竞争。

    2、确定产生问题对象方法

    a)查找全表扫描的SQL 语句可以使用以下语句:

    select sql_text

    from v$sqltext t, v$sql_plan p

    where t.hash_value = p.hash_value

    and p.operation = 'TABLE ACCESS'

    and p.options = 'FULL'

    order by p.hash_value, t.piece;

    b)查找Fast Full Index 扫描的SQL 语句可以使用以下语句:

    select sql_text

    from v$sqltext t, v$sql_plan p

    where t.hash_value = p.hash_value

    and p.operation = 'INDEX'

    and p.options = 'FULL SCAN'

    order by p.hash_value, t.piece;

    3、解决办法

    (1)在合适的字段上建立索引把表的访问方式从全表扫描变为索引扫描可以有效地降低物理IO。

    (2)对于大表,在合适的字段,比如年月、地区编码上建立分区把全表扫描变成分区扫描以减少物理IO。

    (3)把需要经常扫描的数据库表放在KEEP 池同样会有效地降低物理IO。

    (4)调整db_file_multiblock_read_count值,以达到每次读取更多数据块的目的。

  • 相关阅读:
    [CF1342D] Multiple Testcases
    [CF448D] Multiplication Table
    [CF459C] Pashmak and Buses
    [CF766E] Mahmoud and a xor trip
    [CF35E] Parade
    [CF15C] Industrial Nim
    [CF9D] How many trees?
    [CF19B] Checkout Assistant
    [CF22D] Segments
    [CF21D] Traveling Graph
  • 原文地址:https://www.cnblogs.com/wcwen1990/p/6660397.html
Copyright © 2011-2022 走看看