段存储属性继承

长平狐 发布于 2013/09/17 15:11
阅读 44
收藏 0
结论:建表时如果未指定表的段存储属性,则默认使用表空间的段存储属性。
如果建表时指定了段存储属性,则使用指定的段存储属性。
SYSTEM:系统自动分配区大小,分配值不固定
UNIFORM:手动统一分配区大小,每次固定分配2M
INITIAL_EXTENT:初始化区大小2M,在auto模式下只有初始化区大小,下次分配值不固定
NEXT_EXTENT:下次分配区大小2M,在uniform模式下这两个参数值一样
MIN_EXTENTS:最小区个数
MAX_EXTENTS:最大区个数

实验步骤一:建表时指定存储属性,并验证所建表的段存储属性与最早建立的表的段存储属性差异。

SQL> select table_name,tablespace_name from user_tables where table_name='TEST';
 
TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
TEST                           USERS
SQL> select segment_name,initial_extent,next_extent from user_segments where seGment_name like 'TEST%';
SEGMENT_NAME         INITIAL_EXTENT NEXT_EXTENT
-------------------- -------------- -----------
TEST                          65536     1048576
TEST1                         65536     1048576
TEST2                         65536     1048576
TEST3                         65536     1048576
TEST4                         65536     1048576
SQL> create table test5 storage(initial 1m next 3m) tablespace users as select * from dba_objects;
Table created
SQL> select segment_name,initial_extent,next_extent from user_segments where seGment_name like 'TEST%';
SEGMENT_NAME         INITIAL_EXTENT NEXT_EXTENT
-------------------- -------------- -----------
TEST                          65536     1048576
TEST1                         65536     1048576
TEST2                         65536     1048576
TEST3                         65536     1048576
TEST4                         65536     1048576
TEST5                       1048576     3145728

 实验步骤2:新建表,建表时不指定段存储属性。验证所建表的段存储属性与其它表的段存储属性差异。

SQL> create table test6 as select * from dba_objects;
Table created
SQL> select segment_name,initial_extent,next_extent from user_segments where seGment_name like 'TEST%';
SEGMENT_NAME         INITIAL_EXTENT NEXT_EXTENT
-------------------- -------------- -----------
TEST                          65536     1048576
TEST1                         65536     1048576
TEST2                         65536     1048576
TEST3                         65536     1048576
TEST4                         65536     1048576
TEST5                       1048576     3145728
TEST6                         65536     1048576
SQL> select table_name,tablespace_name from user_tables where table_name like 'TEST%';
TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
TEST                           USERS
TEST1                          USERS
TEST2                          USERS
TEST3                          USERS
TEST4                          USERS
TEST5                          USERS
TEST6                          USERS
原文链接:http://blog.csdn.net/q947817003/article/details/11490341
加载中
返回顶部
顶部