You are on page 1of 4

Oracle Memory Architecture -1-

There are five memory structures that make up the System Global Area (SGA).

SGA

The shared pool consists of the following areas:

Library cache includes the shared SQL area, private SQL areas, PL/SQL procedures and packages
the control structures such as locks and library cache handles
Shared Pool
Dictionary cache is a collection of database tables and views containing information about the
database, its structures and users.

Buffers for parallel execution messages and control structures


This area holds copies of read data blocks from the datafiles. The buffers in the cache contain two
lists, thwe write list and the least used list (LRU). The write list holds dirty buffers which contain
modified data not yet written to disk. The least used list holds free buffers (no useful data) , pinned
buffers (being accessed) and dirty buffers that have not yet been moved to the write list.
Buffer
The size is deteremnied by the following in the system paramenter file:
cache
DB_2K_CACHE_SIZE
DB_4K_CACHE_SIZE
DB_8K_CACHE_SIZE
DB_16K_CACHE_SIZE
DB_32K_CACHE_SIZE
Is a circular buffer that holds information about changes made to the database, this information is
Redo buffer stored in redo entries. These entries contain necessary information to reconstruct/redo changes by the
INSERT, UPDATE, DELETE, CREATE, ALTER and DROP commands.
This is an optional memory area that provide large areas of memory for:

Session memory
Large Pool I/O server processes
Backup and Restore

Parallel execution message buffers.


Java Pool used to execute java code within the database.
Oracle Memory Architecture -2-

Display information regarding the SGA

Memory
Memory area Displaying the information
location
SGA sql> show sga;
SGA (detailed) use table v$sgastat;

Buffer cache SGA use table v$bh;


compute sum of bytes on pool
break on pool skip 1
Display memory
SGA
allocation select pool, name bytes
from v$sgastat
order by pool, name
Display the redo buffer SGA select * from v$sga where name = 'Redo Buffers'

Library cache shared pool use table v$librarycache;


Dictionary cache shared pool use table v$rowcache;

PGA

Each process connected to the database requires its own area of memeory this is know as the Program Global
Area (PGA). This area stores variables, arrays and other information that do not need to be shared with other
processes.

PGA in an instance running without the multi-threaded server (named Shared Server in
Session Oracle9i) requires additional memory for the user's session, such as private SQL areas and other
Information information. If the instance is running the multi-threaded server, this extra memory is not in the
PGA, but is instead allocated in the SGA (the Shared Pool).
The memory allocated to hold a sessions variables, arrays, etc and other information relating to
Stack space
the session. However for a shared server the session memory is shared and not private

Display information regarding the PGA

Session v$sesstat, v$statname


Oracle Memory Architecture -3-

Stack
select a.name, b.name
Display PGA and from v$statname a, v$mystat b
UGA usage where a.statistic# = b.statistic#
and a.name like '%ga %'

Server Processes

There could be upto 11 server process depending on the server configuration

Responsible for cleaning up after abnormally terminated connections.


Responsible for monitoring other server processes and restarting them if
Process Monitor PMON
necessary
Registers the instance with the listener.
Temporary space cleanup
Crash recovery apon restart
Coalescing free space
Recovering transactions active against unavailable files
System Monitor SMON
Instance recovery of failed node in OPS (Oracle parallel server)
Cleans up OJB$ (Low Level data dictionary)
Shrinks rollback segments
Offlines rollback segments
Distributed database Recovers transactions that are left in a prepared state because of a crash or loss of
RECO
recovery connection during a two-phase commit.
It does not do the checkpoint but assists with the checkpointing process by
Checkpoint process CKPT
updating the file headers of the data files.
Responsible for writing dirty blocks to disk, it writes the dirty blocks from the
Database block writer DBWn
buffer.
Responsible for flushing to disk the contents of the redo log buffer located in the
SGA.

It does this:
Log writer LGWR
Every 3 seconds
Whenever you commit
When the redo log buffer is a third full or contains 1 Mb of bufferd
data
Copy online redo log file to another location when LGWR fills up, these log files
Archive process ARCn
would be used to perform media recovery.
Used in OPS and keeps each servers SGA in the clusters consistent with each
Block server process BSP
other.
Used in OPS and monitors all instances in a cluster to detect a failure of an
Lock monitor process LMON
instance.
Used in OPS and controls the global locks and global resources for the block
Lock manager daemon LMD
buffer cache in a clustered environment.
Oracle Memory Architecture -4-

Used in OPS and is the same as the LMD daemon but handles requests for all
Lock process LCKn
global resources other than database block buffers