Oracle Database 10G - Automatic Sga Memory Management
Oracle Database 10G - Automatic Sga Memory Management
Introduction........................................................................................... 3
Current Challenges ............................................................................... 3
Introducing Automatic Shared Memory Management ......................... 4
The SGA_TARGET Parameter ........................................................ 4
Automatically Managed SGA Components...................................... 4
Manually Sized SGA Components ................................................... 7
Benefits ................................................................................................. 8
More Flexible and Adaptive Memory Utilization ............................ 8
Enhanced Performance ..................................................................... 9
Ease of Use ....................................................................................... 9
Enabling Automatic Shared Memory Management ............................. 9
Dynamic Modification of SGA Parameters........................................ 11
Dynamic Modification of SGA_TARGET..................................... 11
Dynamic Modification of Parameters for Automatically Managed
Components .................................................................................... 12
Modification of Parameters for Manually Sized Components ....... 13
Persistence of Auto Tuned Values...................................................... 13
Conclusions......................................................................................... 13
INTRODUCTION
One of the key self-management enhancements in the Oracle Database 10g is
Automatic Shared (SGA) Memory Management. This functionality automates
the management of shared memory used by an Oracle Database 10g instance
and liberates administrators from having to manually configure the sizes of
shared memory components. Besides making more effective use of available
memory and thereby reducing the cost incurred of acquiring additional hardware
memory resources, the Automatic Shared Memory Management feature will
significantly simply Oracle database administration by introducing a more
dynamic, flexible and adaptive memory management scheme.
This paper introduces this functionality and illustrates its advantages.
CURRENT CHALLENGES
The Shared Global Area (SGA) in Oracle comprises multiple memory
components -- a component being a pool of memory used to satisfy a particular
class of memory allocation requests. Examples of memory components include
the shared pool (used for allocating memory for SQL and PL/SQL execution),
java pool (used for java objects and other java execution memory), buffer cache
(used for caching disk blocks), etc.
In past releases, the Oracle administrator was required to manually set a number
of parameters for specifying different SGA component sizes, such as
SHARED_POOL_SIZE, DB_CACHE_SIZE, LARGE_POOL_SIZE, and
JAVA_POOL_SIZE.
The task of manually adjusting the sizes of individual SGA components could
pose a few challenges. It may not be easy to determine the optimal sizes of these
components suitable for a given workload. Oracle9i alleviated this problem to a
great extent by introducing advisory mechanisms that allow DBAs to determine
the optimal sizes of the buffer cache and shared pool. However, these
recommendations still had to be implemented by the administrator. This
challenge is further compounded in situations in which the workload tends to
vary with the time of the day e.g online users during the day and batch jobs at
night. Sizing for peak load could mean memory wastage while under-sizing may
BENEFITS
Ease of Use
Having just a single parameter to deal with greatly simplifies the job of
administrators. DBAs can now just specify the amount of SGA memory an
instance has its disposal and forget about the rest. They do not need to figure out
the sizes of individual components any more. In addition, they can be assured of
the fact that no out of memory errors will be generated unless the system has
truly run out of memory.
While enabling the Automatic Shared Memory Management feature using EM,
the appropriate value for SGA_TARGET is automatically calculated according
to the formula described above. In addition, EM also unsets all the parameters
specifying the size of individual components in order to maximize the benefit of
automatic management.
If using command line interface, the steps involved in enabling Automatic
Shared Memory Management are as follows:
• Dynamically set SGA_TARGET to the current SGA size. The current
size of the SGA can be determined from the fixed-view V$SGA via the
following query:
select sum(value) from v$sga;
• Next dynamically set each of the auto-tuned component sizes to zero
so that the automatic shared memory tuning algorithm can modify the
sizes as needed.
If the above query for example returns the result of 536870912 (or 512M) then
the steps for enabling auto SGA are as follows:
alter system set sga_target=512M;
alter system set db_cache_size = 0;
CONCLUSIONS
Memory is a precious system resource and administrators currently spend a
significant amount of their time optimizing its use. With Automatic Shared
Memory Management, they are relieved of this time consuming and often
tedious exercise. The flexibility and adaptiveness of this solution will ensure the
best possible utilization of existing resources and thereby help organizations
reduce capital expenditure. Just another example of how the Oracle Database
10g is going to let administrators play more strategic roles and allow businesses
to become more profitable!
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Worldwide Inquiries:
Phone: +1.650.506.7000
Fax: +1.650.506.7200
www.oracle.com