Instance Architecture   «Prev  Next»

Lesson 5 The System Global Area (SGA)
Objective Identify purpose and major components of System Global Area.

System Global Area (SGA): Purpose and Core Components

Oracle System Global Area showing Database Buffer Cache, Redo Log Buffer, and Shared Pool
Core SGA components: (1) Database Buffer Cache for cached data blocks, (2) Redo Log Buffer for change vectors awaiting LGWR flush, and (3) Shared Pool for parsed SQL/PLSQL and dictionary data.

The System Global Area (SGA) is the shared memory for an Oracle instance. Every server and background process reads from and writes to the SGA to coordinate work, cache hot data, and reduce I/O. Getting SGA design right yields fewer physical reads, faster commits, and predictable latency under load.

What lives in the SGA

Why the SGA matters

Sizing strategies (modern parameters)

Result caching: when it helps

SQL Query Result Cache can store results of deterministic, frequently repeated queries in the SGA so subsequent executions avoid both logical and physical I/O. Oracle invalidates cached results on relevant DML, so use it for relatively stable reference data, lookups, and dashboard aggregates.

-- Session-level preference (optional)
ALTER SESSION SET result_cache_mode = MANUAL;  -- or FORCE

-- Example: cache a stable aggregate
SELECT /*+ RESULT_CACHE */ deptno, COUNT(*) AS cnt
FROM   emp
GROUP  BY deptno;

-- Quick visibility into memory usage (views may vary by version)
SELECT name, bytes FROM v$result_cache_memory_info;

Practical checklist

  1. Size SGA_TARGET with headroom; watch buffer cache hit ratio and parse stats rather than chasing a single “magic” number.
  2. Pin truly critical packages and consider a Keep pool for small, hot tables and their indexes.
  3. Use Result Cache selectively on predictable, read-mostly queries; verify correctness under DML and session settings.
  4. Re-baseline after major workload changes; memory that’s perfect today can be wrong tomorrow.

SEMrush Software 5 SEMrush Banner 5