http://www.laoxiong.net/table_scan_and_buffer_cache.html

全表扫描与buffer cache

https://www.cnblogs.com/Richardzhu/archive/2013/01/23/2872587.html

通过文档知道:

1.理论上,最大db_file_multiblock_read_count和系统IO能力应该有如下关系:

Max(db_file_multiblock_read_count) = MaxOsIOsize/db_block_size

当然这个Max(db_file_multiblock_read_count)还要受Oracle的限制。

2.DB_FILE_MULTIBLOCK_READ_COUNT  (数据库方面)

能否提高I/O 通道,由以下渠道的每个extent 大小(DB_FILE_MULTIBLOCK_READ_COUNT 一次不能跨越extent 读),如果是DB_FILE_MULTIBLOCK_READ_COUNT *(block_size)的整数倍,那么就是能有效的减少I/O 读写。

情况1:比如extent 由50个block 组成,DB_FILE_MULTIBLOCK_READ_COUNT =16 ,那么需要读 完整的extent 应该是 3次*16+1次*2 (共4次)共50个blocks。

情况2: 比如extent 由80个block 组成,DB_FILE_MULTIBLOCK_READ_COUNT =16 ,那么需要读 完整的extent 应该是 5次*16 共80个blocks。

如果同样的大小的表(400 blocks),情况1 一共需要 4*8个extent =32 个IO

如果同样的大小的表(400 blocks),情况2一共需要 5*5个extent=25 个IO   (更节约资源)

所以结论如下: 如果 单个exent 的block 数目 是DB_FILE_MULTIBLOCK_READ_COUNT的整数倍,更加提升I/O 性能。

 
DB_FILE_MULTIBLOCK_READ_COUNT

DB_FILE_MULTIBLOCK_READ_COUNT And Extents Management.
-----------------------------------------------------The Parameter 'db_file_multiblock_read_count' specifies the number
of Oracle Blocks to be read in Single I/O Operation.
DB_FILE_MULTIBLOCK_READ_COUNT should generally be made as large
as possible.
The value differs between platforms and versions, and usually
depends on the settings of DB_BLOCK_SIZE and the maximum OS I/O Size.EXTENT SIZING
===============This parameter is normally used for multiblock reads for Full Table
Scans and Fast Full Index Scans and normally can be used with CBO.
The Oracle Extent Management can be tuned with this Parameter to get
optimal benefit for I/O operation. Normally it is recommended that the
entire Segment should be contained in Single Extent so that Full Table
Scan or Fast Full Index Scan just have to traverse a single Extent.
This will contribute to fast Query Operations.But as such, it is
not a must.Even if the Segment is spread over Hundred or Thousands
Of Extents and if the extents are of even size with proper
‘db_file_multiblock_read_count’ defined,  the Full Table Scan
or Fast Full Index Scan still can improve performance.The following Example will illustrate the above-mentioned fact:Suppose a Table X currently occupies eight extents with the
HWM (High Water Mark) in the eight extents.
Each extent is evenly sized with 50blocks
(db_block_size = 8K and Extent size 400k).
The db_file_multiblock_read_count is set to 16.-------------------------------------------------------------------------
|       |       |       |        |         |         |         |         | ------  ------  ------  -------- -------- ---------- -------- <---HWM--->
|       |       |       |        |         |         |         |         |
-------------------------------------------------------------------------E1       E2       E3      E4       E5        E6       E7         E8<-------------------- 50 blocks  per extent ---------------------------->Here E1 - E8 represents Extents each with 50 blocks.
The HWM is in 389 Block. So 10 blocks are above the HWM since the
first block is the Segment header block and total 400 blocks.The Multiblock I/O never spans Extent Boundaries even if the Extents
are contiguous and also if using Locally Managed Tablespaces.
Assuming that none of the above blocks are in the Buffer Cache if we
do Full Table Scan, then total 31 i/o operations will be required.
Since each extent comprises of 50 blocks and 16 blocks read in singleI/O operation.
This means that 48-blocks/per extents will be read in 3 I/O operations
whereas for the last remaining blocks one extra I/O has to be performed,
in all making 4 I/O calls per Extent.This amounts to 28 I/O operations
up to 7th Extent.
The 8th Extent has 10 blocks above the HWM, so there will be only
3 i/o operations in the 8th Extent.
(32 blocks  in 2 i/o’s and remaining 8 blocks in 1 i/o )*** The Extents size should always be a Multiple of db_file_multiblock_read_count ****The Extents size should always be a Multiple of
db_file_multiblock_read_count to take the advantage of Full Table
Scans and Fast Full Index Scans.
IF the extents of the Table X are made multiple of
db_file_multiblock_read_count (80 blocks per extent), then only
5 Extents are required to manage the entire segment instead of
8 extents.
Also since the extents are multiple of db_file_multiblock_read_count,
the I/O operations are reduced from 31 to 25. There will only
be 5 i/o operations per extent resulting in Total 25 I/O calls.
Since each extent comprises of 80 blocks and multiblock_read_count=16,(16 * 5 = 80) each extent will require 5 I/O operations.-------------------------------------------|       |       |       |        |         |      ------- ------- ------- -------- ---------         |       |       |       |        |         |    ------- ------- ------- -------- ---------- |       |       |       |        |<--HWM-->|--------------------------------------------E1      E2        E3     E4        E5<----------- 80 blocks/Extent ------------>Thus the i/o operations are reduced from 31 to 25 just by proper
management of Extents. If the Extents size are a Multiple of
db_file_multiblock_read_count, then i/o operations required will be
less compared to when the Extents are not Multiple of
db_file_multiblock_read_count.Here, reducing the number of Extents have not reduced the I/O Calls
but the multiple factor of Blocks per Extent with respect to
Multiblock Read, have contributed to lessen the I/O calls.Hence, even if the Segment comprises of Multiple Extents and if the
extent size is a multiple of db_file_multiblock_read_count, the FTS
will be faster.
Remember that even if the Table X was composed of Single Extent
of 400 blocks, it would take 25 i/o’s to read up to FTS.

As explained in the Oracle Documentation:

Oracle® Database Reference
12c Release 1 (12.1)
E17615-18     
DB_FILE_MULTIBLOCK_READ_COUNT

http://st-doc.us.oracle.com/12/121/server.121/e17615/refrn10037.htm#REFRN10037

DB_FILE_MULTIBLOCK_READ_COUNT is one of the parameters you can use to minimize I/O during table scans. It specifies the maximum number of blocks read in one I/O operation during a sequential scan. The total number of I/Os needed to perform a full table scan depends on such factors as the size of the table, the multiblock read count, and whether parallel execution is being utilized for the operation.

The default value of this parameter is a value that corresponds to the maximum I/O size that can be performed efficiently. This value is platform-dependent and is 1MB for most platforms.

Because the parameter is expressed in blocks, it will be set to a value that is equal to the maximum I/O size that can be performed efficiently divided by the standard block size. Note that if the number of sessions is extremely large the multiblock read count value is decreased to avoid the buffer cache getting flooded with too many table scan buffers.

Even though the default value may be a large value, the optimizer will not favor large I/Os if you do not set this parameter. It will favor large I/Os only if you explicitly set this parameter to a large value.

Online transaction processing (OLTP) and batch environments typically have values in the range of 4 to 16 for this parameter. DSS and data warehouse environments tend to benefit most from maximizing the value of this parameter. The optimizer is more likely to choose a full table scan over an index if the value of this parameter is high.

The maximum value is the operating system's maximum I/O size expressed as Oracle blocks ((max I/O size)/DB_BLOCK_SIZE). If you set this parameter to a value greater than the maximum, then Oracle uses the maximum.

From Oracle 10gR2, DB_FILE_MULTIBLOCK_READ_COUNT is automatically set depending on:

  • operating system optimal I/O size
  • the size of the buffer cache
  • the maximum number of sessions

The formula for calculating DB_FILE_MULTIBLOCK_READ_COUNT is calculated by hidden parameter _db_file_optimizer_read_count.db_file_optimizer_read_count equals db_file_multiblock_read_count when the latter is explicitly set, but equals 8 when not. Review following note:

Document 1106073.1 What is the difference between '_db_file_optimizer_read_count' and 'db_file_multiblock_read_count'?

As stated above, even if the value calculated by Oracle is large, the optimizer will not favour large full table scans unless DB_FILE_MULTIBLOCK_READ_COUNT is explicitly set to a large value.


TIP: It is recommended to leave the value unset so that Oracle will compute the value.

If set, the behavior is consistent to behavior prior to 10gR2.

DB_FILE_MULTIBLOCK_READ_COUNT can be unset by following the information in the following note:

Document 473740.1 How To Unset DB_FILE_MULTIBLOCK_READ_COUNT to Default Value

Without WORKLOAD stats, CBO computes multiblock reads as:

io_cost = ceil(blocks * 0.5965/_db_file_optimizer_read_count0.6582)

(The NOWORKLOAD case, the following are used in the formula:
MBRC = _db_file_optimizer_read_count (if system stat MBRC is not gathered)
SREADTIM = IOSEEKTIM + db_block_size/IOTFRSPEEDMREADTIM = IOSEEKTIM + MBRC * db_block_size/IOTFRSPEED))

NOTE: In 10g, CPU costing is always used unless explicitly disabled, so this formula is almost never used.  In 9i (or if Optimizer feature enabled is set to 9.x), CPU costing is used only when WORKLOAD stats are gathered.  

With WORKLOAD stats, then:

io_cost = max(1, ceil(blocks/MBRC * MREADTIM/SREADTIM))

(The workload stats come straight from the WORKLOAD system statistics)

转载于:https://www.cnblogs.com/feiyun8616/p/8087025.html

转 db_file_multiblock_read_count相关推荐

  1. 9i DB_FILE_MULTIBLOCK_READ_COUNT参数和extent大小的设置

    Oracle通过两种方式从表中获取数据: ·          通过ROWID(通常使用索引扫描时) ·          通过全表扫描 如果通过ROWID读取数据,表中的区间数就不是读性能的一个因素 ...

  2. Oracle 10R2 研究--db_file_multiblock_read_count对成本的影响

    当研究oracle的查找方式中发现,在全表扫描和索引扫描时,会用到db_file_multiblock_read_count来一次读取多个IO.也看了一些关于db_file_multiblock_re ...

  3. oracle dbfile数,通过案例学调优之--Oracle参数(db_file_multiblock_read_count)

    通过案例学调优之--Oracle参数(db_file_multiblock_read_count) 应用环境: 操作系统: RedHat EL55 Oracle:   Oracle 10gR2 Ora ...

  4. oracle 10g db_file,oracle 10g的db_file_multiblock_read_count参数

    Oracle 10G下的参数db_file_multiblock_read_count参数,是代表oracle的多块读取一次的IO的block数量,数据库创建初期oracle会默认设置相应额db_fi ...

  5. oracle重启一个节点集群,帮忙分析一例数据库两节点集群每隔几个月节点重启

    本帖最后由 鸣雏之叶1 于 2015-4-2 15:13 编辑 数据库版本:10204 操作系统版本:红帽4.7 64位 遇到一台双节点的rac,间隔几个月就会因为心跳原因导致某一个节点重启(随机), ...

  6. oracle参数文件initorcl位置,ORACLE参数文件

    ORACLE参数文件 简介 参数文件记录了数据库的配置.在数据库启动时,Oracle要根据参数文件中的参数配置数据库.如果为各个内存池分配多少内存,允许打开的进程数和会话数等.要让数据库启动,必须先读 ...

  7. oracle直查和call哪个更快,让oracle跑的更快1读书笔记二

    当前位置:我的异常网» 数据库 » <>读书笔记二 <>读书笔记二 www.myexceptions.net  网友分享于:2013-08-23  浏览:9次 <> ...

  8. ORACLE RAC 更改instance name完整步骤

    下面是更改的部分步骤,但是启动问题还是存在,求达人完整. 单实例的数据库修改SID比较简单,只需要修改pfile相关参数,就可以挂载数据库. RAC环境其实一样,只不过除了修改pfile,还需要修改 ...

  9. pfile和spfile的区别

    pfile和spfile的区别   pfile 默认的名称为"init+例程名.ora"文件路径:/app/oracle/product/10.2.0/dbs,这是一个文本文件,可 ...

最新文章

  1. 谷歌chrome浏览器的源码分析(五)
  2. ASP——判断数据库NULL值
  3. 在IFrame中查找IFRAME中的元素的方式
  4. 【玩转树莓派】使用 sinopia 搭建私有 npm 服务器
  5. Crontab中shell每分钟执行一次HDFS文件上传不执行的解决方案
  6. 为什么要监控sql语句,以及如何监控,都有哪几种方式可以监控。
  7. jqGrid与Struts2的结合应用(七) —— 浅谈排序
  8. 看我!挖到了一个3万美元的 Instagram 漏洞
  9. 最简单的视频编码器:基于libvpx(编码YUV为VP8)
  10. 多对多查询总结resultType和resultMap
  11. PHP PDO 封装 成静态类
  12. kubeadm安装k8s测试环境
  13. java 2 实用教程部分课后答案
  14. 自己对war包解压的误区
  15. opencv下载百度网盘链接及安装
  16. java 获取html title_java htmlparser 获取网页title
  17. 饥荒开服(含各种踩雷)
  18. 圣思园——Java SE Lesson 6
  19. JSP四大作用域,九大内置对象
  20. 如何用elasticsearch构架亿级数据采集系统(第1集:elasticsearch概述)

热门文章

  1. CALLBACKS IN C++ USING TEMPLATE FUNCTORS
  2. 一天变成36小时[转]
  3. 自己设计的一个打字平台
  4. 图解如何安装Oracle 10g的
  5. Magento 2.0 Alipay Cross-Border Mobile Payment Extension - Magento 2.0 支付宝跨境支付手机版...
  6. annotation-driven里面的argument-resolvers参数??
  7. Windows 2003 网络负载均衡的详细配置文档
  8. python笔记9-多线程Threading之阻塞(join)和守护线程(setDaemon)
  9. phpmyadmin设置自动登录和取消自动登录
  10. 转: 深入理解Linux修改hostname