How to configure an Oracle database for optimal memory management (AMM/ASMM)
Selecting AMM can realize fully automatic memory management of SGA and PGA, which is suitable for environments that support this function; selecting ASMM is more suitable when fine control of PGA or using HugePages is required, and only the internal components of SGA are automatically managed.

Configuring an Oracle database for optimal memory management involves choosing between Automatic Memory Management (AMM) and Automatic Shared Memory Management (ASMM), then setting the appropriate initialization parameters. The right choice depends on your system environment, performance goals, and whether you're using Oracle Managed Files, container databases, or running on platforms like Linux with large memory capacity.
Understand AMM vs ASMM
Automatic Memory Management (AMM) allows Oracle to automatically manage both the SGA (System Global Area) and PGA (Program Global Area) from a single memory pool defined by MEMORY_TARGET . This simplifies tuning because Oracle dynamically redistributes memory between SGA and PGA as needed.
Automatic Shared Memory Management (ASMM) , in contrast, only automates the distribution within the SGA (eg, shared pool, buffer cache). You must manually manage PGA usage via PGA_AGGREGATE_TARGET . ASMM uses SGA_TARGET to allow dynamic resizing of SGA components while keeping total SGA size under control.
Use AMM if you want full automation and are not on an environment that restricts its use (eg, some versions of Exadata or specific OS configurations). Use ASMM when you need more control over PGA or are on platforms where AMM is not supported (such as Linux with HugePages enabled, which typically requires fixed SGA sizing).
Enable Automatic Memory Management (AMM)
To configure AMM:
- Set MEMORY_TARGET to the total amount of memory Oracle can use for SGA and PGA combined. For example:
ALTER SYSTEM SET MEMORY_TARGET = 4G SCOPE=SPFILE; - Optionally set MEMORY_MAX_TARGET if you want to define the maximum possible value for MEMORY_TARGET without restarting the instance:
ALTER SYSTEM SET MEMORY_MAX_TARGET = 4G SCOPE=SPFILE; - Ensure SGA_TARGET and PGA_AGGREGATE_TARGET are either unset or automatically derived — Oracle will manage them internally.
- Restart the database for changes to take effect.
After enabling, monitor memory distribution using views like V$MEMORY_DYNAMIC_COMPONENTS and V$PGASTAT to confirm Oracle is balancing memory effectively.
Enable Automatic Shared Memory Management (ASMM)
If you prefer to keep manual control over PGA or cannot use AMM (eg, due to HugePages requirements):
- Set SGA_TARGET to enable dynamic sizing of SGA components:
ALTER SYSTEM SET SGA_TARGET = 3G SCOPE=SPFILE; - Manually set PGA_AGGREGATE_TARGET based on workload:
ALTER SYSTEM SET PGA_AGGREGATE_TARGET = 1G SCOPE=BOTH; - Leave MEMORY_TARGET and MEMORY_MAX_TARGET unset to disable AMM.
- Adjust individual SGA pools (like DB_CACHE_SIZE , SHARED_POOL_SIZE ) only if necessary — otherwise, let Oracle handle internal distribution.
Monitor SGA component sizes using V$SGA_DYNAMIC_FREE_MEMORY and V$SGA_RESIZE_OPS to ensure smooth resizing operations.
Best Practices and Monitoring
Regardless of the method chosen:
- Avoid mixing AMM and manual memory parameters. Setting MEMORY_TARGET disables manual SGA/PGA tuning.
- On systems using HugePages (common in Linux for performance), AMM is not recommended because it uses regular memory pages. In such cases, use ASMM with fixed SGA size.
- Size MEMORY_TARGET or SGA_TARGET PGA_AGGREGATE_TARGET to about 60–80% of total physical RAM, leaving room for OS and other processes.
- Use AWR reports and V$MEMORY_USAGE to analyze memory pressure and adjust settings accordingly.
- Test configuration changes in non-production environments first.
Proper memory configuration reduces parsing overhead, improves cache hit ratios, and minimizes disk I/O. Tune incrementally and validate performance impacts after each change.
Basically, choose AMM for simplicity and full automation when supported, or ASMM for finer control — especially in high-performance or specialized environments.
The above is the detailed content of How to configure an Oracle database for optimal memory management (AMM/ASMM). For more information, please follow other related articles on the PHP Chinese website!
Hot AI Tools
Undress AI Tool
Undress images for free
AI Clothes Remover
Online AI tool for removing clothes from photos.
Undresser.AI Undress
AI-powered app for creating realistic nude photos
ArtGPT
AI image generator for creative art from text prompts.
Stock Market GPT
AI powered investment research for smarter decisions
Hot Article
Popular tool
Notepad++7.3.1
Easy-to-use and free code editor
SublimeText3 Chinese version
Chinese version, very easy to use
Zend Studio 13.0.1
Powerful PHP integrated development environment
Dreamweaver CS6
Visual web development tools
SublimeText3 Mac version
God-level code editing software (SublimeText3)
Hot Topics
20522
7
13634
4
How to manage Flashback Data Archive_Flashback Data Archive table space allocation
Mar 28, 2026 pm 04:06 PM
The reason why the FlashbackDataArchive table space is full is that the hidden history table (SYS_FBA_HIST_XXXXXX) occupies the table space where the main table is located and does not go through ASSM cleaning; you need to use ALTERFLASHBACKARCHIVE...MODIFYTABLESPACE to migrate to the local management automatic segment space table space, and manually clean up the orphan history table.
How to use Oracle APEX to build a low-code app? (Rapid Development)
Mar 13, 2026 am 12:48 AM
OracleAPEXislow-glue,notno-code:itskipsinfrastructurebutrequiresSQL,PL/SQL,anddeclarativelogic;ApplicationProcesseshandleserver-sidevalidationandsideeffects,DynamicActionsmanageclient-sideinteractivity;InteractiveGridneedskey-preservedsourcesforediti
How to troubleshoot the Oracle Listener startup? (Network Services)
Mar 10, 2026 am 12:58 AM
Oraclelistenerstartupfailuresstemfromsilentlistener.oraparsingerrors,hostnameresolutionissues,orpermissionproblems—notbinariesorports;validatesyntaxwithreload,checkownership,verifyactualconfigpath,testDNS,useexplicitIPs,confirmADR_BASE,enabletracingp
How to implement Transparent Data Encryption (TDE) in Oracle? (Data Security)
Mar 13, 2026 am 12:14 AM
OracleTDE must first enable and open the encrypted wallet (Wallet), otherwise ORA-28365 will be reported when executing ALTERTABLESPACE...ENCRYPTION; Wallet needs to be created, opened and managed through the ADMINISTERKEYMANAGEMENT command, and the path must be explicitly configured in sqlnet.ora and permissions must be ensured.
How to patch Oracle Grid Infrastructure? (System Maintenance)
Mar 10, 2026 am 01:00 AM
Three things must be confirmed before applying the GI patch: 1. The opatchlsinventory-detail output of each node is consistent; 2. OCR and VoteDisk are online and crsctlcheckcluster-all and ocrcheck both return SUCCESS; 3. $GRID_HOME/crs/install/rootcrs.sh-prepatch has been successfully executed.
How to grant flashback permission_GRANT FLASHBACK ON and FLASHBACK ANY TABLE
Apr 03, 2026 pm 11:54 PM
FLASHBACK permissions must be explicitly granted: GRANTFLASHBACKONschema.tableTOuser for a single table, and GRANTFLASHBACKANYTABLETOuser for all tables; basic permissions such as SELECT and ALTER and row movement enablement are also required.
How to grant SYSDBA permissions_sysdba management of password files and OS authentication
Apr 03, 2026 am 08:54 AM
Ordinary users can be authorized through GRANTSYSDBATOusername; provided that the database enables password file authentication (REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE) and has logged in with SYS; there is no need to restart after authorization, but the connection needs to explicitly specify assysdba, and the user credentials must exist in the V$PWFILE_USERS view.
How to call function _PRAGMA AUTONOMOUS_TRANSACTION with DML unbinding
Mar 17, 2026 pm 11:27 PM
The ORA-06519 error is caused by the autonomous transaction not being explicitly committed or rolled back: When calling a function containing PRAGMAAUTONOMOUS_TRANSACTION, if DML (such as INSERT/UPDATE) is executed, the transaction must be ended with COMMIT or ROLLBACK before each exit, otherwise an error will be reported; the autonomous transaction is completely isolated from the main transaction, and the data after COMMIT is not visible to the main transaction and cannot be rolled back by it.





