暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
延迟段创建,数据文件增加删除移动测试.txt
862
6页
1次
2020-05-28
10墨值下载
一、环境准备
osLinux6.5 oracle11.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;
9 rows created.
U1@PROD1 >select SEGMENT_NAME,FILE_ID,BLOCKS from dba_extents where file_id=7;
SEGMENT_NAME
FILE_ID BLOCKS
--------------------------------------------------------------------------------
- ---------- ----------
T1
7 8
U1@PROD1 >create table t2 tablespace aaa as select * from dba_objects;
Table created.
***这里注意 ctas 创建指定表空间时,tablespace 参数应该在表名后边。
U1@PROD1 >select SEGMENT_NAME,FILE_ID,BLOCKS from dba_extents where file_id=6;
SEGMENT_NAME
FILE_ID BLOCKS
--------------------------------------------------------------------------------
- ---------- ----------
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 8
T2
6 128
T2
6 128
T2
6 128
T2
6 128
T2
6 128
of 6
10墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜