Buffer Cache Hit Ratio

xychong123發表於2017-01-03
  rem 
rem  This script uses PL/SQL. 
rem  le hit ratio  
rem 
  
col global_name for A20  
variable d number  
variable c number  
variable r number  
begin  
  select value into :c  
  from v$sysstat   
  where name = 'consistent gets';  
  select value into :d  
  from v$sysstat   
  where name = 'db block gets';  
  select (1- value/( :c + :d)) into :r    
  from v$sysstat  
  where name in ( 'physical reads');  
  
end;  



 select  global_name, :r "Hit Ratio" from  global_name ; 
 
     GLOBAL_NAME   Hit Ratio 
     -----------   ---------- 
     V920.WORLD    .995129671



col METRIC_NAME for a40
set lines 150
Alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
select begin_time,end_time,metric_name,value from v$metric_history 
where metric_name ='Buffer Cache Hit Ratio'  order by 1;
 
 
Alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
select begin_time,end_time,metric_name,average from v$sysmetric_summary
where metric_name = 'Buffer Cache Hit Ratio'


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20747382/viewspace-2131796/,如需轉載,請註明出處,否則將追究法律責任。

相關文章