Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2880964
  • 博文数量: 599
  • 博客积分: 16398
  • 博客等级: 上将
  • 技术积分: 6875
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-30 12:04
个人简介

WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606

文章分类

全部博文(599)

文章存档

2014年(12)

2013年(56)

2012年(199)

2011年(105)

2010年(128)

2009年(99)

分类: Oracle

2013-01-06 15:36:09

Sort operations use up to SORT_AREA_SIZE bytes of memory. If a sort can be performed within
 this amount of memory and the result set fits within SORT_AREA_RETAINED_SIZE then there is no
 need to start writing blocks to disk. If more sortspace is needed it is then necessary to use
 a TEMPORARY segment on disk to accommodate the intermediate sort runs and/or the sort results
 . There are 2 ways sort blocks can be sent to disk:
 
  • via the buffer cache (and then DBWR)
  • Using sort direct writes
  • The first of these is often the default, and in Oracle 7.1 is the only option available. 
    Sort blocks are placed into the buffer cache thus aging all other blocks. 
    When the sort blocks reach the LRU end of the least recently used list DBWR will flush 
    them to disk. This can impact the performance for everyone else as private sort blocks 
    (sort blocks are of no use to anyone else) can flood DBWR and age blocks in the cache 
    more quickly. 

    In Oracle 7.2 the parameter SORT_DIRECT_WRITES can be set to cause processes to write sort blocks direct to disk avoiding the buffer cache. It is generally desirable to set SORT_DIRECT_WRITES to TRUE to ensure sort blocks do not impact the buffer cache.

    Note 1: Setting SORT_DIRECT_WRITES=TRUE causes additional memory to be allocated for the session.

    Note 2: In a lightly loaded environment SORT_DIRECT_WRITES may cause an individual job to take slightly longer ! Consider that when blocks are placed in the buffer cache it is acting almost like a memory extension to that process as "GETs" of sort blocks may be satisfied from the cache rather than from disk.

    Since Oracle 8.1 the parameter SORT_DIRECT_WRITES became obsolete and direct writes are always used for sort operations that do not fit into the sort area size.  

    阅读(647) | 评论(0) | 转发(0) |
    给主人留下些什么吧!~~