ITPub博客

首页 > 数据库 > Oracle > Buffer Cache Hit Ratio

Buffer Cache Hit Ratio

原创 Oracle 作者:xychong123 时间:2017-01-03 14:58:35 0 删除 编辑
  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博客 ” ,链接:https://blog.itpub.net/20747382/viewspace-2131796/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-06-10

  • 博文量
    118
  • 访问量
    120449