You are on page 1of 3

Oracle is optimized for your environment, and teams of experts make sure that Oracle

takes advantage of every possible system components on your hardware including these:
1. System processors.
2. System Memory.
3. Your network.
4. Disk Storage.
In Oracle Database 10g you only need to define two parameters (sga_target and
sga_max_size) to configure your SGA. If these parameters are configured, Oracle will
calculate how much memory to allocate to the different areas of the SGA using a feature
called Automatic Memory Management (AMM)
The default size for the buffer pool (64k) is too small. We suggest you set this to a value
of 1m when you configure Oracle.
----The System Global Area (SGA) is a group of shared memory areas that are dedicated to
an Oracle instance (an instance is your database programs and RAM).
All Oracle processes use the SGA to hold information. The SGA is used to store
incoming data (the data buffers as defined by the db_cache_size parameter), and internal
control information that is needed by the database.
We have already noted that the SGA was sub-divided into several memory structures that
each have different missions. The main areas contained in the SGA that you will be
initially interested in have complicated names, but are actually quite simple:
* The buffer cache (db_cache_size)
* The shared pool (shared_pool_size)
* The redo log buffer (log_buffer)
sp
the Shared Pool is a RAM area within the RAM heap that is created at startup time,
a component of the System Global Area (the SGA). The shared pool is the most
important area of the SGA, except for the data buffer caches.
The Oracle shared pool contains Oracle's library cache, which is responsible for
collecting, parsing, interpreting, and executing all of the SQL statements that go against
the Oracle database.

Since it is not possible to dedicate separate regions of memory for the shared pool
components, the shared pool is usually the second-largest SGA memory area (depending
on the size of the db_cache_size parameter). The shared pool contains RAM memory
regions that serve the following purposes:
Library cache The library cache contains the current SQL execution plan
information. It also holds stored procedures and trigger code.
Dictionary cache - The dictionary cache stores environmental information, which
includes referential integrity, table definitions, indexing information, and other
metadata stored within Oracle's internal tables.
Session information Systems that use SQL*Net version 2 with a multi-threaded
server need this area to store session information. Beginning with Oracle, the
v$session view contains information related to Oracle*Net users.
The following table lists the different areas stored in the shared pool and their purpose:
* Shared SQL Area - The shared SQL area stores each SQL statement executed in the
database. This area allows SQL execution plans to be reused by many users.
* Private SQL Area - Private SQL areas are non-shared memory areas assigned to
unique user sessions.
* PL/SQL Area - Used to hold parsed and compiled PL/SQL program units, allowing
the execution plans to be shared by many users.
* Control Structures - Common control structure information, for example, lock
information

The Redo Log Buffer


The redo log buffer is a RAM area (defined by the initialization parameter log_buffer)
that works to save changes to data, in case something fails and Oracle has to put it back
into its original state (a rollback). When Oracle SQL updates a table (a process called
Data Manipulation Language, or DML), redo images are created and stored in the redo
log buffer. Since RAM is faster than disk, this makes the storage of redo very fast
The Oracle redo log buffer provides the following functions within the Oracle SGA:

Serves for assistance with database recovery tasks


Records all changes made to database blocks
Places changes recorded to redo entries for redo logs

The database initialization parameter log_buffer defines the default size of the redo log
buffer within Oracle 11g.

Oracle will eventually flush the redo log buffer to disk. This can happen in a number of
special cases, but whats really important is that Oracle guarantees that the redo log buffer
will be flushed to disk after a commit operation occurs. When you make changes in the
database you must commit them to make them permanent and visible to other users

Oracle commit Processing


A commit is a very important Oracle concept. As users make changes in Oracle, those
changes are only visible to the user session making the change and are unrecoverable in
the case of a crash. A commit changes all that. When the user tells Oracle to commit the
change, Oracle makes the change visible to everyone, and ensures that the change is
recoverable.
Since RAM is wiped out if you lose power to the computer, all the redo data in the redo
buffer would be lost in a power outage. To protect against this problem, a commit asks
Oracle to save the redo to disk, which is permanent. The redo log disk files are called
online redo logs.

Oracle PGA Concepts


Not all RAM in Oracle is shared memory. When you start a user process, that process has
a private RAM area, used for sorting SQL results and managing special joins called
hash joins. This private RAM is known as the Program Global Area (PGA). Each
individual PGA memory area is allocated each time a new user connects to the database.

You might also like