1、修改表空间为offline

alter tablespace users offline;

2、拷贝表空间文件

cp /oracle/app/oradata/HXDB/users01.dbf /oradata/HXDB/datafile/users01.dbf

3、修改表空间指向地址

alter database rename file '/oracle/app/oradata/HXDB/users01.dbf' to '/oradata/HXDB/datafile/users01.dbf';

4、删除表空间物理文件

rm /oracle/app/oradata/HXDB/users01.dbf

5、修改表空间为online

alter tablespace users online;

 

--删除空的表空间,但是不包含物理文件
drop tablespace tablespace_name;
--删除非空表空间,但是不包含物理文件
drop tablespace tablespace_name including contents;
--删除空表空间,包含物理文件
drop tablespace tablespace_name including datafiles;
--删除非空表空间,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
--如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;

 

posted on 2020-02-19 16:55  vinsonLu  阅读(1048)  评论(0编辑  收藏  举报