| 導購 | 订阅 | 在线投稿
分享
 
 
 

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- 王朝網路 版權所有