| 订阅 | 在线投稿
分享
 
 
 

Oracle性能调优过程中如何观察缓存命中率

来源:互联网  宽屏版  评论
2008-06-01 03:14:00

在Oracle数据库性能调优的过程中,当需要观察缓存命中率(Measure the Buffer Cache Hit Ratio)时,我们可以使用下面的语句:

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'

/

 
在Oracle数据库性能调优的过程中,当需要观察缓存命中率(Measure the Buffer Cache Hit Ratio)时,我们可以使用下面的语句: 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' /
󰈣󰈤
 
 
 
>>返回首页<<
 
 热帖排行
 
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
©2005- 王朝网络 版权所有