11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 4 ■ PERFORMANCE MANAGEMENT 185Managing the Query Result CacheYou manage the SQL query result cache through the DBMS_RESULT_CACHE package (we’ve usedthis package earlier in this section), which provides you statistics that help manage the memoryallocation for the query result cache. Here are the key procedures of the DBMS_RESULT_CACHEpackage:• exec dbms_result_cache.flush: Removes all results and clears the cache memory■Note If the number of cached results keeps growing, the result cache could be eventually filled up. Theresult cache will grow, but only until it reaches the maximum size set by the result_cache_max_sizeparameter. You must manually purge results from the cache to prevent the cache from filling up. First disablethe cache before you purge it, because you can’t purge while the cache is in active use.• exec dbms_result_cache.invalidate (ABC', 'TESTTAB'): Invalidates cache results for aspecified object• select dbms_result_cache.status from dual: Shows status of the result cache• exec dbms_result_cache.memory_report: Shows result cache memory usageYou can also use the following views to find out details about the query result cache:• V$RESULT_CACHE_STATISTICS: Shows cache settings and memory usage statistics• V$RESULT_CACHE_OBJECTS: Lists all cached objects and their attributes• V$RESULT_CACHE_DEPENDENCY: Shows the dependency information between thecached results and dependencies• V$RESULT_CACHE_MEMORY: Shows all memory blocks and their statisticsThe V$RESULT_CACHE_OBJECTS view shows both cached results and all dependencies.The STATUS column can take the following values:• new: The cached result is still being built.• published: The cached result is available for use by other queries.• bypass: Other queries will bypass the cached result.• expired: The cached result has crossed the expiration time limit.• invalid: The cached result is unavailable for use by other queries.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!