Oracle Instance PGA & UGA
Program Global Area (PGA)
The Program Global Area (PGA) is a non-shared memory region that contains data and control information exclusively for use by server and background processes.
Oracle Database creates server processes to handle connections to the database on behalf of client programs. In a dedicated server environment, one PGA gets created for each server and background process that is started. Each PGA consists of stack space, hash area, bitmap merge area and a User Global Area (UGA). A PGA is de-allocated when the associated server or background process using it is terminated.
In a shared server environment, multiple client users share the server process. The UGA is moved into the large pool, leaving the PGA with only stack space, hash area, and bitmap merge area.
In a dedicated server session, the PGA consists of the following components:
SQL work areas:
The sort area is used by functions that order data, such as ORDER BY and GROUP BY.
Session memory:
This user session data storage area is allocated for session variables, such as logon information, and other information required by a database session. The OLAP pool manages OLAP data pages, which are equivalent to data blocks.
Private SQL area:
This area holds information about a parsed SQL statement and other session-specific information for processing. When a server process executes SQL or PL/SQL code, the process uses the private SQL area to store bind variable values, query execution state information, and query execution work areas.
Stack space:
Stack space is memory allocated to hold session variables and arrays.
Hash area:
This area is used to perform hash joins of tables.
Bitmap merge area:
This area is used to merge data retrieved from scans of multiple bitmap indexes.
User Global Area (UGA)
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 OLAP page pool is also stored in the UGA. This pool manages OLAP data pages, which are equivalent to data blocks. The page pool is allocated at the start of an OLAP session and released at the end of the session.
The UGA must be available to a database session for the life of the session.
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.
Comments
Post a Comment