- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: buffer cache hit ratio
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2003 09:42 PM
тАО09-25-2003 09:42 PM
I am rather new to this so appologies in advance.
What i need to now is how i calculate the buffer cache hit ratio with the following calculation.
Hit ratio = 1 - (physical reads / (db block gets + consistent gets))
the sql i ran is as followed :
Select name, value From v$sysstat
Where name in ('db block gets', 'consistent gets', 'physical reads');
O/P
NAME VALUE
---------------------- ----------
db block gets 245246
consistent gets 13754331
physical reads 3426485
i tried but can not see how when i run a sql script that gives me the answer i get 76% hit ratio
Can any one explain the calculation to me
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2003 09:54 PM
тАО09-25-2003 09:54 PM
Solutionhit ratio =
1 - ( physical reads - (physical reads direct + physical reads direct (lob)) )
--------------------------------------------------------------------------
( db block gets + consistent gets - (physical reads direct + physical reads direct (lob)) )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2003 09:56 PM
тАО09-25-2003 09:56 PM
Re: buffer cache hit ratio
U have everything and query the same, i mean in a right sql query way to get hit ratio.
the query u have given ::
that just selected the values of the those parameters.
They are parameters and and their values.
Use this quesry To get The HIT ratio:
select 1-(sum(decode(name, 'physical reads', value,0))/
(sum(decode(name, 'db block gets', value,0)) +
(sum(decode(name, 'consistent gets', value,0))))) * 100
"Read Hit Ratio"
from v$sysstat;
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2003 10:11 PM
тАО09-25-2003 10:11 PM
Re: buffer cache hit ratio
set pagesize 60
set heading off
set termout off
col lib_hit format 999.999 justify right
col dict_hit format 999.999 justify right
col db_hit format 999.999 justify right
col ss_share_mem format 999.99 justify right
col ss_persit_mem format 999.99 justify right
col ss_avg_users_cursor format 999.99 justify right
col ss_avg_stmt_exe format 999.99 justify right
col val2 new_val lib noprint
select 1-(sum(reloads)/sum(pins)) val2
from v$librarycache
/
col val2 new_val dict noprint
select 1-(sum(getmisses)/sum(gets)) val2
from v$rowcache
/
col val2 new_val phys_reads noprint
select value val2
from v$sysstat
where name = 'physical reads'
/
col val2 new_val log1_reads noprint
select value val2
from v$sysstat
where name = 'db block gets'
/
col val2 new_val log2_reads noprint
select value val2
from v$sysstat
where name = 'consistent gets'
/
col val2 new_val chr noprint
select 1-(&phys_reads / (&log1_reads + &log2_reads)) val2
from dual
/
col val2 new_val avg_users_cursor noprint
col val3 new_val avg_stmts_exe noprint
select sum(users_opening)/count(*) val2,
sum(executions)/count(*) val3
from v$sqlarea
/
set termout on
set heading off
select 'Data Block Buffer Hit Ratio : '||&chr db_hit_ratio,
'Shared SQL Pool ',
' Dictionary Hit Ratio : '||&dict dict_hit,
' Shared SQL Buffers (Library Cache) ',
' Cache Hit Ratio : '||&lib lib_hit,
' Avg. Users/Stmt : '||
&avg_users_cursor||' ',
' Avg. Executes/Stmt : '||
&avg_stmts_exe||' '
from dual
/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2003 10:39 PM
тАО09-25-2003 10:39 PM
Re: buffer cache hit ratio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2003 11:24 PM
тАО09-25-2003 11:24 PM
Re: buffer cache hit ratio
http://www.ixora.com.au/tips/tuning/cache_miss.htm
Hope this help.
Rgds,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2003 01:20 AM
тАО09-26-2003 01:20 AM
Re: buffer cache hit ratio
Thanks for getting back to me i am still struglling with this calculation.
1 - ( physical reads - (physical reads direct + physical reads direct (lob)) )
--------------------------------------------------------------------------
( db block gets + consistent gets - (physical reads direct + physical reads direct (lob)) )
how do i put this formula to practice because i get a total diffrent output.
NAME VALUE
db block gets 419514
consistent gets 21641886
physical reads 5111896
the hit ratio should be 76.83%
can you please give me more details how this is achieved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2003 02:08 AM
тАО09-26-2003 02:08 AM
Re: buffer cache hit ratio
As with many oracle-related queries, you will find useful information on AskTom.
The thread I am looking at is
http://asktom.oracle.com/pls/ask/f?p=4950:8:11225327007479099115::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:57412348055,
but if that doesn't work for you, go to
http://asktom.oracle.com/
and enter "buffer cache hit ratio" into the search box, and look at the first url.
I think the thread contains exactly what you want.
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2003 08:53 AM
тАО09-26-2003 08:53 AM
Re: buffer cache hit ratio
What I'd like to know is WHY do you need to know how to calculate the buffer cache hit ratio.
Will you get a cookie when you figure this out?
And when you come up with a number, how is that going to be used in a meaningfull matter?
Please check out writings like http://www.hotsos.com/ "Are you still using cache hit ratios? - Cary Millsap's follow-up to his '99.9% paper' goes even further to explain why the buffer cache hit ratio is an illegitimate measure of SQL efficiency."
http://www.hotsos.com/dnloads/1.Millsap2001.02.26-CacheRatio.pdf
and
http://www.hotsos.com/dnloads/1.Millsap2001.11.14-LIO.pdf
teasingly yours,
Hein.