Code Example 1:

select Sum (pins) as Executions
,Sum (reloads) as Misses
   ,( (Sum (pins) / Sum (reloads) ) / 
(Sum (pins) + Sum (reloads) )) * 100 as reloads
   ,(1 - ( (Sum (pins) / Sum (reloads) ) 
/ (Sum (pins) + Sum (reloads) ) )) * 100 as pins
from v$librarycache

Code Example 2:

select 1-(phy.value/(cur.value + con.value)) Cache_Hit_Ratio 
 from v$sysstat cur, 
 v$sysstat con, 
 v$sysstat phy 
 where cur.name='db block gets' 
 and con.name = 'consistent gets' 
 and phy.name = 'physical reads'

Code Example 3:

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 AS HIT_RATIO
 from v$sysstat

Code Example 4:

select to_number(v$parameter.value) pool_size,
 v$sgastat.bytes free_bytes
 from v$sgastat,v$parameter
 Where
 v$sgastat.name='free memory'
 and
 v$parameter.name='shared_pool_size'