1.为表空间增加新的数据文件,并且指定自动扩展属性
alter tablespace test //选择表空间
add datafile 'D:\study\ts01.dbf' size 10M //增加数据文件,其中数据文件ts01.dbf本不存在,是新创建的,大小必须指定。
autoextend on next 5M //指定自动扩展属性
2.修改数据文件大小
select tablespace_name,file_id,bytes,blocks from dba_free_space; //通过数据字典dba_free_space,了解表空间的分区情况
alter database datafile 'D:\study\ts01.dbf' resize 10M; //修改大小
3.移动数据文件
alter tablespace test offline; //将要修改的表空间设置为offline状态
alter tablespace test //选择表空间
rename datafile 'D:\study\ts01.dbf' to 'E:\study\ts01.dbf'; //将数据文件移动另外的磁盘
4.删除表空间
drop tablespace test; //删除表空间
drop tablespace test including contents and datafiles; //删除表空间和其内的所有内容和数据文件