 |
|
Oracle Database Tips by Donald Burleson |
Advanced Tuning of the
Shared Pool
Perhaps one of the least-understood aspects
of Oracle Shared Global Area tuning is tuning the shared pool. The
generally accepted tuning methodology involves throwing memory into
the pool until either the problem goes under or the problem is
masked. Here we will examine the shared pool and define a method for
tuning it that uses measurement, not guesswork, to drive the tuning
methodologies. Numerous scripts for examining the shared pool are
provided.
What Is the shared pool?
Many people know that the shared pool is a
part of the Oracle SGA but little else, so to begin this discussion
it's necessary to answer exactly,What is the shared pool? The shared
pool contains several key Oracle performance-related memory areas.
If the shared pool is improperly sized, then overall database
performance will suffer, sometimes dramatically. Figure 13.1
diagrams the shared pool structure located inside Oracle 8i and 9i
SGAs.
As you can see from the structures pictured
in Figure 13.1, the shared pool is separated into many
substructures. The substructures of the shared pool fall into two
broad areas: the fixed-size areas, which, for a given database at a
given point in time stay relatively constant in size, and the
variable-size areas, which grow and shrink according to user and
program requirements.
In Figure 13.1, the areas inside the library
caches' substructure are variable in size, while those outside the
library caches (with the exception of the request and response
queues used with MTS) stay relatively fixed in size. The sizes are
determined based on an Oracle internal algorithm that ratios out the
fixed areas based on overall shared pool size, a few of the
initialization parameters, and empirical determinations from
previous versions. In early versions of Oracle (notably 6.2 and
earlier), the dictionary caches could be sized individually allowing
a finer control of this aspect of the shared pool. With Oracle 7,
the internal algorithm for sizing the data dictionary caches took
control from the DBA.
The major difference between the shared
pools in Oracle8i and Oracle9i is that any excess memory specified
by the SGA_MAX_CACHE parameter and not used in the actual cache and
buffer definitions will be placed in the miscellaneous area of the
shared pool.
The shared pool is used for objects that can
be shared among all users, such as table definitions, reusable SQL
(although nonreusable SQL is also stored there), PL/SQL packages,
procedures, and functions. Cursor information is also stored in the
shared pool. At a minimum, the shared pool must be sized to
accommodate the needs of the fixed areas, plus a small amount of
memory reserved for use in parsing SQL and PL/SQL statements. If
this is not done, ORA-04031 and ORA-07445 errors will result.
See Code Depot

www.dba-oracle.com/oracle_scripts.htm |