Fosdccf.blog.chinaunix.net
sdccf
全部博文(19283)
Linux酷软(214)
tmp(0)
PostgreSQL(93)
Solaris(383)
AIX(173)
SCOUNIX(575)
DB2(1005)
Shell(386)
C/C++(1187)
MySQL(1750)
Sybase(465)
Oracle(3695)
Informix(548)
HP-UX(0)
IBM AIX(2)
Sun Solaris(0)
BSD(1)
Linux(8597)
SCO UNIX(23)
2011年(1)
2009年(125)
2008年(19094)
2007年(63)
clifford
linky521
曾德标
fengzhan
leon_yu
mcuflowe
yt200902
guanyuji
GY123456
snow888
carlos94
丸喵喵
sean229
cxunix
可怜的猪
cqxc413
xzzgege
wb123456
分类: Oracle
2008-04-29 07:47:38
在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' /
上一篇:Oracle数据库中按用户名重建索引的方法
下一篇:在Oracle中列出指定数据表的全部索引列
登录 注册