Call for Oracle support & training (800) 766-1884
Free Oracle Tips

Home
Corporate Oracle Training
Custom Oracle Training
Oracle New Features Training
Advanced Oracle DBA Classes
Oracle Tuning Courses
Oracle Tips & Tricks
Oracle Training Links
Oracle Training Links
Oracle Training Links

We are top for USA Oracle Training Clients

 

Free Oracle Tips


 
HTML Text AOL

Free Oracle App Server Tips


 
HTML Text

Oracle support

Oracle training

Oracle tuning

Rednecks!

Remote Oracle

Custom Oracle Training

Donald K. Burleson

Oracle Tips

Oracle keep recycle pool buffer hot ratio

If you use a keep and recycle buffer pool in addition to the default buffer cache, you can use the poolhit.sql script to find the hit rates in each pool:

select
         name,
         100 * (1 - (physical_reads / (db_block_gets +
         consistent_gets))) hit_ratio
from
         sys.v$buffer_pool_statistics
where
         db_block_gets + consistent_gets > 0;

 

Output from the above query might look like the following:

 

NAME       HIT_RATIO

---------- ---------

DEFAULT        92.82

KEEP           93.98

RECYCLE        85.05

 

From the overall buffer caches, you can turn to the cache hit ratios for user processes.  The sesshitrate.sql script below will provide you with a buffer cache hit ratio for all currently connected sessions:

See Code depot for complete script

select
        b.sid sid,
        decode (b.username,null,e.name,b.username)
        user_name,
        d.spid os_id,
        b.machine machine_name,
        to_char(logon_time,'mm/dd/yy hh:mi:ss pm')
        logon_time,
        100 - 100 *
        (round ((sum (decode (c.name,

        'physical reads', value, 0)) -
        sum (decode (c.name,

        'physical reads direct', value, 0)) –

        sum(decode (c.name,

        'physical reads direct (lob)', value, 0))) /
        (sum (decode (c.name,

        'db block gets', value, 1)) +
        sum (decode (c.name,

        'consistent gets', value, 0))),3)) hit_ratio
from   
        sys.v$sesstat a,
        sys.v$session b,
        sys.v$statname c,
        sys.v$process d,
        sys.v$bgprocess e
where  
        a.statistic#=c.statistic# and
. . .
        c.name in ('physical reads',
                   'physical reads direct',
                   'physical writes direct (lob)',
                   'physical reads direct (lob)',
                   'db block gets',
                   'consistent gets')
group by
         b.sid,
         d.spid,
. . .  
         to_char(logon_time,'mm/dd/yy hh:mi:ss pm')
order by
         6 desc;


After examining the session hit ratio information, you can move into SQL statement analysis with the sqlhitrate.sql  script:

See Code depot for complete script

select
        sql_text ,
. . .
from   
        sys.v$sqlarea a,
        sys.all_users b
where  
        a.parsing_user_id=b.user_id and
        b.username not in ('SYS','SYSTEM')
order by
        3 desc;

One nuance in the SQL hit ratio script (as well as the buffer pool script, which calculates hit rates for the different buffer pools) that you should be aware of, is that the Oracle v$sqlarea view does not provide a way to filter direct reads (physical reads that do not pass through the buffer cache, and consequently do not increment any logical I/O counters).  This means it is possible to have a SQL statement that prompts a lot of direct reads, while the hit ratio shows negative.


The above is an excerpt from Oracle Performance Troubleshooting by Robin Schumacher.

It's only $19.95 and you can order it and get instant access to the Oracle scripts here:

http://www.rampant-books.com/book_2003_1_perf.htm

 

 

 

 
 
 

Oracle performance tuning book

 

 

Oracle performance tuning software

 
Oracle performance tuning software
 
Oracle performance Tuning 10g reference poster
 
Oracle training in Linux commands
 
Oracle training Excel
 
 
 
 
 
email BC:


Copyright © 1996 -  2014 by Burleson Inc. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.