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;