 |
|
Oracle Concepts -
Oracle8 and Oracle8i System Global Area
Oracle Tips by Burleson Consulting |
System Global Area
The global memory area, called the System or
Shared Global Area (SGA) is an area of CPU memory that is reserved for
Oracle use only. It contains buffers that are used to speed
transaction throughput and help maintain the system integrity and
consistency. No data is altered directly on the disk; it all passes
through the SGA. The size and configuration of the SGA is defined by a
file called the initialization file or INIT.ORA file, which can
contain information on each type of buffer or shared pool area in the
SGA.
SGA
Figure 6 shows the SGA for Oracle8 and
Oracle8i. Notice the numerous areas contained in the SGA and remember
that each of these areas may be further subdivided into other related
areas. The V$SGASTAT view has 39 areas listed in both an Oracle8 and
Oracle8i database without multi-threaded server or Oracle Parallel
server present.
Figure 6: Oracle8 and Oracle8i SGAs
Virtually all of the areas in the SGA are
configured either directly (SHARED_POOL_SIZE, DB_BLOCK_BUFFERS,
LOG_BUFFERS, LARGE_POOL_SIZE, etc.) or indirectly using initialization
parameters. Improperly sized SGA areas can cause large performance
problems.
Modifying the INIT.ORA
The INIT.ORA (or initSID.ora) file sets the
initialization parameters for an instance specified by the SID
contained in the file name. To modify the parameters permanently you
must alter them in the initialization file. As was shown previously
there are numerous parameters which can be altered on the fly or on a
per session basis using various forms of the ALTER command.
The values for your initialization parameters
can be easily obtained by looking at the initialization file or by
looking at the V$PARAMETER view. The SVRMGRL SHOW PARAMETERS command
can also be used to show parameter values.
Any editor can be used to modify the
initialization parameter file but it must be stored as a text file.
Anytime a parameter is altered the effects of the change should be
closely monitored. Invalid parameters will cause Oracle to not
startup.
Allocating And Caching Memory
The name of the game in Oracle configuration
is properly allocating and using memory. By using the initialization
parameters we allocate memory for use by Oracle. We can determine how
this memory is used by creating or altering objects using the CACHE/NOCACHE
and the KEEP and RECYCLE POOL options. The DB Block Buffer area can be
split into the DEFAULT, KEEP and RECYCLE pools which should be used to
optimize how objects are cached.
In Oracle8 and Oracle8i the database block
buffer has been split into three possible areas, the default, keep and
recycle buffer pool areas. It is not required that these three pools
be used, only one, the default pool configured with the
DB_BLOCK_BUFFERS initialization parameter must be present, the others
are ?sub? pools to this main pool. How are the various pools used?
Use of the Default Pool
If a table, index or cluster is created
without specifying that the KEEP or RECYCLE pool be used for its data,
then it is placed in the default pool when it is accessed. This is
standard Oracle7 behavior and if no special action is taken to use the
other pools then this is also standard Oracle8 and Oracle8I behavior.
The initialization parameters DB_BLOCK_BUFFERS and
DB_BLOCK_LRU_LATCHES must be set if multiple pools are to be used:
DB_BLOCK_BUFFERS = 2100
DB_BLOCK_LRU_LATCHES = 18
Use of The KEEP Pool
The KEEP database buffer pool is configured
using the BUFFER_POOL_KEEP initialization parameter which looks like
so:
BUFFER_POOL_KEEP = ?300,3?
The two specified parameters are the number of
buffers from the default pool to assign to the keep pool and the
number of LRU (least recently used) latches to assign to the keep
pool. The minimum number of buffers assigned to the pool is 50 times
the number of assigned latches. The keep pool, as its name implies, is
used to store object data that shouldn?t be aged out of the buffer
pool such as look up information and specific performance enhancing
indexes. The objects are assigned to the keep pool through either
their creation statement or by specifically assigning them to the pool
using the ALTER command. Any blocks already in the default pool are
not affected by the ALTER command, only subsequently accessed blocks.
The keep pool should be sized such that it can
hold all the blocks from all of the tables created with the buffer
pool set to KEEP.
Use of the RECYCLE Pool
The RECYCLE database buffer pool is configured
using the BUFFER_POOL_RECYCLE initialization parameter which looks
like so:
BUFFER_POOL_RECYCLE = ?900,6?
The two specified parameters are the number of
buffers from the default pool to assign to the recycle pool and the
number of LRU (least recently used) latches to assign to the keep
pool. The minimum number of buffers assigned to the pool is 50 times
the number of assigned latches. The recycle pool, as its name implies,
is used to store object data that should be aged out of the buffer
pool rapidly such as searchable LOB information. The objects are
assigned to the recycle pool through either their creation statement
or by specifically assigning them to the pool using the ALTER command.
Any blocks already in the default pool are not affected by the ALTER
command, only subsequently accessed blocks.
As long as the recycle pool shows low block
contention it is sized correctly.
With the above setpoints for the default, keep
and recycle pools the default pool would end up with 900 buffers and 6
lru latches.
This is an excerpt from
the eBook "Oracle
DBA made Simple".
For more details on Oracle
database administration, see the "Easy
Oracle Jumpstart" by Robert Freeman and Steve Karam. It?s
only $19.95 when you buy it directly from the publisher
here.
|