创建表空间
create tablespace useryan
datafile '/u01/app/oracle/useryan01.dbf' size 100m
autoextend on next 5m maxsize 200m;
还原表空间
create undo tablespace undo
datafile '/u01/app/oracle/undo01.dbf' size 40m;
临时表空间
create temporary tablespace temp_yan
tempfile '/u01/app/oracle/temp_yan01.dbf' size 500m
extent management local uniform size 4m;
只读表空间
alter tablespace useryan read only;
使用表空间脱机
alter tablespace undo offline;
启动数据文件自动扩展
create tablespace user_data
datafile
'/u02/app/oracle/user_data01' size 200m
autoextend on next 10m maxsize 500m;
移动数据文件
alter tablespace userdata rename
datafile '/u02/app/oracle/userdata01.dbf'
to '/u01/app/oracle/userdata01.dbf';
删除表空间
DROP TABLESPACE userdata
INCLUDING CONTENTS AND DATAFILES;