• 查看buffer cache命中率


    SQL> select name,value from v$sysstat where name in('db block gets','consistent gets','physical reads');

    NAME                                                                  VALUE
    ---------------------------------------------------------------- ----------
    db block gets                                                           932
    consistent gets                                                       50535
    physical reads                                                         9145

    命中率计算公式

    Hit Radio=1-physical reads/(db block gets+consistent gets)

    SQL> select (1-9145/(50535+932)) from dual;

    (1-9145/(50535+932))
    --------------------
              .822313327
    SQL> show parameter db_block_buffers

    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    db_block_buffers                     integer     0

    由于10G中引入了SGA自动管理,所以show parameter 查出来的db_block_buffers为 0

    查看当前buffer cache size

    SQL> select name ,bytes/1024/1024 Mb from v$sgainfo where name ='Buffer Cache Size';

    NAME                                     MB
    -------------------------------- ----------
    Buffer Cache Size                       288    这个buffer cache size 指的是 default + keep +recycle 的和

    SQL> select current_size from v$buffer_pool;

    CURRENT_SIZE
    ------------
             288         这里 我没有配置 keep pool ,也没有配置 recycle pool

    如果一个长期运行的database 长期的 Hit Radio<90%,那么就应该考虑多分配点内存给buffer cache ,同时增加物理内存,或者SQL调优

    理想的hit radio 应该在 95%以上

  • 相关阅读:
    [建树(非二叉树)] 1106. Lowest Price in Supply Chain (25)
    [建树(非二叉树)] 1090. Highest Price in Supply Chain (25)
    [并查集] 1118. Birds in Forest (25)
    [二叉树建树&完全二叉树判断] 1110. Complete Binary Tree (25)
    OAuth2 Backend Web Application 验证过程
    我如何介绍 Microservice
    .NET 的 Debug 和 Release build 对执行速度的影响
    ASP.NET MVC 从零开始
    ASP.NET MVC 从零开始
    Visualize The Workshop
  • 原文地址:https://www.cnblogs.com/hllnj2008/p/4788170.html
Copyright © 2020-2023  润新知