Oracle Performance Tuning
[email protected]

V$LIBRARYCACHE
Collecting Library Cache Statistics
Interpretation
Tuning Suggestions

The statistics found in the v$librarycache table reflect all library cache activity since the most recent instance startup. By default, this table is only available to the user SYS and to users granted SELECT ANY TABLE system privilege, such as SYSTEM.

Each row in this table contains statistics for a specific item kept in the library cache. The item described by each row is identified by the value of the NAMESPACE column. Rows of the table with the following NAMESPACE values reflect library cache activity for SQL statements and PL/SQL blocks:

Rows with other NAMESPACE values reflect library cache activity for object definitions that Oracle uses for dependency maintenance. The following columns of the V$LIBRARYCACHE table reflect library cache misses on execution calls:

Note: If you get a chance take a look at the SNMP documentation. Its pretty cool.


Collecting Library Cache Statistics
To collect statistics query the V$LIBRARYCACHE table over a period of time with this query:
SELECT SUM(pins) "Executions",
   SUM(reloads) "Cache Misses while Executing"
   FROM v$librarycache;

Executions Cache Misses while Executing
---------- ----------------------------
    320871                          549

Interpreting the V$LIBRARYCACHE Table
Examining the data returned by the sample query leads to these observations:

Total RELOADS should be near 0. If the ratio of RELOADS to PINS is more than 1%, then you should reduce these library cache misses through the means discussed in the next section.

Reducing Library Cache Misses
You can reduce library cache misses by
  • Allocating Additional Memory for the Library Cache
  • Writing Identical SQL Statements

  • Speeding Access to Shared SQL Areas on Execution Calls

    Caching Session Cursors



    This is a copy of an article published @ http://hayden.home.mindspring.com/