`
microjuz
  • 浏览: 31680 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Automatic Shared Memory Management(ASMM)

阅读更多
1.base:
  1) In Oracle 10g, you need to specify only the SGA_TARGET parameter, which specifies the total size of the SGA. Individual components of the SGA are automatically allocated by the database based on the workload and history information.

  2) The new parameter SGA_TARGET is the size of total SGA, which includes the automatically sized components, manually sized components, and any internal allocations during instance startup.

2.enabling and disabling ASSM
  1) ASMM is enabled when the STATISTICS_LEVEL parameter is set to TYPICAL or ALL and the SGA_TARGET parameter is set to a nonzero value. When enabled, ASMM distributes memory appropriately for the following memory areas: DB_CACHE_SIZE、SHARED_POOL_SIZE、LARGE_POOL_SIZE、JAVA_POOL_SIZE
  2) The following areas should be manually configured and are not affected by ASMM:LOG_BUFFER、DB_KEEP_CACHE_SIZE、DB_RECYCLE_CACHE_SIZE、DB_nK_CACHE_SIZE、STREAMS_POOL_SIZE、Fixed-SGA area and internal allocations
  3) The SGA_TARGET parameter is dynamic and can be resized using the ALTER SYSTEM statement.The value of SGA_TARGET cannot be higher than the SGA_MAX_SIZE parameter, which is not dynamically changeable. Reducing the size of SGA_TARGET affects only the autotuned components of the SGA. SGA_TARGET can be reduced until one of the autotuned components reaches its minimum size (a user-specified or Oracle-determined minimum).
  4)You can query the current sizes of the SGA components using the V$SGA_DYNAMIC_
COMPONENTS dictionary view, like so:
  SQL> select COMPONENT,CURRENT_SIZE,MIN_SIZE,MAX_SIZE from v$sga_dynamic_components;

COMPONENT                  CURRENT_SIZE   MIN_SIZE   MAX_SIZE
-------------------------- ------------ ---------- ----------
shared pool                    71303168   62914560          0
large pool                      4194304    4194304          0
java pool                       4194304    4194304          0
streams pool                          0          0          0
DEFAULT buffer cache          125829120  125829120          0
KEEP buffer cache                     0          0          0
RECYCLE buffer cache                  0          0          0
DEFAULT 2K buffer cache               0          0          0
DEFAULT 4K buffer cache               0          0          0
DEFAULT 8K buffer cache               0          0          0
DEFAULT 16K buffer cache              0          0          0
DEFAULT 32K buffer cache              0          0          0
ASM Buffer Cache                      0          0          0

13 rows selected

  5)When SGA_TARGET is set to a nonzero value, the autotuned SGA parameters will have default values of zero. If you specify a value for the autotuned SGA parameters,the value will be treated as the lower limit of that component.

  6)Resizing the autotuned SGA parameters is possible even if ASMM is enabled. For autotuned parameters, manual resizing will result in immediate component resizing if the current value is smaller than the new value. If the new value is smaller, the component is not resized, but a new minimum size is set.

  7)Setting SGA_TARGET to zero will disable ASMM. The autotuned components will have values of their current sizes, and these values are written to the SPFILE to use for the next instance startup.

 For manually configured SGA parameters, resizing will immediately take effect to the precise new value. If the size of a component is increased, one or more of the autotuned components will be reduced. If the size of a manually configured component is reduced, the memory that is released is given to the automatically sized components.

3.related views
  1)V$SGA_CURRENT_RESIZE_OPS: SGA resize operations that are currently in progress
  2)V$SGA_RESIZE_OPS :Information about the last 400 completed SGA resize  operations
  3)V$SGA_DYNAMIC_COMPONENTS :Information about the dynamic components of the SGA
  4)V$SGA_DYNAMIC_FREE_MEMORY:Information about the amount of SGA memory available for future dynamic SGA resize operations

4.The Memory Manager Process
1) Oracle 10g comes with the new MMAN process (which stands for memory manager) to manage the automatic shared memory. MMAN serves as the SGA memory broker and coordinates the sizing of the memory components. It keeps track of the sizes of the components and pending resize operations.
  2)The MMAN process observes the system and workload to determine the ideal distribution of memory. MMAN performs this check every few minutes so that memory can always be present where needed. When SPFILE is used, component sizes are used from the last shutdown.

5.示例

1)查询当前的设置

SQL> Select component,current_size,min_size,user_specified_size From v$sga_dynamic_components;

COMPONENT                 CURRENT_SIZE   MIN_SIZE USER_SPECIFIED_SIZE
------------------------- ------------ ---------- -------------------
shared pool                  113246208  109051904                   0
large pool                     4194304    4194304                   0
java pool                      4194304    4194304                   0
streams pool                         0          0                   0
DEFAULT buffer cache          41943040   37748736                   0
KEEP buffer cache                    0          0                   0
RECYCLE buffer cache                 0          0                   0
DEFAULT 2K buffer cache              0          0                   0
DEFAULT 4K buffer cache              0          0                   0
DEFAULT 8K buffer cache              0          0                   0
DEFAULT 16K buffer cache             0          0                   0
DEFAULT 32K buffer cache             0          0                   0
ASM Buffer Cache                     0          0                   0


SQL> select name,value from v$parameter where name in
('statistics_level','sga_target','db_cache_size','shared_pool_size','large_pool_size','java_pool_size','sga_max_size');

NAME               VALUE
------------------ -----------
sga_max_size       167772160
shared_pool_size   0
large_pool_size    0
java_pool_size     0
sga_target         171966464
db_cache_size      0
statistics_level   TYPICAL

7 rows selected

说明:

a.当前属于enable ASMM,sga_target=164M,其它参数均为0(USER_SPECIFIED_SIZE)

b.当前各个组件的大小从v$sga_dynamic_components中的current_size可以看出

2)disable assm

#取消assm

SQL> alter system set sga_target=0;

System altered

#查询视图,发现oracle根据之前的current_size自动设置了shared_pool_size、db_cache_size等几个参数。

SQL> Select component,current_size,min_size,user_specified_size From v$sga_dynamic_components;

COMPONENT                CURRENT_SIZE   MIN_SIZE USER_SPECIFIED_SIZE
------------------------ ------------ ---------- -------------------
shared pool                 113246208  109051904           113246208
large pool                    4194304    4194304             4194304
java pool                     4194304    4194304             4194304
streams pool                        0          0                   0
DEFAULT buffer cache         41943040   37748736            41943040
KEEP buffer cache                   0          0                   0
RECYCLE buffer cache                0          0                   0
DEFAULT 2K buffer cache             0          0                   0
DEFAULT 4K buffer cache             0          0                   0
DEFAULT 8K buffer cache             0          0                   0
DEFAULT 16K buffer cache            0          0                   0
DEFAULT 32K buffer cache            0          0                   0
ASM Buffer Cache                    0          0                   0

13 rows selected

SQL> select name,value from v$parameter
where name in ('statistics_level','sga_target','db_cache_size','shared_pool_size','large_pool_size','java_pool_size','sga_max_size');

NAME               VALUE   
------------------ ----------
sga_max_size       167772160
shared_pool_size   113246208
large_pool_size    4194304
java_pool_size     4194304
sga_target         0
db_cache_size      41943040
statistics_level   TYPICAL

7 rows selected

分享到:
评论

相关推荐

    Oracle Memory Management and HugePage

    Oracle发展这么多年,提供了多种的内存管理方式,从最早SGA、PGA手工管理,到9I版本出现的PGA的自动管理,到10G版本出现的SGA自动管理(ASMM),再到11G版本出现的memory自动管理(AMM),Oracle基本是在朝着智能化、...

    Oracle自动内存管理ASMM

    Oracle 自动内存管理 ASMM assm的内部特性值得一看

    深入了解oracle自动内存管理asmm

    ASMM有所了解,从使用的角度来说ASMM的出现极大地简化了Oracle内存初始化参数的设置,在ASMM的使 用上高级DBA和初学者不会有太大的差别;很多人因此而认为ASMM极大程度地减少了数据库对于专业DBA的 依赖:如果我们有...

    oracle 10g 性能优化与调整

    oracle 10g 性能优化与调整 oracle 10g 性能优化与调整 oracle 10g 性能优化与调整 oracle 10g 性能优化与调整

    visual studio 2022 语法高亮插件 asm-dude 汇编

    支持vs2022汇编语法高亮插件

    oracle10g课堂练习II(1)

    练习概览:使用 ASMM 纠正内存分配问题 8-38 9 自动性能管理 课程目标 9-2 优化活动 9-3 性能规划 9-4 实例优化 9-6 性能优化方法 9-7 收集统计信息 9-8 Oracle 等待事件 9-10 系统统计信息 9-11 显示与...

Global site tag (gtag.js) - Google Analytics