11g自动内存设置-整理自官方文档
2013-04-28 16:30
295 查看
The simplest way to manage instance memory is to allow the Oracle Database instance to automatically manage and tune it for you.
一种简单管理内存的方式是:让oracle自动为你管理和调优!
To do so (on most platforms), you set only a target memory size initialization parameter (
maximum memory size initialization parameter (
多数平台上,你只需设置初始化参数MEMORY_TARGET,再随意(大于后者等于MEMORY_TARGET)设置初始化参数MEMORY_MAX_TARGET
The total memory that the instance uses remains relatively constant, based on the value of
SGA and instance PGA.
实例的总内存以MEMORY_TARGET设置的值为准(开机时oracle以MEMORY_TARGET参数值为准给instance分配内存!如果业务需要分配更大内存,oracle将自动扩展,但不能超过MEMORY_MAX_TARGET的值),实例根据需要自动分配内存给SGA和PGA
When automatic memory management is not enabled, you must size both the SGA and instance PGA manually.
当自动内存管理未启用时,你必须指定SGA和PGA的内存大小
Because the
size, the instance also prevents you from setting
MEMORY_MAX_TARGET是一个静态参数,作为一个上限值(限制
If you create your database with Database Configuration Assistant (DBCA) and choose the basic installation option, automatic memory management is enabled. If you choose advanced installation, Database Configuration Assistant (DBCA) enables you to select
automatic memory management.
如果你用DBCA创建数据库并且选择基本安装选项,自动内存默认是启用的!假如你是高级安装你也可以选择启用自动内存管理!
开启自动内存管理的步骤:
1:Start SQL*Plus and connect to the database as
以sys用户登录
2:Calculate the minimum value for
计算
a:Determine the current sizes of
确定
show parameter target
b:Run the following query to determine the maximum instance PGA allocated since the database was started:Run the following query to determine the maximum instance PGA allocated since the database was started:
确定从数据库启动以来实例分配给PGAde 的最大值:
select value/1024/1024||'m' from v$pgastat where name='maximum PGA allocated';
c:Compute the maximum value between the query result from step 2b and
计算memory_target 最大值
For example, if
例如,如果
这只是他的最小值!你也可以将值设置的更大,前提是有足够的物理内存!
3:For the
sizes. This number can be larger than or the same as the
修改参数的脚本:
如果修改了该参数MEMORY_MAX_TARGET 需重启实例!
The dynamic performance view
动态视图
The view
The row with the
一种简单管理内存的方式是:让oracle自动为你管理和调优!
To do so (on most platforms), you set only a target memory size initialization parameter (
MEMORY_TARGET) and optionally a
maximum memory size initialization parameter (
MEMORY_MAX_TARGET).
多数平台上,你只需设置初始化参数MEMORY_TARGET,再随意(大于后者等于MEMORY_TARGET)设置初始化参数MEMORY_MAX_TARGET
The total memory that the instance uses remains relatively constant, based on the value of
MEMORY_TARGET, and the instance automatically distributes memory between the system global area (SGA) and the instance program global area (instance PGA). As memory requirements change, the instance dynamically redistributes memory between the
SGA and instance PGA.
实例的总内存以MEMORY_TARGET设置的值为准(开机时oracle以MEMORY_TARGET参数值为准给instance分配内存!如果业务需要分配更大内存,oracle将自动扩展,但不能超过MEMORY_MAX_TARGET的值),实例根据需要自动分配内存给SGA和PGA
When automatic memory management is not enabled, you must size both the SGA and instance PGA manually.
当自动内存管理未启用时,你必须指定SGA和PGA的内存大小
Because the
MEMORY_TARGETinitialization parameter is dynamic, you can change
MEMORY_TARGETat any time without restarting the database.
MEMORY_TARGET是一个动态参数,可以再任何需要的时候进行调整而不必重启实例!
MEMORY_MAX_TARGET, which is not dynamic, serves as an upper limit so that you cannot accidentally set
MEMORY_TARGETtoo high, and so that enough memory is set aside for the database instance in case you do want to increase total instance memory in the future. Because certain SGA components either cannot easily shrink or must remain at a minimum
size, the instance also prevents you from setting
MEMORY_TARGETtoo low.
MEMORY_MAX_TARGET是一个静态参数,作为一个上限值(限制
MEMORY_TARGET参数),你不能将
MEMORY_TARGET设置的过高,并且要保留足够的内存来满足在以后实例的扩张。但是实例总是不允许你将
MEMORY_TARGET参数设置的过低,因为SGA的组件大小有最小值限定,还有些组件是很难缩小的!
If you create your database with Database Configuration Assistant (DBCA) and choose the basic installation option, automatic memory management is enabled. If you choose advanced installation, Database Configuration Assistant (DBCA) enables you to select
automatic memory management.
如果你用DBCA创建数据库并且选择基本安装选项,自动内存默认是启用的!假如你是高级安装你也可以选择启用自动内存管理!
开启自动内存管理的步骤:
1:Start SQL*Plus and connect to the database as
SYSDBA.
以sys用户登录
2:Calculate the minimum value for
MEMORY_TARGETas follows:
计算
MEMORY_TARGET的最小值!
a:Determine the current sizes of
SGA_TARGETand
PGA_AGGREGATE_TARGETby entering the following SQL*Plus command:
确定
SGA_TARGET,
PGA_AGGREGATE_TARGET参数的大小:
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 pga_aggregate_target big integer 90M sga_target big integer 272M
b:Run the following query to determine the maximum instance PGA allocated since the database was started:Run the following query to determine the maximum instance PGA allocated since the database was started:
确定从数据库启动以来实例分配给PGAde 的最大值:
select value/1024/1024||'m' from v$pgastat where name='maximum PGA allocated';
c:Compute the maximum value between the query result from step 2b and
PGA_AGGREGATE_TARGET. Add
SGA_TARGETto this value.
计算memory_target 最大值
memory_target = sga_target + max(pga_aggregate_target, maximum PGA allocated)
For example, if
SGA_TARGETis 272M and
PGA_AGGREGATE_TARGETis 90M as shown above, and if the maximum PGA allocated is determined to be 120M, then
MEMORY_TARGETshould be at least 392M (272M + 120M).
例如,如果
SGA_TARGETis 272M,
PGA_AGGREGATE_TARGETis 90M,maximum PGA allocated is 120M,那么
MEMORY_TARGET的最小值为:392M (272M + 120M)。
这只是他的最小值!你也可以将值设置的更大,前提是有足够的物理内存!
3:For the
MEMORY_MAX_TARGETinitialization parameter, decide on a maximum amount of memory that you would want to allocate to the database for the foreseeable future. That is, determine the maximum value for the sum of the SGA and instance PGA
sizes. This number can be larger than or the same as the
MEMORY_TARGETvalue that you chose in the previous step.
MEMORY_MAX_TARGET这个参数的设置要大于或者等于
MEMORY_TARGET参数的值。根据网上的一些经验之谈
MEMORY_MAX_TARGET= OS_MEMORY*80%这参数的值没有固定公式可参考!要根据实际情况来确定!!
修改参数的脚本:
ALTER SYSTEM SET MEMORY_MAX_TARGET = nM SCOPE = SPFILE;
如果修改了该参数MEMORY_MAX_TARGET 需重启实例!
The dynamic performance view
V$MEMORY_DYNAMIC_COMPONENTSshows the current sizes of all dynamically tuned memory components, including the total sizes of the SGA and instance PGA.
动态视图
V$MEMORY_DYNAMIC_COMPONENTS显示了当前动态内存组件的大小。包括SGA,PGA的总大小!
The view
V$MEMORY_TARGET_ADVICEprovides tuning advice for the
MEMORY_TARGETinitialization parameter.
SQL> select * from v$memory_target_advice order by memory_size; MEMORY_SIZE MEMORY_SIZE_FACTOR ESTD_DB_TIME ESTD_DB_TIME_FACTOR VERSION ----------- ------------------ ------------ ------------------- ---------- 180 .5 458 1.344 0 270 .75 367 1.0761 0 360 1 341 1 0 450 1.25 335 .9817 0 540 1.5 335 .9817 0 630 1.75 335 .9817 0 720 2 335 .9817 0
The row with the
MEMORY_SIZE_FACTORof 1 shows the current size of memory, as set by the
MEMORY_TARGETinitialization parameter, and the amount of DB time required to complete the current workload. In previous and subsequent rows, the results show several alternative
MEMORY_TARGETsizes. For each alternative size, the database shows the size factor (the multiple of the current size), and the estimated DB time to complete the current workload if the
MEMORY_TARGETparameter were changed to the alternative size. Notice that for a total memory size smaller than the current
MEMORY_TARGETsize, estimated DB time increases. Notice also that in this example, there is nothing to be gained by increasing total memory size beyond 450MB. However, this situation might change if a complete workload has not yet been run.
相关文章推荐
- ES官方文档整理-4.field data 内存控制
- Oracle 11g设置内存自动管理
- 韩顺平_轻松搞定网页设计(html+css+javascript)_第26讲_js函数调用过程内存分析_js函数细节_学习笔记_源代码图解_PPT文档整理
- elasticsearch5 官方文档整理。。。。中
- Managing Bitmap Memory管理bitmap内存(Android官方文档翻译——四)
- 官方文档:11G新特性SQL PLAN BASLINE 执行计划基线
- Eclipse设置自动生成文档所使用的@author属性
- Oracle 11g 的 自动内存管理
- 微信小程序官方文档错误整理
- Android官方开发文档Training系列课程中文版:高效显示位图之管理位图内存
- ABP官方文档(十二)【时间与时区设置】
- [解析苹果官方文档]之[自动布局-view.autoresizingMask]
- 韩顺平_PHP程序员玩转算法公开课(第一季)06_堆栈在内存中存在形式剖析_学习笔记_源代码图解_PPT文档整理
- Es官方文档整理-1.概览
- 【11g体系结构,4】AMM(内存分配自动管理)
- windows系统如何设置应用程序崩溃自动内存转储
- oracle 11g 自动内存管理
- [每日一题] 11gOCP 1z0-052 :2013-09-23 Oracle11g 内存参数设置...................................C7
- 2DToolkit官方文档中文版打地鼠教程(一):初始设置
- 官方ebs设置文档地址--DZY