一、环境准备
os:Linux6.5 oracle:11.2.0.4
##创建测试用户及赋权
SYS@PROD1 >create user u1 identified by u1 account unlock;
User created.
SYS@PROD1 >grant dba to u1;
Grant succeeded.
##创建测试表空间并修改 u1 默认表空间
SYS@PROD1 >create tablespace AAA datafile '/home/oracle/aa.dbf' size 50M;
Tablespace created.
SYS@PROD1 >create tablespace BBB datafile '/home/oracle/bb.dbf' size 50M;
Tablespace created.
SYS@PROD1 >alter user u1 default tablespace bbb;
User altered.
SYS@PROD1 >set lines 999 pages 999
SYS@PROD1 >col file_name for a50
SYS@PROD1 >select file_id,file_name,tablespace_name from dba_data_files;
FILE_ID FILE_NAME TABLESPACE_NAME
---------- --------------------------------------------------
------------------------------
4 /u01/app/oracle/oradata/PROD1/users01.dbf USERS
3 /u01/app/oracle/oradata/PROD1/undotbs01.dbf UNDOTBS1
2 /u01/app/oracle/oradata/PROD1/sysaux01.dbf SYSAUX
1 /u01/app/oracle/oradata/PROD1/system01.dbf SYSTEM
5 /u01/app/oracle/oradata/PROD1/text01.dbf TEXT
6 /home/oracle/aa.dbf AAA
7 /home/oracle/bb.dbf BBB
7 rows selected.
SYS@PROD1 >select SEGMENT_NAME,FILE_ID,BLOCKS from dba_extents where file_id=6;
no rows selected
SYS@PROD1 >select SEGMENT_NAME,FILE_ID,BLOCKS from dba_extents where file_id=7;
no rows selected
二、测试过程
1、延迟段测试
U1@PROD1 >create table t1 as select * from dba_objects where 1=2;
Table created.
U1@PROD1 >select SEGMENT_NAME,FILE_ID,BLOCKS from dba_extents where file_id=7;
no rows selected
U1@PROD1 >insert into t1 select * from dba_objects where rownum<10;
评论