AMM (Automatic Memory Management)自动内存管理 , 它是通过设置MEMORY_TARGET和MEMORY_MAX_TARGET控制的,使用在Oracle 11g release。
ASMM(Automatic shared Memory Management)自动共享内存管理,它是通过设置SGA_TARGET不为0,同时需要参数STATISTICS_LEVEL为TYPICAL 或ALL 实现,使用在oracle 10g中。
通过实验简单的学习一下oracle的AMM和ASMM之间特征以及它们之间相互切换的方式
一、oracle 采用 ASMM 形式显著特征就是SGA_TARGET和PGA_AGGREGATE_TARGET不为0 ,而MEMORY_TARGET和MEMORY_MAX_TARGET 为0
[oracle@mhxy171 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Aug 29 10:12:56 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter target
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
archive_lag_target integer 0
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
parallel_servers_target integer 32
pga_aggregate_target big integer 383M
sga_target big integer 1152M
通过改变一下静态参数的值,把oracle DB 把ASMM修改为AMM,修改之前备份下spfile文件。重启DB实例,查看参数memory_max_target和memory_target 不为0,表示已经启动AMM
点击(此处)折叠或打开
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
spfile string /oracle/database/product/11.2.
0.4.0/db_1/dbs/spfileyzxd.ora
SQL> create pfile from spfile;
File created.
SQL> alter system set memory_max_target=1535m scope=spfile;
System altered.
SQL>alter system set memory_target=1535m scope=spfile;
System altered.
SQL> alter system set sga_target=0m scope=spfile;
System altered.
SQL> alter system set pga_aggregate_target=0m scope=spfile;
System altered.
SQL> alter system set sga_max_size=0m scope=spfile;
System altered.
SQL> startup force
ORACLE instance started.
Total System Global Area 1202614272 bytes
Fixed Size 2261248 bytes
Variable Size 360713984 bytes
Database Buffers 834666496 bytes
Redo Buffers 4972544 bytes
Database mounted.
Database opened.
SQL> show parameter target
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
archive_lag_target integer 0
db_flashback_retention_target integer 1440
fast_start_io_target integer 0
fast_start_mttr_target integer 0
memory_max_target big integer 1536M
memory_target big integer 1536M
parallel_servers_target integer 32
pga_aggregate_target big integer 0
sga_target big integer 0