首页 > 应用开发 > IT综合 > SHARED POOL (6)
rem
rem Title: libcache.sql
rem
rem FUNCTION: Generate a library cache report
rem
column namespace heading "Library Object"
column gets format 9,999,999 heading "Gets"
column gethitratio format 999.99 heading "Get Hit%"
column pins format 9,999,999 heading "Pins"
column pinhitratio format 999.99 heading "Pin Hit%"
column reloads format 99,999 heading "Reloads"
column invalidations format 99,999 heading "Invalid"
column db format a10
set pages 58 lines 80
start title80 "Library Caches Report"
define output = rep_out&dblib_cache
--spool &output
select
namespace,
gets,
gethitratio*100 gethitratio,
pins,
pinhitratio*100 pinhitratio,
RELOADS,
INVALIDATIONS
from
v$librarycache
/
--spool off
pause Press enter to continue
set pages 22 lines 80
ttitle off
undef output
执行结果如下:
理想的结果Get Hit Ratio都维持在80%以上,Pin Hit Ratio都维持在90%以上,Reloads和Invalid值越低越好。
调整方法:没有专门的参数调整Library Cache大小,要调整大小就必须要调整Shared Pool大小。
对于频繁使用的procedure和package,将其pin在内存里,可以提高性能。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/207/viewspace-814405/ ,如需转载,请注明出处,否则将追究法律责任。