Hit Ratio = (db block gets + consistent gets - physical reads) / (db block gets + consistent gets)请问:db block gets + consistent gets 包括 physical reads 吗?
网上资料:
1、DB Block Gets(当前请求的块数目)
当前模式块意思就是在操作中正好提取的块数目,而不是在一致性读的情况下而产生的块数。正常的情况下,一个查询提取的块是在查询开始的那个时间点上存在的数据块,当前块是在这个时刻存在的数据块,而不是在这个时间点之前或者之后的数据块数目。
在current mode模式下产生的对block的访问叫db block gets,这些block在SGA中,不需要访问硬盘。
db_block_gets counts logical reads in CURRENT mode in the buffer cache and also includes direct read blocks (sort-on-disk) blocks.
2、Consistent Gets(数据请求总数在回滚段Buffer中的数据一致性读所需要的数据块)
这里的概念是在处理你这个操作的时候需要在一致性读状态上处理多少个块,这些块产生的主要原因是因为由于在你查询的过程中,由于其他会话对数据块进行操作,而对所要查询的块有了修改,但是由于我们的查询是在这些修改之前调用的,所以需要对回滚段中的数据块的前映像进行查询,以保证数据的一致性。这样就产生了一致性读。
在Read consistent mode模式下产生的对block的访问叫consistent gets。 
Session logical read is: The sum of "db block gets" plus "consistent gets".3、Physical Reads(物理读)
就是从磁盘上读取数据块的数量,其产生的主要原因是:
1、 在数据库高速缓存中不存在这些块
2、 全表扫描
3、 磁盘排序它们三者之间的关系大致可概括为:
逻辑读指的是Oracle从内存读到的数据块数量。一般来说是'consistent gets' + 'db block gets'。当在内存中找不到所需的数据块的话就需要从磁盘中获取,于是就产生了'phsical reads'。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/rabbitbug/archive/2009/12/16/5015419.aspx

解决方案 »

  1.   

    oracle首先查找data buffer cache查找数据,如果查找不到就去物理读,物理读的时候要检查一致性,如果不一致就去回滚段找数据,如果找不到就会报snapshot too old,找到就能得到正确结果.
    DB Block Gets对应data buffer cache的读和物理读,Consistent Gets对应对回滚段数据的读取
      

  2.   

    还是不太明白,网上都是这么解释的1、DB Block Gets(当前请求的块数目)
    当前模式块意思就是在操作中正好提取的块数目,而不是在一致性读的情况下而产生的块数。正常的情况下,一个查询提取的块是在查询开始的那个时间点上存在的数据块,当前块是在这个时刻存在的数据块,而不是在这个时间点之前或者之后的数据块数目。
    在current mode模式下产生的对block的访问叫db block gets,这些block在SGA中,不需要访问硬盘。
    db_block_gets counts logical reads in CURRENT mode in the buffer cache and also includes direct read blocks (sort-on-disk) blocks.
      

  3.   

    Table 7-1 Statistics for Calculating the Hit RatioStatistic                    Description   
    consistent gets from cache   Number of times a consistent read was requested for a block from the buffer cache.
     
    db block gets from cache     Number of times a CURRENT block was requested from the buffer cache.
     
    physical reads cache         Total number of data blocks read from disk into buffer cache.
     
      

  4.   

    看这个应该比较清楚了,物理读是把数据读取到data buffer cache,进行统计的时候还是从daba buffer cache读取,所以 db block gets from cache包含了物理读physical reads cache