日期:2014-05-16  浏览次数:20490 次

Oracle表空间用统一区大小注意点
今天在做测试用EXTENT MANAGEMENT LOCAL UNIFORM管理时,遇到看起来比较奇怪的问题,于是研究了一下。
首先创建3个表空间,注意其初始大小和UNIFORM SIZE。
SQL> create tablespace testblock datafile '/oradata/mcstar/testblock01.dbf' SIZE 200M
  2  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 2m
  3   SEGMENT SPACE MANAGEMENT AUTO;

Tablespace created.

SQL> create tablespace testblock2 datafile '/oradata/mcstar/testblock02.dbf' SIZE 10M
  2  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1m
  3   SEGMENT SPACE MANAGEMENT AUTO;

Tablespace created.

SQL> create tablespace testblock3 datafile '/oradata/mcstar/testblock03.dbf' SIZE 10M
  2  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 8m
  3   SEGMENT SPACE MANAGEMENT AUTO;

Tablespace created.
需要注意的是Oracle创建表空间时,自动扩展为关闭
SQL> select file_id,file_name,blocks-user_blocks,AUTOEXTENSIBLE from  dba_data_files order by 1;

FILE_ID FILE_NAME                                BLOCKS-USER_BLOCKS AUT
------- ---------------------------------------- ------------------ ---
      1 /oradata/mcstar/system01.dbf                              8 YES
      2 /oradata/mcstar/undotbs01.dbf                             8 NO
      3 /oradata/mcstar/sysaux01.dbf                              8 YES
      4 /oradata/mcstar/users01.dbf                               8 YES
      5 /oradata/mcstar/mcstar01.dbf                              8 NO
      6 /oradata/mcstar/xu01.dbf                                  8 NO
      7 /oradata/mcstar/zhoul01.dbf                               8 YES
      8 /oradata/mcstar/zhoul201.dbf                              8 YES
      9 /oradata/mcstar/testblock01.dbf                         256 NO
     10 /oradata/mcstar/undotbs02.dbf                             8 YES
     11 /oradata/mcstar/testblock02.dbf                    &nb