zoukankan      html  css  js  c++  java
  • [bbk2193] 第34集 Chapter 09Optimizing Sore Perations(03)

    PGA Target Advice Statistics

    • V$PGA_TARGET_ADVICE predicts how cache hit percentages shown in V$PGASTAT evolve.
    • STATISTICS_LEVEL must be set to at least TYPICAL.(提示:如果想使V$PGA_TARGET_ADVICE工作,必须将STATISTIC_LEVEL修改成至少TYPICAL级别)

    SQL> select * from v$PGA_TARGET_ADVICE;
    
    PGA_TARGET_FOR_ESTIMATE PGA_TARGET_FACTOR ADV BYTES_PROCESSED  ESTD_TIME ESTD_EXTRA_BYTES_RW ESTD_PGA_CACHE_HIT_PERCENTAGE ESTD_OVERALLOC_COUNT
    ----------------------- ----------------- --- --------------- ---------- ------------------- ----------------------------- --------------------
                  163577856              .125 ON       6551463936   25831789            72195072                            99                    6
                  327155712               .25 ON       6551463936   25550234                   0                           100                    0
                  654311424                .5 ON       6551463936   25550234                   0                           100                    0
                  981467136               .75 ON       6551463936   25550234                   0                           100                    0
                 1308622848                 1 ON       6551463936   25550234                   0                           100                    0
                 1570347008               1.2 ON       6551463936   25550234                   0                           100                    0
                 1832071168               1.4 ON       6551463936   25550234                   0                           100                    0
                 2093796352               1.6 ON       6551463936   25550234                   0                           100                    0
                 2355520512               1.8 ON       6551463936   25550234                   0                           100                    0
                 2617245696                 2 ON       6551463936   25550234                   0                           100                    0
                 3925868544                 3 ON       6551463936   25550234                   0                           100                    0
    
    PGA_TARGET_FOR_ESTIMATE PGA_TARGET_FACTOR ADV BYTES_PROCESSED  ESTD_TIME ESTD_EXTRA_BYTES_RW ESTD_PGA_CACHE_HIT_PERCENTAGE ESTD_OVERALLOC_COUNT
    ----------------------- ----------------- --- --------------- ---------- ------------------- ----------------------------- --------------------
                 5234491392                 4 ON       6551463936   25550234                   0                           100                    0
                 7851737088                 6 ON       6551463936   25550234                   0                           100                    0
                 1.0469E+10                 8 ON       6551463936   25550234                   0                           100                    0
    
    14 rows selected.

     将上述SQL语句,进行优化一下,如下:

    SELECT ROUND(pga_target_for_estimate/1024/1024) AS target_mb,
            estd_pga_cache_hit_percentage AS cach_hit_percent,
            estd_overalloc_count
    FROM v$pga_target_advice
    ORDER BY target_mb;
    
     TARGET_MB CACH_HIT_PERCENT ESTD_OVERALLOC_COUNT
    ---------- ---------------- --------------------
           156               99                    6
           312              100                    0
           624              100                    0
           936              100                    0
          1248              100                    0
          1498              100                    0
          1747              100                    0
          1997              100                    0
          2246              100                    0
          2496              100                    0
          3744              100                    0
    
     TARGET_MB CACH_HIT_PERCENT ESTD_OVERALLOC_COUNT
    ---------- ---------------- --------------------
          4992              100                    0
          7488              100                    0
          9984              100                    0
    
    14 rows selected.

     解读优化后的SQL语句:以第一条记录为例:假如将PGA_AGGRGATE_TARGET参数值设置为156MB的话,缓存命中率为99%,溢出6块.以下记录依次类推.

    Understanding the view

    Limitation of Base Statistics

    How to Tune

    v$sysstat and v$sesstat

    SQL> SELECT name profile,cnt,decode(total,0,0,round(cnt*100/total)) percentage
      2  FROM (SELECT name,value cnt,(sum(value) over()) total
      3        FROM V$SYSSTAT
      4        WHERE name like 'workarea exec%'
      5       );
    
    PROFILE                                                                 CNT PERCENTAGE
    ---------------------------------------------------------------- ---------- ----------
    workarea executions - optimal                                        180593        100
    workarea executions - onepass                                             4          0
    workarea executions - multipass                                           0          0
  • 相关阅读:
    [DFNews] Nuix公司推出培训及认证体系
    [CFNews] Oxygen官方对于新版XRY与之冲突问题的官方解释
    [DFNews] FBI Documents Shine Light on Clandestine Cellphone Tracking Tool
    [CFNews] Be first to get Oxygen Forensic Suite 5.0 just before the End of the World!
    [DFNews] CelleBrite发布2013年移动设备取证趋势与预测白皮书
    [转载] Retrieving Data from an iPhone Voicemail Database
    [转载] 我们从未改变:弱密码仍是最常用的密码
    [DFNews] US students get cracking on Chinese malware code
    [转载] 25GPU cluster cracks every standard Windows password in <6 hours
    [手机取证] Forwarding SMS to Email on [Jailbroken] iOS
  • 原文地址:https://www.cnblogs.com/arcer/p/3063309.html
Copyright © 2011-2022 走看看