2.Memory Architecture
2.Memory Architecture
When an instance is started, Oracle Database allocates a memory area and starts
background processes.
The memory area stores information such as the following:
Program code
Information about each connected session, even if it is not currently active
Information needed during program execution, for example, the current state of a
query from which rows are being fetched
Information such as lock data that is shared and communicated among processes
Cached data, such as data blocks and redo records, that also exists on disk
--------------------------------------------------------------------
The basic memory structures associated with Oracle Database include:
--------------------------------------------------------------------
The SGA is a group of shared memory structures, known as SGA components, that
contain data and control information for one Oracle Database instance.
All server processes and background processes share the SGA. Examples of data
stored in the SGA include cached data blocks and shared SQL areas.
A PGA is a nonshared memory region that contains data and control information
exclusively for use by an Oracle process.
Oracle Database creates the PGA when an Oracle process starts.
One PGA exists for each server process and background process. The collection of
individual PGAs is the total instance PGA, or instance PGA. Database initialization
parameters set the size of the instance PGA, not individual PGAs.
Software code areas are portions of memory used to store code that is being run or
can be run. Oracle Database code is stored in a software area that is typically at
a different location from user programs�a more exclusive or protected location.
--------------------------------
Overview of the User Global Area
--------------------------------
The UGA is session memory, which is memory allocated for session variables, such as
logon information, and other information required by a database session.
Essentially, the UGA stores the session state.
The UGA must be available to a database session for the life of the session. For
this reason, the UGA cannot be stored in the PGA when using a shared server
connection because the PGA is specific to a single process. Therefore, the UGA is
stored in the SGA when using shared server connections, enabling any shared server
process access to it. When using a dedicated server connection, the UGA is stored
in the PGA.
-----------------------------------------
Overview of the Program Global Area (PGA)
-----------------------------------------
The PGA is memory specific to an operating process or thread that is not shared by
other processes or threads on the system. Because the PGA is process-specific, it
is never allocated in the SGA.
References:
https://docs.oracle.com/database/121/CNCPT/memory.htm#CNCPT1237