`
844604778
  • 浏览: 551196 次
文章分类
社区版块
存档分类
最新评论

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


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics