【翻译自mos文章】在一个使用uniform size的 本地管理的表空间中

翻译:Why Does a Table Created in a Locally Managed Tablespace With Uniform Extents Ignore INITIAL? (文档 ID 753662.1)

在一个使用uniform size的 本地管理的表空间中建立一个表,为什么会忽略INITIAL 参数?

适用于:Oracle Database – Enterprise Edition – Version 8.1.5.0 to 11.1.0.7 [Release 8.1.5 to 11.1]Information in this document applies to any platform.Information in this document applies to any platform.

解决方案:

当在一个使用uniform size的 本地管理的表空间 中创建表时,创建表时指定的INITIAL EXTENT 大小,会部分的被使用(are only partially used)分为如下的三种情况:

举例:

create tablespace testdatafile '/u01/app/oracle/oradata/KBCOOK/test01.dbf' size 50mextent management local uniform size 1m;

该表空间适用于如下的三个例子。

1) 如果 INITIAL EXTENT 小于 UNIFORM size,那么 MINEXTENTS 个数量的 UNIFORM size 被创建 (见下面的Case )

SQL> create table test_tab (col1 varchar2(2)) tablespace test storage(initial 65535 minextents 1); SQL> select bytes from dba_extents where segment_name = 'TEST_TAB' and owner = 'KBCOOK'; BYTES ———- 1048576 1 rows selected.

注:原文是If the INITIAL EXTENT is smaller than the UNIFORM size, then the MINEXTENTS number of extents are created

其实,我觉得“then the MINEXTENTS number of extents are created ”说的不明确,此话直译是:那么 MINEXTENTS 个数量的 extents 被创建。数量是有了,但谁的数量没说。看如上sql的查询结果,推定是:那么 MINEXTENTS 个数量的 UNIFORM size 的extents 被创建.

为此我做了一个实验,见下面的文章:

该实验确认了如上的推定,即:如果 INITIAL EXTENT 小于 UNIFORM size ,,那么MINEXTENTS 个数量的 UNIFORM size的extents 被创建。

2) 如果 INITIAL EXTENT 大于 或 等于 UNIFORM size 但小于 UNIFORM size 乘以 MINEXTENTS,那么 MINEXTENTS 个 UNIFORM size 的 extent被创建(见下面的Case )

SQL> create table test_tab (col1 varchar2(2)) tablespace test storage(initial 1m minextents 5); Table created. SQL> select bytes from dba_extents where segment_name = 'TEST_TAB' and owner = 'KBCOOK'; BYTES ———- 1048576 1048576 1048576 1048576 1048576 5 rows selected.

在这个例子中,INITIAL = the UNIFORM size,那么 5个(MINEXTENTS的值) UNIFORM size 大小 的 extent被创建。

原文是:In this example, our INITIAL (1mb) is equal to the UNIFORM size and MINEXTENTS (5) will produce five 1mb extents.

3) 如果 INITIAL EXTENT 大于 UNIFORM size 乘以 MINEXTENTS,那么最小数量个UNIFORM extents 被创建,以满足 INITIAL EXTENT的存储要求。(见下面的Case )原文:If the INITIAL EXTENT is larger than the UNIFORM size times MINEXTENTS then the minimum number of UNIFORM extents will be created to meet the storage of the INITIAL EXTENT (see Case 3 below)

SQL> create table test_tab (col1 varchar2(2)) tablespace test storage(initial 5m minextents 2); SQL> select bytes from dba_extents where segment_name = 'TEST_TAB' and owner = 'KBCOOK'; BYTES ———- 1048576 1048576 1048576 1048576 1048576 1048576 6 rows selected.

In this example, our first five 1mb extents are the INITIAL EXTENT the sixth 1mb extent is the second extent of our MINEXTENTS = 2

想念我的时候,不要忘记我也在想念你。

【翻译自mos文章】在一个使用uniform size的 本地管理的表空间中

相关文章:

你感兴趣的文章:

标签云: