Differents values for Buffer Hit Ratio

Hi Everyone!
I have only a buffer_pool(8k) and when I execute this two querys(below). The "Buffer Hit Ratio" results are very different.
Anyone know why does this happen?? I searched on the Internet and find out just V$SYSSTAT gather dates of all buffer pools
while V$BUFFER_POOL_STATISTICS maintains statistics for each buffer pool. But i can't understand why it is so different.
Any suggestion?
Thanks!
SELECT 1- ((p.value - l.value - d.value) / s.value) "Buffer Cache Hit Ratio"
FROM v$sysstat s, v$sysstat l, v$sysstat d, v$sysstat p
WHERE s.name = 'session logical reads'
AND d.name = 'physical reads direct'
AND l.name = 'physical reads direct (lob)'
AND p.name = 'physical reads';
Buffer Cache Hit Ratio
,970655577
SELECT NAME, PHYSICAL_READS, DB_BLOCK_GETS, CONSISTENT_GETS,
1 - (PHYSICAL_READS / (DB_BLOCK_GETS + CONSISTENT_GETS)) "Hit Ratio"
FROM V$BUFFER_POOL_STATISTICS;
Hit Ratio
,584760575
ORACLE VERSION: Oracle Server 9.2.0.8.0
OS: IBM/AIX

See metalink note STATISTIC "cache hit ratio" - Reference Note 33883.1 for the correct formula to use in your calculation.
The ratio is of limited value. In and of itself it tells you nothing about the performance of your database.
There have been numerous threads on the ratio in this forum. You can use search to find them if interested.
HTH -- Mark D Powell --

Similar Messages

  • STATSPACK REPORT (BUFFER HIT RATIO)

    my statspack report shows that my buffer ration is 83%...what factors i need to look to imporve the buffer hit ratio. Thanks

    I deleted because i realized that i took the statspack report of 1 day period.
    Below is the Statspack report of 1 hour. Can you please let me know if i still need to increase database buffer cache?
    STATSPACK report for
    Database DB Id Instance Inst Num Startup Time Release RAC
    ~~~~~~~~ ----------- ------------ -------- --------------- ----------- ---
    4254163 TEST1 1 28-Jun-07 23:30 10.2.0.3.0 NO
    Host Name: Linux3 Num CPUs: 2 Phys Memory (MB): 7,968
    ~~~~
    Snapshot Snap Id Snap Time Sessions Curs/Sess Comment
    ~~~~~~~~ ---------- ------------------ -------- --------- -------------------
    Begin Snap: 32 03-Jul-07 11:59:13 23 11.0
    End Snap: 42 03-Jul-07 14:07:33 26 11.3
    Elapsed: 128.33 (mins)
    Cache Sizes Begin End
    ~~~~~~~~~~~ ---------- ----------
    Buffer Cache: 100M Std Block Size: 8K
    Shared Pool Size: 100M Log Buffer: 33,823K
    Load Profile Per Second Per Transaction
    ~~~~~~~~~~~~ --------------- ---------------
    Redo size: 1,259.57 8,598.13
    Logical reads: 148.39 1,012.92
    Block changes: 6.41 43.76
    Physical reads: 41.91 286.09
    Physical writes: 0.73 5.02
    User calls: 15.66 106.91
    Parses: 4.07 27.77
    Hard parses: 0.27 1.85
    Sorts: 1.70 11.61
    Logons: 0.01 0.07
    Executes: 9.59 65.47
    Transactions: 0.15
    % Blocks changed per Read: 4.32 Recursive Call %: 83.09
    Rollback per transaction %: 6.03 Rows per Sort: 11.39
    Instance Efficiency Percentages
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Buffer Nowait %: 100.00 Redo NoWait %: 100.00
    Buffer Hit %: 71.77 In-memory Sort %: 100.00
    Library Hit %: 93.15 Soft Parse %: 93.34
    Execute to Parse %: 57.58 Latch Hit %: 100.00
    Parse CPU to Parse Elapsd %: 97.12 % Non-Parse CPU: 86.74
    Shared Pool Statistics Begin End
    Memory Usage %: 91.37 92.38
    % SQL with executions>1: 77.55 80.43
    % Memory for SQL w/exec>1: 83.11 84.69
    Top 5 Timed Events Avg %Total
    ~~~~~~~~~~~~~~~~~~ wait Call
    Event Waits Time (s) (ms) Time
    CPU time 132 48.3
    db file sequential read 89,745 91 1 33.4
    db file scattered read 29,289 35 1 13.0
    control file parallel write 2,558 6 2 2.1
    log file parallel write 2,294 3 1 1.0
    Host CPU (CPUs: 2)
    ~~~~~~~~ Load Average
    Begin End User System Idle WIO WCPU
    0.11 0.11 2.26 2.65 95.09 0.90 0.24
    Instance CPU
    ~~~~~~~~~~~~
    % of total CPU for Instance: 1.06
    % of busy CPU for Instance: 21.63
    %DB time waiting for CPU - Resource Mgr:
    Memory Statistics Begin End
    ~~~~~~~~~~~~~~~~~ ------------ ------------
    Host Mem (MB): 7,967.6 7,967.6
    SGA use (MB): 316.0 316.0
    PGA use (MB): 57.8 62.6
    % Host Mem used for SGA+PGA: 4.7 4.8
    Time Model System Stats DB/Inst: TEST1/TEST1 Snaps: 32-42
    -> Ordered by % of DB time desc, Statistic name
    Statistic Time (s) % of DB time
    sql execute elapsed time 212.3 92.7
    DB CPU 124.2 54.2
    parse time elapsed 21.6 9.4
    hard parse elapsed time 19.7 8.6
    PL/SQL execution elapsed time 4.3 1.9
    hard parse (sharing criteria) elaps 1.4 .6
    connection management call elapsed 1.4 .6
    PL/SQL compilation elapsed time 1.2 .5
    repeated bind elapsed time 0.1 .0
    hard parse (bind mismatch) elapsed 0.1 .0
    sequence load elapsed time 0.0 .0
    DB time 228.9
    background elapsed time 48.2
    background cpu time 39.3
    Wait Events DB/Inst: TEST1/TEST1 Snaps: 32-42
    -> s - second, cs - centisecond, ms - millisecond, us - microsecond
    -> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
    -> Only events with Total Wait Time (s) >= .001 are shown
    -> ordered by Total Wait Time desc, Waits desc (idle events last)
    Avg
    %Time Total Wait wait Waits
    Event Waits -outs Time (s) (ms) /txn
    db file sequential read 89,745 0 91 1 79.6
    db file scattered read 29,289 0 35 1 26.0
    control file parallel write 2,558 0 6 2 2.3
    log file parallel write 2,294 0 3 1 2.0
    db file parallel write 2,179 0 3 1 1.9
    log file sync 1,089 0 2 2 1.0
    os thread startup 7 0 1 120 0.0
    latch free 3 0 0 89 0.0
    SQL*Net break/reset to client 640 0 0 0 0.6
    direct path read 140 0 0 1 0.1
    control file sequential read 3,599 0 0 0 3.2
    SQL*Net more data to client 2,121 0 0 0 1.9
    db file parallel read 49 0 0 1 0.0
    cursor: pin S wait on X 2 100 0 16 0.0
    read by other session 4 0 0 5 0.0
    direct path write 24 0 0 0 0.0
    latch: shared pool 1 0 0 2 0.0
    SQL*Net message from client 120,211 0 47,282 393 106.6
    wait for unread message on broadc 7,631 100 7,517 985 6.8
    Streams AQ: waiting for messages 1,540 100 7,512 4878 1.4
    Streams AQ: qmn slave idle wait 275 0 7,508 27302 0.2
    Streams AQ: qmn coordinator idle 554 51 7,508 13553 0.5
    Streams AQ: waiting for time mana 25 52 6,643 ###### 0.0
    SQL*Net message to client 120,215 0 0 0 106.6
    class slave wait 7 0 0 1 0.0
    SQL*Net more data from client 146 0 0 0 0.1
    Background Wait Events DB/Inst: TEST1/TEST1 Snaps: 32-42
    -> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
    -> Only events with Total Wait Time (s) >= .001 are shown
    -> ordered by Total Wait Time desc, Waits desc (idle events last)
    Avg
    %Time Total Wait wait Waits
    Event Waits -outs Time (s) (ms) /txn
    control file parallel write 2,557 0 6 2 2.3
    log file parallel write 2,290 0 3 1 2.0
    db file parallel write 2,179 0 3 1 1.9
    os thread startup 7 0 1 120 0.0
    db file sequential read 1,456 0 1 0 1.3
    db file scattered read 25 0 0 8 0.0
    control file sequential read 156 0 0 0 0.1
    latch: shared pool 1 0 0 2 0.0
    rdbms ipc message 25,017 92 59,496 2378 22.2
    pmon timer 2,576 100 7,513 2917 2.3
    Streams AQ: qmn slave idle wait 275 0 7,508 27302 0.2
    Streams AQ: qmn coordinator idle 554 51 7,508 13553 0.5
    smon timer 26 96 7,148 ###### 0.0
    Streams AQ: waiting for time mana 25 52 6,643 ###### 0.0
    Wait Event Histogram DB/Inst: TEST1/TEST1 Snaps: 32-42
    -> Total Waits - units: K is 1000, M is 1000000, G is 1000000000
    -> % of Waits - column heading: <=1s is truly <1024ms, >1s is truly >=1024ms
    -> % of Waits - value: .0 indicates value was <.05%, null is truly 0
    -> Ordered by Event (idle events last)
    Total ----------------- % of Waits ------------------
    Event Waits <1ms <2ms <4ms <8ms <16ms <32ms <=1s >1s
    LGWR wait for redo copy 7 100.0
    SQL*Net break/reset to cli 640 99.2 .6 .2
    SQL*Net more data to clien 2121 100.0
    control file parallel writ 2558 84.2 12.0 .7 1.4 1.5 .2
    control file sequential re 3599 99.9 .1
    cursor: pin S wait on X 2 100.0
    db file parallel read 49 93.9 2.0 4.1
    db file parallel write 2179 68.2 19.9 6.8 4.0 .9 .1 .1
    db file scattered read 29K 90.7 6.0 .5 .5 .6 .8 .9
    db file sequential read 89K 89.4 2.8 1.3 3.6 1.5 .7 .6
    direct path read 140 87.1 2.9 .7 1.4 7.1 .7
    direct path write 24 100.0
    latch free 3 100.0
    latch: messages 1 100.0
    latch: shared pool 1 100.0
    log file parallel write 2294 77.4 17.3 2.0 1.3 1.1 .8 .2
    log file sync 1089 62.4 28.8 3.3 1.7 2.5 1.1 .2
    os thread startup 7 100.0
    read by other session 4 50.0 25.0 25.0
    SQL*Net message from clien 120K 95.2 1.6 .9 .3 .1 .2 .1 1.7
    SQL*Net message to client 120K 100.0
    SQL*Net more data from cli 146 100.0
    Streams AQ: qmn coordinato 554 49.1 .2 .2 50.5
    Streams AQ: qmn slave idle 275 100.0
    Streams AQ: waiting for me 1540 .2 99.8
    Streams AQ: waiting for ti 25 36.0 16.0 48.0
    class slave wait 7 85.7 14.3
    pmon timer 2577 .5 .1 .1 99.3
    rdbms ipc message 25K 2.3 1.3 1.4 .4 .4 .3 32.1 61.8
    smon timer 26 100.0
    wait for unread message on 7631 .0 .0 100.0 .0

  • Which is a better measure of buffer hit ratio?

    which out of these gives a better measure of buffer hit ratio?
    consistent gets from cache
    db block gets from cache
    physical reads cache
    or
    consistent gets
    db block gets
    physical reads
    from v@sysstat?

    Hi,
    Well you can always edit your reply.There is a button out there to do that.
    About the question,I am not clear with the question.What do you mean by "better measure of hit ratio"?
    From the PT guide,
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/memory.htm#i56283
    The formula includes all three of them in the calculation,
    SELECT NAME, VALUE
      FROM V$SYSSTAT
    WHERE NAME IN ('db block gets from cache', 'consistent gets from cache', 'physical reads cache');
    Using the values in the output of the query, calculate the hit ratio for the buffer cache with the following formula:
    1 - (('physical reads cache') / ('consistent gets from cache' + 'db block gets from cache')All three of them are part of the hit ratio.When you wrote the three statistics second time,I am not sure how they were different from the first one.All you did was that you removed "cache" word.
    There is no "better measure" statistics in the calculation.All three are there.
    If your question had some other meaning than I would appreciate if you rephrase and elaborate it please.
    Aman....

  • Oracle Buffer Hit Ratio

    I m using this query to find Oracle Buffer Hit ratio .Is this query right.Is there some other way of getting more accurate ratio
    select trunc((1-(sum(decode(name,'physical reads',value,0))/(sum(decode(name,'db block gets',value,0)) + (sum(decode(name,'consistent gets',value,0)))))) * 100) from v$sysstat

    Asif,
    Too bad we couldn't meet when I happened to come to Bdesh coz if we could , we would had talked about the same topic for hours. If you are using this hit ratio as the tuning technique than you are not alone. There are so many dbas who are using hit ratio and loose sleep seeing not to a particular %. It was a method that was given years ago by Oracle reason being that at that time, databases , their loads, they were not too much. But now things have changed so should be the troubleshooting techniques. Search over this forum for the same topic and you would see some "cool" threads where some top-notch experts are talking about the same issue.
    Aman....

  • Buffer hit ratio

    I am using the following:
    SELECT ROUND(((1-(SUM(DECODE(NAME, 'physical reads', value, 0)) /
    (SUM(DECODE(NAME, 'db block gets', value, 0))+
    (SUM(DECODE(NAME, 'CONSISTENT GETS', value, 0))))))*100), 2) || '%' BCHR
    FROM V$SYSSTAT
    to calculate the buffer hit ratio. This query is returning: -1753.28%
    Can someone explain why I am getting this crazy number?
    Thanks,
    mdp

    >>
    Many folks misunderstand that bit about "setting your own BHR", and falsely conclude that it's a useless metric. It's not useless.
    <<
    The buffer cache ratio is useful only when considered in relation to other statistics. The problem is that the majority of users seem to think that that a high ratio value is good and a low ratio value is bad based on absolute values and do not understand that the static is dependent on how SQL plans are being solved. If you measure the ratio when the dominant work on the system is being done via hash joins, full scans that touch the target blocks only once, or make use of PQO during the process you can get a fairly low value, but the system is performing well. On the other had poorly performing SQL can result in a high value for the statistic. The value of the statistics bears no direct relationship to performance of the system and it needs to be emphasized that the ratio must be used in conjunction with other available information. The ratio by itself should be considered useless.
    >>
    If the BHR was totally useless, why does Oracle continue to include it in OEM alert thresholds, and STATSPACK and AWR reports?
    <<
    Over the years Oracle has done lots of things that turned out to be wrong so just because Oracle includes the statistics in certain products does not really provide a lot of support for the validity of the statistic. Known errors in the documentation have made it through two full releases. Again it is the misapplication of the statistic that is really at issue. Unfortunately, many poorly written DBA Administration and Tuning books in the past claimed that ratio could be used to measure database performance, and in point of fact the ratio has only a passing relationship to performance depending on the application.
    HTH -- Mark D Powell --

  • Buffer hit ratio (to be negative)

    Hi All,
    My DB Version: 10.2.0
    OS: Windows Server 2003
    When i am checking snapshots at peak time and comparing it with one when there is no load on the server the buffer hit ratio (to be negative), the buffer cache is too small and the data in is being aged out before it can be used so it must be retrieved again.
    So i just want to know that whether should i increase the value of db_cache_size.
    What exactly happens when i do this.

    Hi;
    DB_CACHE_SIZE specifies the size of the DEFAULT buffer pool for buffers with the primary block size (the block size defined by the DB_BLOCK_SIZE initialization parameter).
    The value must be at least 4M * number of cpus * granule size (smaller values are automatically rounded up to this value). A user-specified value larger than this is rounded up to the nearest granule size. A value of zero is illegal because it is needed for the DEFAULT memory pool of the primary block size, which is the block size for the SYSTEM tablespace.
    Source:
    http://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams043.htm
    Regard
    Helios

  • Buffer Hit Ratio % -- Whats the right query ?

    Whats the right query to track Buffer Hit % ;
    Using this :
    prompt BUFFER HIT RATIO %
    prompt ===============
    select 100 * ((a.value+b.value)-c.value) / (a.value+b.value) "Buffer Hit Ratio"
    from v$sysstat a, v$sysstat b, v$sysstat c
    where
    a.statistic# = 38
    and
    b.statistic# = 39
    and
    c.statistic# = 40;
    Buffer Hit Ratio
    99.9678438
    However, using this :
    Select
    Round((Sum(Decode(name, 'consistent gets',value,0)) +
    Sum(Decode(name, 'db block gets',value,0)) -
    Sum(Decode(name, 'physical reads',value,0))) /
    (Sum(Decode(name, 'consistent gets',value,0)) +
    Sum(Decode(name, 'db block gets',value,0)) ) * 100, 4)
    from V$sysstat;
    Comes up as : 67.7069 %
    So which is the right one ?
    Thanks.

    user4874781 wrote:
    Well, I recently joined this organisation and that was the script that was used since long to check Buffer Hit Ratio%.
    But when I ran a TOAD report, using the other query, the value came up different.
    So am confused .. Whats the difference and which is the right one ?
    Try running the following query:
    select
            statistic#, name
    from
            v$sysstat
    where
            statistic# in (38,39,40)
    or      name in (
                    'consistent gets',
                    'physical reads',
                    'db block gets'
    ;The you will understand the point the previous answer was making. It's a bad idea to rely on things like the statistic# being consistent across different versions of Oracle - names tend to be safer.
    But neither query is correct. If you want any sort of vaguely meaningful "buffer cache hit ratio", you should be quering v$buffer_pool_statistics. See also: Re: Testing of buffer cache reveals these results: and http://jonathanlewis.wordpress.com/2007/09/02/hit-ratios/
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge." Stephen Hawking.

  • How should i increase over all buffer hit ratio.....

    Hi all,
    As shown below if my DB2 databse buffer Qulaity is low .. How should i increase over all buffer hit ratio..
    Please advice on any sap standrd notes or procedures
    Number                                    1
    Total Size                           80,000  KB
    Physical Reads                         6.65  ms
    Physical Writes                        0.00  ms
    Overall Buffer Quality                86.05  %
    Data Hit Ratio                        85.79  %
    Index Hit Ratio                       87.50  %
    No Victim Buffers                259,079,295
    --rahul

    One of the options is to simply increase the bufferpool size using the following command
    db2 alter bufferpool immediate <bufferpool name> size <new bufferpool size>
    However, this will affect the hit ration for a particular bufferpool. If you have more than one bufferpool, you need to identify the bufferpool(s) with worst hit ratio. In the SAP DBA Cockpit, check using
    Performance -> Bufferpool
    The victim buffer information is only useful in case you use alternate page cleaning.
    Note that there are other options to fight bad bufferpool hit ratio - however, with your small bufferpool size (80MB) maybe increasing the size is the appropriate step.
    Malte

  • Low buffer hit ratio

    Hi all,
    could anyone please let me know how I can improve upon the buffer hit ratio in Oracle 8.0
    I have increased my buffer size by 40% in the init.ora parameters but there has been no gain at all in the buffer hit ratio after the system has been bounced and up by 42 hrs so could any let me know..
    Thanks
    Akkama

    Why don't u try pinning the objects accessed frequently - even pinning tables are possible.

  • One reason why buffer hit ratio just might be bogus

    Hi.
    Still trawling through statspack trying to make some sense of it ...
    But looking at this, (on undo segments) I have perhaps another reason to sneer at the old buffer cache hit ratio: (in the sense of using it to tune, or of using it to justify action / lack of action).
    "The header is also a data block that is frequently modified , so it generally remains in the buffer cache. Therefore, gets of the rollback segment header block increase the buffer cache hit ratio; this artificial increase in the hit ratio can mislead you into thinking that you have allocated enough data blocks to the buffer cache"
    :taken from the OP Exam 033 text, p.295

    Hi Dan,
    The problem is about the usefulness of ratio's in-general, it's not specifically about the BCHR. . . .
    This whole thing arose from the Oracle7 performance tuning classes where Oracle Corporation suggested that the BCHR be kept over 90%. . . .
    Is the BCHR "bogus"? It is what it is, a ratio. . . .
    I agree wit Ben, it does have limited use as an "indicator", that the buffer cache MIGHT be too small to cache the working set of frequently-referenced data blocks. I have my notes here:
    http://www.dba-oracle.com/t_buffer_cache_hit_ratio_value.htm
    Oh, and as to the buffer cache advisory, it's not perfect (as is any predictive model) and I rarely see one that does not suggest that adding RAM will reduce physical I/O.
    Anyway, in just a few years all this will be a moot issue, espeially since solid-state disk has hit $100 per gig. Without spinning platters, there is no need for a large buffer cache at all . . . .
    Hope this helps. . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference":
    http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm

  • No swaps anyware still hit Ratio around 4% for Initial Record Buffer

    Dear Gurus
    I am using ABAP NW7.0 System.
    in the system all buffers  have hit ratio  99+%
    but the initial record buffer hit ratio it below 10%
    any way there is no swaps at all still hit Ratio is 4%
    The current parameters are:
    rsdb/ntab/irbdsize   --->6000
    rsdb/ntab/entrycount---> 20000
    HITRATIO  -
    >        %         4
    HITS         -
    >              64
    REQUESTS    -
    >             1.729
    DB access quality %   -
    >       4
    DB access      -
    >          1.656
    DB access saved    -
    >         64
    Reorgs        -
    >               0
    Allocated     -
    >    KB     6.625
    Available     -
    >    KB     6.000
    Used         -
    >     KB     1.099*
    Free         -
    >     KB     4.901
    Available     -
    >           5.000
    Used         -
    >            1.656
    Free           -
    >         * 3.344*
    Objects swapped    -
    >          0
    Frames swapped    -
    >           0
    Total          -
    >              0
    Pl suggest me how can i have the hitratio more.
    Thanks in advance

    Hello,
    Unfortunately we can not tell exactly why the value is low,
    however it is not necessarily an incorrect value.
    The quality of a buffer and how often it is accessed is measured by the
    '%Hit Ratio'. This value will indicate if the information stored in the
    buffers, such as table entries, programs and screens, is being hit
    directly from the buffer itself or, on the other hand, if the system
    needs to bring that data from the database since it was not found in the
    buffer.
    To find out the buffers with poor quality, first check the system
    startup time. When the system is started, all buffers (except the
    program buffer which has a pre-load) are initially empty. Therefore,
    all objects that are accessed for the first time have to be read from
    the database and then loaded into the buffers.
    If objects are not yet in the buffer, the hit ratio for the buffer will
    be low. The hit ratio increases from the time objects are loaded into
    the buffers. The rate of the increase depends on the workload in the
    system and is different for each buffer.So it is to be noted that how often you restart the system which resuls in the loading of object again and causes hit rate to be low.
    Poor buffer quality is not always due to a real problem. For example,
    transports into a system can reduce buffer quality. Keep in mind though
    that a value lower does not always shows that you have a problem.
    A more pressing concern would be if we saw swaps on the system. As you
    can see, there are no swaps.
    Swapping occurs when the buffer is full, and the SAP System has to
    load additional objects into the buffer. Objects in the buffer that
    were used the least recently are removed. In this context, the term
    "swap" means the objects removed from the buffer are lost and cannot
    be replaced until a new database access is performed (replacing what
    was lost).
    There are two possible reasons for swapping
    1 There is no space left in the buffer data area
      The buffer is too small. You should increase the buffer size.
    2 There are no directory entries left.
    Therefore, to conclude, although the hitratio appears low it does
    not mean that there are any performance issues. The fact that there is
    sufficient free space and there are no swaps confirm this.
    You can try to increase size of intial record buffer(in steps) as from current setting it seems to be small.
    I hope this helps.
    Regards,
    Archana

  • Buffer Cache hit Ratio

    Hi All,
    My DB Version: 10.2.0
    OS: Windows Server 2003
    I run the following script to get Hit ratio's
    SELECT cur.inst_id, 'Buffer Cache Hit Ratio ' "Ratio", to_char(ROUND((1-(phy.value / (cur.value + con.value)))*100,2)) "Value"
    FROM gv$sysstat cur, gv$sysstat con, gv$sysstat phy
    WHERE cur.name = 'db block gets'
    AND con.name = 'consistent gets'
    AND phy.name = 'physical reads'
    and phy.inst_id=1
    and cur.inst_id=1
    and con.inst_id=1
    union all
    SELECT cur.inst_id,'Buffer Cache Hit Ratio ' "Ratio", to_char(ROUND((1-(phy.value / (cur.value + con.value)))*100,2)) "Buffer Cache Hit Ratio"
    FROM gv$sysstat cur, gv$sysstat con, gv$sysstat phy
    WHERE cur.name = 'db block gets'
    AND con.name = 'consistent gets'
    AND phy.name = 'physical reads'
    and phy.inst_id=2
    and cur.inst_id=2
    and con.inst_id=2
    union
    SELECT inst_id, 'Library Cache Hit Ratio ' "Ratio", to_char(Round(sum(pins) / (sum(pins)+sum(reloads)) * 100,2)) "Library Cache Hit Ratio"
    FROM gv$librarycache group by inst_id
    union
    SELECT inst_id,'Dictionary Cache Hit Ratio ' "Ratio", to_char(ROUND ((1 - (SUM (getmisses) / SUM (gets))) * 100, 2)) "Percentage"
    FROM gv$rowcache group by inst_id
    union
    Select inst_id, 'Get Hit Ratio ' "Ratio",to_char(round((sum(GETHITRATIO))*100,2)) "Get Hit"--, round((sum(PINHITRATIO))*100,2)"Pin Hit"
    FROM GV$librarycache
    where namespace in ('SQL AREA')
    group by inst_id
    union
    Select inst_id, 'Pin Hit Ratio ' "Ratio", to_char(round((sum(PINHITRATIO))*100,2))"Pin Hit"
    FROM GV$librarycache
    where namespace in ('SQL AREA')
    group by inst_id
    union
    select a.inst_id,'Soft-Parse Ratio ' "Ratio", to_char(round(100 * ((a.value - b.value) / a.value ),2)) "Soft-Parse Ratio"
    from (select inst_id,value from gv$sysstat where name like 'parse count (total)') a,
    (select inst_id, value from gv$sysstat where name like 'parse count (hard)') b
    where a.inst_id = b.inst_id
    union
    select a.inst_id,'Execute Parse Ratio ' "Ratio", to_char(round(100 - ((a.value / b.value)* 100),2)) "Execute Parse Ratio"
    from (Select inst_id, value from gv$sysstat where name like 'parse count (total)') a,
    (select inst_id, value from gv$sysstat where name like 'execute count') b
    where a.inst_id = b.inst_id
    union
    select a.inst_id,'Parse CPU to Elapsed Ratio ' "Ratio", to_char(round((a.value / b.value)* 100,2)) "Parse CPU to Elapsed Ratio"
    from (Select inst_id, value from gv$sysstat where name like 'parse time cpu') a,
    (select inst_id, value from gv$sysstat where name like 'parse time elapsed') b
    where a.inst_id = b.inst_id
    union
    Select a.inst_id,'Chained Row Ratio ' "Ratio", to_char(round((a.val/b.val)*100,2)) "Chained Row Ratio"
    from (SELECT inst_id, SUM(value) val FROM gV$SYSSTAT WHERE name = 'table fetch continued row' group by inst_id) a,
    (SELECT inst_id, SUM(value) val FROM gV$SYSSTAT WHERE name IN ('table scan rows gotten', 'table fetch by rowid') group by inst_id) b
    where a.inst_id = b.inst_id
    union
    Select inst_id,'Latch Hit Ratio ' "Ratio", to_char(round(((sum(gets) - sum(misses))/sum(gets))*100,2)) "Latch Hit Ratio"
    from gv$latch
    group by inst_id
    /* Available from 10g
    union
    select inst_id, metric_name, to_char(value)
    from gv$sysmetric
    where metric_name in ( 'Database Wait Time Ratio', 'Database CPU Time Ratio')
    and intsize_csec = (select max(intsize_csec) from gv$sysmetric)
    order by inst_id
    What i am getting after this is:
    INST_ID Ratio Value
    1 Buffer Cache Hit Ratio .83
    1 Chained Row Ratio 0
    1 Dictionary Cache Hit Ratio 77.5
    1 Execute Parse Ratio 45.32
    1 Get Hit Ratio 75.88
    1 Latch Hit Ratio 100
    1 Library Cache Hit Ratio 99.52
    1 Parse CPU to Elapsed Ratio 24.35
    1 Pin Hit Ratio 95.24
    1 Soft-Parse Ratio 89.73
    i have a doubt with buffer cache hit ratio, can anyone please help me to understand this

    Buffer Cache Hit Ratio .83Quite weird value. It seems your system is doing all physical reads, which seems unrealistic.
    I had a 10.2.0.1 database where i saw this kind of result for cache hit ratio and after patching it to 10.2.0.4, it started showing results correctly.
    Probably it could be some Oracle 10g bug which made this odd display of hit ratio information in data dictionary. Can you try patching your database to latest 10g PSU, or contact Oracle support for a one-off patch for this problem
    Salman

  • Database buffer cache hit ratio is less that 90%

    Hi All,
    For the following query i get result less than 90%
    SELECT ROUND(((1 -(phy.VALUE /(cur.VALUE con.VALUE)))*100),2) "HIT RATIO"+
    FROM SYS.v_$sysstat cur,
    SYS.v_$sysstat con,
    SYS.v_$sysstat phy
    WHERE cur.NAME = 'db block gets'
    AND con.NAME = 'consistent gets'
    AND phy.NAME = 'physical reads' ;
    HIT RATIO
    +81.79+
    Please advice me what may be the reasons and how can i make it more than 90%.
    I have metalink access. Can i raise this issue with Oracle metalink?
    Thanks and regards,
    Arun Kumar

    user8853422 wrote:
    Thnaks for the reply..
    I have noticed for the another database it is 23.29.
    But i did not get any complaints from application side yet.
    It's laudable that you want to be proactive and fix the database before people complain, but I'll second what the others said, targetting a specific hit ratio is useless for that.
    Who told you to run that hit ratio script? There are a number of reasonable methodologies to determine if there might be problems, but that isn't one of them. Waiting for users to complain may or may not work, some users simply accept poor performance, thinking that's just the way it is.
    What are you really trying to accomplish?

  • Database Cache Hit ratio is very less

    Hi All,
    my live database Cache Hit ratio is very less. can some one proposed relevant solution for that.
    SELECT (1-((phy.value-phyd.value) / (cur.value + con.value))) * 100 "Cache Hit ratio"
    FROM v$sysstat cur, v$sysstat con, v$sysstat phy, v$sysstat phyd
    WHERE cur.name = 'db block gets'
    AND con.name = 'consistent gets'
    AND phy.name = 'physical reads'
    AND phyd.name = 'physical reads direct';
    Cache Hit ratio
    47.99717699362490769958384625413175240442
    select NAME,VALUE from v$parameter where name like '%db_cache_size%';
    NAME VALUE
    db_cache_size 335544320
    select name, value From v$sysstat
    where name in ('db block gets', 'consistent gets', 'physical reads');
    NAME VALUE
    db block gets 30047032214
    consistent gets 691770165681
    physical reads 376120181932
    Thanks

    user1093072 wrote:
    Hi all thanks a lot for your answers. i am getting some query time outs and while investigating got less ratios. can some one tell me how to get dicission using this ratios
    Buffer Hit % 95.71
    Cache Hit ratio 47.99The fact that you get two different values for "the same thing" is a clue that (a) your SQL statement is suspect and (b) your logic is flawed.
    You SQL is going to give you some kind of (meaningless) average since the database started up. The report you showed looks like part of an AWR or statspack report which will be covering a short interval of time. The difference between the two percentages may mean the two approaches are using different formula, or it may mean that the result is highly dependent on the time window.
    Since you have access to AWR/statspack - run off a report for a (short) interval when the system is performing well, and for when the system is performing badly, and compare them.
    As a starting point you could post the two sections "Load Profile" and "Top 5 Timed Events" to the forum for initial comment. If you do so, please make sure you use the "code" tags (see end of post) to make the output readable or you may get no replies.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Performance Hit Ratios

    Hi
    I would like calculate the following hit ratios against my instance performance metrics
    1.Buffer Cache Hit %
    2.Library Cache Hit %
    3.Redo No Wait %
    4.Memory Sort %
    5.Soft Parse %
    6.Commit %
    And I need to know what would be the optimal values against this hit ratio for 900 GB database with Aix 5.3 platform.
    if i dont have optimal values with query results. What are all the parameter should i need to tune and how much i need to tune?
    Kindly help me on this.
    Thanks
    Ranga

    V$PGASTAT
    This view gives instance-level statistics on the PGA memory usage and the automatic PGA memory manager. For example:
    SELECT * FROM V$PGASTAT;
    The output of this query might look like the following:
    NAME VALUE UNIT
    aggregate PGA target parameter 41156608 bytes
    aggregate PGA auto target 21823488 bytes
    global memory bound 2057216 bytes
    total PGA inuse 16899072 bytes
    total PGA allocated 35014656 bytes
    maximum PGA allocated 136795136 bytes
    total freeable PGA memory 524288 bytes
    PGA memory freed back to OS 1713242112 bytes
    total PGA used for auto workareas 0 bytes
    maximum PGA used for auto workareas 2383872 bytes
    total PGA used for manual workareas 0 bytes
    maximum PGA used for manual workareas 8470528 bytes
    over allocation count 291
    bytes processed 2124600320 bytes
    extra bytes read/written 39949312 bytes
    cache hit percentage 98.15 percent
    The main statistics displayed in V$PGASTAT are as follows:
    aggregate PGA target parameter: This is the current value of the initialization parameter PGA_AGGREGATE_TARGET. The default value is 20% of the SGA size. If you set this parameter to 0, automatic management of the PGA memory is disabled.
    aggregate PGA auto target: This gives the amount of PGA memory Oracle can use for work areas running in automatic mode. This amount is dynamically derived from the value of the parameter PGA_AGGREGATE_TARGET and the current work area workload. Hence, it is continuously adjusted by Oracle. If this value is small compared to the value of PGA_AGGREGATE_TARGET, then a lot of PGA memory is used by other components of the system (for example, PL/SQL or Java memory) and little is left for sort work areas. You must ensure that enough PGA memory is left for work areas running in automatic mode.
    global memory bound: This gives the maximum size of a work area executed in AUTO mode. This value is continuously adjusted by Oracle to reflect the current state of the work area workload. The global memory bound generally decreases when the number of active work areas is increasing in the system. As a rule of thumb, the value of the global bound should not decrease to less than one megabyte. If it does, then the value of PGA_AGGREGATE_TARGET should probably be increased.
    total PGA allocated: This gives the current amount of PGA memory allocated by the instance. Oracle tries to keep this number less than the value of PGA_AGGREGATE_TARGET. However, it is possible for the PGA allocated to exceed that value by a small percentage and for a short period of time, when the work area workload is increasing very rapidly or when the initialization parameter PGA_AGGREGATE_TARGET is set to a too small value.
    total freeable PGA memory: This indicates how much allocated PGA memory which can be freed.
    total PGA used for auto workareas: This indicates how much PGA memory is currently consumed by work areas running under automatic memory management mode. This number can be used to determine how much memory is consumed by other consumers of the PGA memory (for example, PL/SQL or Java):
    PGA other = total PGA allocated - total PGA used for auto workareas
    over allocation count: This statistic is cumulative from instance start-up. Over-allocating PGA memory can happen if the value of PGA_AGGREGATE_TARGET is too small to accommodate the PGA other component in the previous equation plus the minimum memory required to execute the work area workload. When this happens, Oracle cannot honor the initialization parameter PGA_AGGREGATE_TARGET, and extra PGA memory needs to be allocated. If over-allocation occurs, you should increase the value of PGA_AGGREGATE_TARGET using the information provided by the advice view V$PGA_TARGET_ADVICE.
    total bytes processed: This is the number of bytes processed by memory-intensive SQL operators since instance start-up. For example, the number of byte processed is the input size for a sort operation. This number is used to compute the cache hit percentage metric.
    extra bytes read/written: When a work area cannot run optimally, one or more extra passes is performed over the input data. extra bytes read/written represents the number of bytes processed during these extra passes since instance start-up. This number is also used to compute the cache hit percentage. Ideally, it should be small compared to total bytes processed.
    cache hit percentage: This metric is computed by Oracle to reflect the performance of the PGA memory component. It is cumulative from instance start-up. A value of 100% means that all work areas executed by the system since instance start-up have used an optimal amount of PGA memory. This is, of course, ideal but rarely happens except maybe for pure OLTP systems. In reality, some work areas run one-pass or even multi-pass, depending on the overall size of the PGA memory. When a work area cannot run optimally, one or more extra passes is performed over the input data. This reduces the cache hit percentage in proportion to the size of the input data and the number of extra passes performed. Example 7-3 shows how cache hit percentage is affected by extra passes.

Maybe you are looking for

  • Media Encoder crashes when exporting from Premiere Pro

    Media Encoder crashes when exporting from Premiere Pro. I am queueing multiple files for export and Media Encoder will crash. The computer system has 32GB of RAM and the videos export fine in Premiere, but that requires exporting each one individuall

  • Adobe Acrobat Reader 8 Pdf files will not open normally

    This applies to all Pdf files. Double click or right click>click "open."  Receive:  Adobe Acrobat Reader is required to view the file.  Would you like to install Adobe Acrobat Reader now? I had Adobe Reader 9.  Experienced problem described above.  U

  • Event Registration: Cluster vs. Individuals

    I have a piece of code called a "Receiver".   It listens on a TCP connection for various messages from a PXI box. There are about 30-40 different types of messages, some with large payloads, some with small. The receiver decodes which message came in

  • My Safari keeps restarting, even after a clean install of OSX Mountain Lion

    Even after a clean install of OS X, it restarts like almost all the time. Sometimes after a crash, I launch the app with only a page loaded and it crashes too. Tried some of the suggestions but it still crashes. Someone please help me. The crash repo

  • Filter incomming HTTPS traffing based on destination URL

    Hi, we use  a CISCO ASA 5510. We publish our Exchange server Port 443 via NAT. Now we want to filter incomming traffic so tat traffic to a specific URL doesn't get passed to the Exchange. Is this possible? Thanks Robert