分类: Oracle
2008-08-01 16:36:37
The extent_management_clause
lets you specify how the extents of the tablespace will be managed.
EXTENT MANAGEMENT { DICTIONARY | LOCAL [ AUTOALLOCATE | UNIFORM [ SIZE size_clause ] ] }
对于extent有两种管理方式:
一是本地管理表空间,即local,它又有种两种方式
autoallocate,系统自动管理
uniform 自已定义extent的大小,默认是1M
一是在数据字典中管理,即dictionary
If you do not specify the
extent_management_clause
, then Oracle Database interprets theMINIMUM
EXTENT
clause and theDEFAULT
storage_clause
to determine extent management.
If you do not specify the DEFAULT
storage_clause
, then the database creates a locally managed autoallocated tablespace.
If you did specify the DEFAULT
storage_clause
, then:
If you specified the MINIMUM
EXTENT
clause, then the database evaluates whether the values of MINIMUM
EXTENT
, INITIAL
, and NEXT
are equal and the value of PCTINCREASE
is 0. If they are equal, then the database creates a locally managed uniform tablespace with extent size = INITIAL
. If the MINIMUM
EXTENT
, INITIAL
, and NEXT
parameters are not equal, or if PCTINCREASE
is not 0, then the database ignores any extent storage parameters you may specify and creates a locally managed, autoallocated tablespace.
If you did not specify MINIMUM
EXTENT
clause, then the database evaluates only whether the storage values of INITIAL
and NEXT
are equal and PCTINCREASE
is 0. If they are equal, then the tablespace is locally managed and uniform. Otherwise, the tablespace is locally managed and autoallocated.
如果PCTINCREASE为0,则Segment中所有新增加的Extent的大小都相同,等于NEXT的值;
要进行碎片的整理,有两种方法:
一是利用smon后台进程;(用这种方法时注意设置pctincrease的值必须为非0,一般设为1)
alter tablespace temp default storage (pctinscrease 1);
一是手工进行。
alter tablespace temp coalesce;