Oracle SGA vs PGA Memory: The Difference, Explained
The SGA is shared memory every process in the instance can see; the PGA is private memory for one session alone. Here's what each one actually holds, and how they're sized.
Shared memory vs private memory
The SGA (System Global Area) is a chunk of shared memory allocated once when the Oracle instance starts, used by every background and server process. The PGA (Program/Process Global Area) is private memory allocated separately for each individual server process — one session's PGA content is invisible to every other session.
SGA vs PGA at a glance
| SGA | PGA | |
|---|---|---|
| Shared or private? | shared across the whole instance | private to a single server process |
| Allocated | once, at instance startup | per session/process, as needed |
| Main contents | buffer cache, shared pool (library cache + dictionary cache), redo log buffer | sort areas, hash join work areas, cursor state, session variables |
| Sized via | SGA_TARGET / SGA_MAX_SIZE (or MEMORY_TARGET for combined auto-tuning) | PGA_AGGREGATE_TARGET |
What's inside the SGA
Database buffer cache holds copies of data blocks read from disk, so repeated reads of the same block don't hit storage again. Shared pool holds parsed SQL and PL/SQL (the library cache — so identical statements can skip re-parsing) and cached data dictionary metadata. Redo log buffer holds redo entries briefly before they're flushed to the online redo log files. Larger instances may also configure a large pool and Java pool for specific workloads.
What's inside the PGA
Each session's PGA holds the memory it needs to actually execute its own work: sort areas for ORDER BY/GROUP BY operations that don't fit entirely in the small default work area, hash areas for hash joins, and session-specific cursor and variable state. Because PGA is per-process, a single session doing a large sort can consume a meaningful chunk of PGA without affecting any other session's memory.