Oracle PGA sort hash _smm_max_size


When Oracle replaced the sort_area_size and hash_area_size functionality with thepga_aggregate_targetparameter in Oracle9i, there was a great deal of speculation about how to control sorting and hash joins within the large PGA region. Here we discuss two issues. How do we increase the RAM for hash joins and RAM sorting within thepga_aggregate_target?

For example, we might have a single evening batch task that would benefit from using all of thepga_aggregate_target,not just the 5% limit.

Increasing Hash Joins

To force hash joins you must perform two steps. It may not be enough to increase the hash_area_size if the CBO is stubborn, and usually you must force the hash join with a hint.

Step 1 - Increase thehash_area_sizemaximum

alter session set workarea_size_policy=manual;
alter session set hash_area_size=1048576000;

Step 2 - Add ause_hashhint to the SQL

select /*+ use_hash(a, b)*/
from . . .


Increasing RAM sorting

In Oracle9i, the sorting default is that no single task may consume more than 5% of thepga_aggregate_targetregion before the sort pages-out to the TEMP tablespace for a disk sort. For parallel sorts, the limit is 30% of the PGA aggregate, regardless of the number of parallel processes.

You can override the default sorting behavior in two ways:

Option 1- Manual override:

alter session set workarea_size_policy=manual;
alter session set sort_area_size=1048576000;

Option 2- Bounce with special hidden parameter: In this example, we increase the default amount of RAM available to sort operations from 5% to about 50%:

pga_aggregate_target=10g
_smm_max_size=4000000;

Not that the number for_smm_max_sizeis expressed in k-bytes, so this value is about 4.5 gigabytes.

Remember, hidden parameters are totally unsupported, so use this technique at your own risk.


转载自:http://www.dba-oracle.com/oracle_tips_9i_sort_size.htm


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值