Why value of consistent gets is different in v$sysstat and v$buffer_pool_statistics
I am trying to calculate the buffer hit ratio. We only have one default buffer pool. I got different results from two different calculations.
SQL> Select 1 - phy.value/(con.value + dbb.value)
From v$sysstat dbb, v$sysstat con, v$sysstat phy
where dbb.name ='db block gets from cache'
and con.name = 'consistent gets from cache'
and phy.name = 'physical reads cache';
2 3 4 5
1-PHY.VALUE/(CON.VALUE+DBB.VALUE)
---------------------------------
.905156615
SQL> select name, physical_reads, db_block_gets,consistent_gets,
1-(physical_reads/(db_block_gets + consistent_gets)) "Hit Ratio" from v$buffer_pool_statistics; 2
NAME PHYSICAL_READS DB_BLOCK_GETS CONSISTENT_GETS Hit Ratio