Oracle10g now has Automatic Memory Management (AMM) in the form of the one-size-fits-all parameter called sga_target, which replaces many individual parameters and automates the allocation of RAM between the data buffers, shared pool, and log buffers.
Using predictive models derived from v$db_cache_advice and v$shared_pool_advice, Oracle10g automatically monitors changing demands on the SGA regions and re-allocates RAM memory based on the existing workload.
When using AMM, we only have three instance parameters:
- sga_max_size : This parameter sets the hard limit up to which sga_target can dynamically adjust sizes. Usually, sga_max_size and sga_target will be the same value, but there may be times when you want to have the capability to adjust for peak loads. By setting this parameter higher than sga_target, you allow dynamic adjustment of the sga_target parameter.
- sga_target : This parameter is new in Oracle10g and reflects the total size of memory footprint a SGA can consume. It includes in its boundaries the fixed SGA and other internal allocations, the (redo) log buffers, the shared pool, Java pool, streams pool, buffer cache, keep/recycle caches, and if they are specified, the non-standard block size caches.
- pga_aggregate_target : This parameter defines the RAM area reserved for system-wide sorting and hash joins.
Using the sga_target initialization parameter configures automatic Shared Memory Management. If you specify a non-zero value for sga_target, the following four memory pools are automatically sized:
- Database Buffer cache (The Default pool)
- Shared pool
- Large pool
- Java pool
If you set sga_target to 0, the Automatic Shared Memory Management is disabled. The default value of sga_target is 0. When sga_target is not set, or equal to zero, auto-tuned SGA parameters behave as in previous releases of the Oracle database.
In 10g, the initialization parameters such as db_cache_size, shared_pool_size, large_pool_size, and java_pool_size are referred to as "autotuned sga" parameters.
Configuration of the following buffers still remains manual and they are now referred to as manually sized components:
- Log Buffer
- Other Buffer Caches (KEEP/RECYCLE, other block sizes)
- Streams Pool (new in Oracle Database 10g)
- Fixed SGA and other internal allocations
The user specifies manual SGA parameters, and parameter sizes precisely control the sizes of their corresponding components. When sga_target is set, the total size of manual SGA parameters are subtracted from the sga_target value, and the balance is given to the auto-tuned SGA components.
sga_target is also a dynamic parameter and can be changed through Enterprise Manager or with the ALTER SYSTEM command. However, the sga_target can be increased only up to the value of sga_max_size.
Are you wondering how this auto management is possible? A new background process named Memory Manager (MMAN) manages the automatic shared memory. MMAN serves as the SGA Memory Broker and coordinates the sizing of the memory components. The SGA Memory Broker keeps track of the sizes of the components and pending resize operations.