rem-------------------------------------------
rem 测量缓存命中率
rem ------------------------------------------
-- 获取初始缓存命中率...
select round((1-(phy.value / (cur.value + con.value)))*100,2) "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'
/
-- 我们人为来增加缓存命中率...
declare
v_dummy dual.dummy%type;
begin
for i in 1..1000 loop
select dummy into v_dummy from dual;
end loop;
end;
/
-- 我们再来测量...
select round((1-(phy.value / (cur.value + con.value)))*100,2) "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'
/
|