pga相关参数

PGA

    UGA :session信息,WORK AREA(hash area,sort area等)等等

    CGA :parse调用、executive调用、fetch调用等


pga_aggregate_target 设定所有进程总的WORK AREA区大小,主要影响下面几个相关参数的设定

    _smm_max_size : 串行进程的WORK AREA上限值,单位KB。默认值

    _pga_max_size : 每个进程WORK AREA上限值,单位byte。

    _smm_px_max_size : 并行模式下,所有并行进程共享的WORK AREA上限值,单位KB


_smm_max_size:

    pga_aggregate_target  <= 500 MB, then _smm_max_size = 20% * pga_aggregate_target

    pga_aggregate_target  [500MB , 1000 MB], then _smm_max_size = 100 MB

    pga_aggregate_target  >= 1000 MB, then _smm_max_size = 10% * pga_aggregate_target, 最大值 1024MB


_pga_max_size:

     _smm_max_size <= 100m,then _pga_max_size=200m

    _smm_max_size > 100m,then _pga_max_size = 2 * _smm_max_size


_smm_px_max_size:

    _smm_px_max_size = 50% * pga_aggregate_target

    degree of parallelism (DOP) <= 5, 每个slave进程使用_smm_max_size限制

    degree of parallelism (DOP) > 5,  所有slave进程共享_smm_px_max_size


从上面的分析,我们可以得到下面的一些指导:

 1、增大pga_aggregate_target设置,可以提高每个进程的work area大小,对于hash join、排序等操作有利

 2、PGA达到10G后,单个进程的work area已经达到极限,不能再获得更大的空间了

 3、在CPU足够的情况,设置并行度超过6,可以获得更大的work area空间,比如创建索引就会更快

 4、如果大量进程启用高并行度,操作系统内存很容易被消耗光,因为PGA只是限定了work area的空间,而其他的组件可以越界。

综上, pga_aggregate_target并不是硬性限制 ,work area之外的内存,不被pga_aggregate_target和_pga_max_size所限制。所以经常会看到PGA的大小超过了pga_aggregate_target,这通常是因为PL/SQL中的变量和数组中装入了巨大的数据造成的。通常的例子是bulk collect。


在12c中引入了PGA_AGGREGATE_LIMIT参数,可用来硬性限制PGA大小。

In Oracle release 12.1:  the greater of the following:

* 2 GB

* 200% of PGA_AGGREGATE_TARGET

* (Value of PROCESSES initialization parameter setting) * 3 MB

It will not exceed 120% of the physical memory size minus the total SGA size.


In Oracle release 12.2:

* If MEMORY_TARGET is set, then PGA_AGGREGATE_LIMIT defaults to the MEMORY_MAX_TARGET value.

* If MEMORY_TARGET is not set, then PGA_AGGREGATE_LIMIT defaults to 200% of PGA_AGGREGATE_TARGET.

* If MEMORY_TARGET is not set, and PGA_AGGREGATE_TARGET is explicitly set to 0, then the value of PGA_AGGREGATE_LIMIT is set to 90% of the physical memory size minus the total SGA size.

In all cases, the default PGA_AGGREGATE_LIMIT is at least 2GB and at least 3MB times the PROCESSES parameter.


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31544156/viewspace-2633451/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31544156/viewspace-2633451/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值