Вы находитесь на странице: 1из 7

Automatic Memory Management(AMM) on 11g [ID 443746.

1] Modified 10-NOV-2010 In this Document Purpose Scope and Application Automatic Memory Management(AMM) on 11g Introduction to Database Memory Components Evolution of Memory Management Features 1.Automatic Memory Management For Both the SGA and Instance PGA 2. Automatic Shared Memory Management For the SGA 3. Manual Shared Memory Management For the SGA 4. Automatic PGA Memory Management For the Instance PGA 5.Manual PGA Memory Management For the Instance PGA References Type BULLETIN

Applies to:
Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.1.0.8 - Release: 11.1 to 11.1 Information in this document applies to any platform. Oracle Server Enterprise Edition - Version: 11.1.0.6 to 11.1.0.8

Purpose
Checked for relevance 11-10-2010 The main goal of this document is to discuss Automatic Memory Management(AMM) features introduced with Oracle11g and

Scope and Application


All the DBAs and users concerned with Database Administration activities.

Automatic Memory Management(AMM) on 11g


Rate this document

Introduction to Database Memory Components


The basic memory structures associated with Oracle Database include: System Global Area (SGA)

The SGA is a group of shared memory structures, known as SGA components, that contain data and control information for o Program Global Area (PGA)

A PGA is a memory region that contains data and control information for a server process. It is nonshared memory each server process. Background processes also allocate their own PGAs. The total PGA memory allocated for all backgroun collection of all individual PGAs is referred to as the total instance PGA, or just instance PGA.

It contains global variables and data structures and control information for a server process. example of such information is th

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=443746.1

region of the server process executing that cursor.

The performance of complex long running queries, typical in a DSS environment, depend to a large extent on the memory ava Below figure illustrates the relationships among these memory structures.

Evolution of Memory Management Features


Memory management has evolved with each database release Oracle 9i

Beginning with Oracle9i, the dynamic SGA infrastructure allowed for the sizing of the Buffer Cache, Shared Pool and the Larg Dynamic Memory resizing DB_CACHE_SIZE instead of DB_BLOCK_BUFFERS DB_nK_CACHE_SIZE for multiple block sizes PGA_AGGREGATE_TARGET Introduction of Automatic PGA Memory management

Oracle Database 10g

Automatic Shared Memory Management (ASMM) was introduced in 10g. You enable the automatic shared memory managem Oracle Database 11g

Automatic Memory Management is being introduced in 11g. This enables automatic tuning of PGA and SGA with use of two n The most important SGA components are the following:
Component Database Buffer Cache Description

The database buffer cache is the portion of from datafiles. All users concurrently connec database buffer cache.

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=443746.1

Redo Log Buffer

The redo log buffer is a circular buffer in the made to the database. This information is st information necessary to reconstruct, or red UPDATE, DELETE, CREATE, ALTER, or D database recovery, if necessary.

Shared Pool

The shared pool portion of the SGA contains result cache, buffers for parallel execution m

Large Pool Java Pool Streams Pool

Used for allocating session memory for shar or for RMAN.

Java pool memory is used in server memory within the JVM.

The streams pool is used exclusively by Ora queue messages, and it provides memory fo processes.

* RESULT_CACHE_MAX_SIZE is new component which has been introduced as part of 11g Memory architecture. The res infrastructure.Results of queries and query fragments can be cached in memory in the SQL query result cache. The databa Result can also be cached. You have to use RESULT_CACHE_MODE initialization parameter which determines the SQL query result cache behavior.

Oracle Database 11g supports various memory management methods, which are chosen by initialization parameter 1. 2. 3. 4. 5. Automatic Memory Management For Both the SGA and Instance PGA Automatic Shared Memory Management For the SGA Manual Shared Memory Management For the SGA Automatic PGA Memory Management For the Instance PGA Manual PGA Memory Management For the Instance PGA

1.Automatic Memory Management For Both the SGA and Instance PGA

Beginning with Oracle Database 11g, Oracle Database can manage the SGA memory and instance PGA memory completely exchanges memory between the SGA and the instance PGA as needed to meet processing demands. This capability is sizes of the individual SGA components and the sizes of the individual PGAs. To achieve this, two new parameters have been introduced named MEMORY_MAX_TARGET and MEMORY_TARGET maximum memory size initialization parameter (MEMORY_MAX_TARGET).

If you create your database with Database Configuration Assistant (DBCA) and choose the basic installation option, automa you to select automatic memory management.

Switching to Automatic Memory Management 1)Check the current values configured for SGA_TARGET and PGA_AGGREGATE_TARGET.
SQL>SHOW PARAMETER TARGET NAME TYPE VALUE ------------------------------ ----------- ---------------archive_lag_target integer 0

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=443746.1

db_flashback_retention_target integer 1440 fast_start_io_target integer 0 fast_start_mttr_target integer 0 memory_max_target big integer 0 memory_target big integer 0 pga_aggregate_target big integer 200M sga_target big integer 500M

Add the values of pga_aggregate_target and sga_target. In our case it would sum to 700 M

2)Decide on a maximum amount of memory that you would want to allocate to the database which will determine the maximu 3)Change the parameter in initialization parameter file. Using Spfile ========
SQL>ALTER SQL>ALTER SQL>ALTER SQL>ALTER SYSTEM SYSTEM SYSTEM SYSTEM SET SET SET SET MEMORY_MAX_TARGET = 808M SCOPE = SPFILE; MEMORY_TARGET = 808M SCOPE = SPFILE; SGA_TARGET =0 SCOPE = SPFILE; PGA_AGGREGATE_TARGET = 0 SCOPE = SPFILE;

Using Pfile ======= If you have started the instance with Pfile, then edit the pfile and set the parameters manually

MEMORY_MAX_TARGET = 808M MEMORY_TARGET = 808M SGA_TARGET =0 PGA_AGGREGATE_TARGET = 0

In case you do not specify any value for MEMORY_MAX_TARGET and only use MEMORY_TARGET then database

If you omit the line for MEMORY_TARGET and include a value for MEMORY_MAX_TARGET, the MEMORY_TARGET param does not exceed the value of MEMORY_MAX_TARGET.

MEMORY_MAX_TARGET is a static parameter i.e it cannot be changed Dynamically and Instance has to be bounced for m 4)Shutdown and startup the database
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 845348864 Fixed Size 1303188 Variable Size 469765484 Database Buffers 369098752 Redo Buffers 5181440 SQL> show parameter target bytes bytes bytes bytes bytes

NAME TYPE VALUE ------------------------------------ ----------- ------------------------------

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=443746.1

archive_lag_target db_flashback_retention_target fast_start_io_target fast_start_mttr_target memory_max_target memory_target pga_aggregate_target sga_target

integer integer integer integer big integer big integer big integer big integer

0 1440 0 0 808M 808M 0 0

The preceding steps instruct you to set SGA_TARGET and PGA_AGGREGATE_TARGET to zero so that the sizes of the SG parameter values to zero and leave either or both of the values as positive numbers. In this case, the values act as minimum

Note : - In case you set any parameter value to value which is higher then MEMORY_TARGET, then you get the following e SQL> startup ORA-00844: Parameter not taking MEMORY_TARGET into account, see alert log for more information 00844, 00000, "Parameter not taking MEMORY_TARGET into account, see alert log for more information" // *Cause: The parameter was larger than MEMORY_TARGET. // *Action: Set the parameter to a lower value than MEMORY_TARGET. Monitoring and Tuning Automatic Memory Management The dynamic performance view V$MEMORY_DYNAMIC_COMPONENTS shows the current sizes of all dynamically tuned The view V$MEMORY_TARGET_ADVICE provides tuning advice for the MEMORY_TARGET initialization parameter.
SQL> select * from v$memory_target_advice order by memory_size;

You can also use V$MEMORY_RESIZE_OPS which has a circular history buffer of the last 800 SGA resize requests.

2. Automatic Shared Memory Management For the SGA

If you want to exercise more direct control over the size of the SGA, you can disable automatic memory management and ena When automatic SGA memory management is enabled, the sizes of the different SGA components are flexible and can adapt Please refer to following document for setting SGA_TARGET Note 295626.1 - How To Use Automatic Shared Memory Management (ASMM) In Oracle10g

In case you have enabled Automatic Memory Management , then to switch to Automatic Shared Memory Management , pleas
SQL>Alter system set MEMORY_TARGET=0 scope=both; SQL>Alter system set SGA_TARGET=500M scope=both;

3. Manual Shared Memory Management For the SGA


If you want complete control of individual SGA component sizes, you can disable both automatic memory management determining the overall SGA size. You then manually tune these individual SGA components on an ongoing basis.

In this case you set SGA_TARGET and MEMORY_TARGET to 0 and set value for other SGA components upto value of SGA

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=443746.1

Please refer to Note 148495.1 - Dynamic SGA

4. Automatic PGA Memory Management For the Instance PGA


While using Automatic memory management , PGA memory is allocated based upon value of MEMORY_TARGET. PGA memory management. Automatic/Manual PGA memory management is decided by initialization parameter WORKAREA_SIZE_POLICY

With automatic PGA memory management, you set a target size for the instance PGA by defining value for parameter named ignored for these sessions. This feature is available from 9i. At any given time, the total amount of PGA memory available to active work areas on the instance is automatically PGA memory allocated for other purposes (for example, session memory). The resulting PGA memory is then allotted to Please refer to following document for more details on Automatic PGA Memory Management Note 223730.1 - Automatic PGA Memory Managment in 9i and 10g

5.Manual PGA Memory Management For the Instance PGA


In case you wish to manually specify the maximum work area size for each type of SQL operator (such as sort or hash

Set WORKAREA_SIZE_POLICY value to MANUAL and also specify values for *_area_size such as SORT_AREA_SIZE, HA

Although the Oracle Database 11g supports this manual PGA memory management method, Oracle strongly recommends th Table below summarizes the various memory management methods
Memory Management Mode Automatic memory management(AMM) SGA and PGA For

Automatic shared memory management(ASMM) (AMM disabled) Manual shared memory management (AMM and ASMM disabled) SGA SGA

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=443746.1

Automatic PGA memory management PGA Manual PGA memory management (not recommended) PGA

The Automatic Memory Management (AMM) feature uses background process named Memory Manager (MMAN) serves as the SGA Memory Broker and coordinates the sizing of the memory components. The SGA Memory Broker keeps tr

References
NOTE:148495.1 - Dynamic SGA NOTE:223730.1 - Automatic PGA Memory Management NOTE:295626.1 - How To Use Automatic Shared Memory Management (ASMM) In Oracle10g

Attachments Oracle Database Memory Structures (14.16 KB)

Related

Products Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition Keywords

DYNAMIC SGA; SGA_MAX_SIZE; SHARED_POOL_SIZE; INITIALIZATION PARAMETERS; DB_CACHE_SIZE; SHAR Errors ORA-844

Back to top

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=443746.1

Вам также может понравиться