先看一个oracle 10g 下table 创建SQL,都是默认值:
先看一个Oracle 10g 下table 创建SQL,都是默认值:
CREATE TABLE SYS.QS
(
USERNAME VARCHAR2(30 BYTE) NOT NULL,
USER_ID NUMBER NOT NULL,
CREATED DATE NOT NULL
)
TABLESPACE SYSTEM
PCTUSED 40
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
对于 数据字典管理(Dictionary managed)和 本地化管理(Local Managed)的表空间,他们的参数是不同的,, 在Local Managed 模式下,的autoallocate和 uniform类型不同,参数也会不同。 这里使用的是local managed autoallocate类型的表空间。
一、Storage 参数说明
1. INITIAL
Specify the size of the first extent of the object. Oracle allocates space for this extent when you create the schema object. Refer to size_clause for information on that clause.
In locally managed tablespaces, Oracle uses the value of INITIAL, in conjunction with the type of local management—AUTOALLOCATE or UNIFORM—and the values of MINEXTENTS, NEXT and PCTINCREASE, to determine the initial size of the segment.
(1)With AUTOALLOCATE extent management, Oracle uses the INITIAL setting to optimize the number of extents allocated. Extents of 64K, 1M, 8M, and 64M can be allocated. During segment creation, the system chooses the greatest of these four sizes that is equal to or smaller than INITIAL, and allocates as many extents of that size as are needed to reach or exceed the INITIAL setting. For example, if you set INITIAL to 4M, then the database creates four 1M extents. But if you set INITIAL to 14M, then the database creates two 8M extents, which exceeds the INITIAL setting, rather than creating the less optimal one 8M extent plus six 1M extents.
(2)For UNIFORM extent management, the number of extents is determined from initial segment size and the uniform extent size specified at tablespace creation time. For example, in a uniform locally managed tablespace with 1M extents, if you specify an INITIAL value of 5M, then Oracle creates five 1M extents.
Consider this comparison: With AUTOALLOCATE, if you set INITAL to 72K, then the initial segment size will be 128K (greater than INITIAL)。 The database cannot allocate an extent smaller than 64K, so it must allocate two 64K extents. If you set INITIAL to 72K with a UNIFORM extent size of 24K, then the database will allocate three 24K extents to equal 72K.
In dictionary managed tablespaces, the default initial extent size is 5 blocks, and all subsequent extents are rounded to 5 blocks. If MINIMUM EXTENT was specified at tablespace creation time, then the extent sizes are rounded to the value of MINIMUM EXTENT.
-- 自Oracle 9i 以后,推荐使用本地管理的表空间,不建议使用字典管理的表空间。
Restriction on INITIAL You cannot specify INITIAL in an ALTER statement.
2。 MINEXTENTS
(1)在本地管理的表空间中,Oracle 数据库使用 MINEXTENTS 的值与 PCTINCREASE、INITIAL 和 NEXT 结合来确定初始段大小。
(2)在字典管理的表空间中,指定总数创建对象时要分配的范围。默认和最小值为 1,这意味着 Oracle 仅分配初始范围,回滚段除外,回滚段的默认和最小值为 2。最大值取决于您的操作系统。
(11)在本地托管表空间中,MINEXTENTS 用于计算分配的初始空间量,等于 INITIAL * MINEXTENTS。此后,该值设置为 1,这会反映在 DBA_SEGMENTS 视图中。
(22)在字典管理的表空间中,MINEXTENTS 只是必须分配给段的最小盘区数。
如果MINEXTENTS 值大于 1,则 Oracle 根据 INITIAL、NEXT 和 PCTINCREASE 存储参数的值计算后续区段的大小。
通过在 ALTER 语句中指定来更改 MINEXTENTS 的值时,可以减少其当前值的值,但不能增加它。将 MINEXTENTS 重置为较小的值可能会很有用,例如,在 TRUNCATE … DROP STORAGE 语句之前,如果您想确保段在 TRUNCATE 操作之后保持最小数量的范围。
对 MINEXTENTS 的限制
MINEXTENTS 存储参数受到以下限制:
(11)MINEXTENTS 不适用于表空间级别。
(22)您无法在 ALTER 语句中或驻留在以下位置的对象更改 MINEXTENTS 的值:本地管理的表空间。