首页 > 数据库 > Oracle > Oracle-删除表空间及数据文件方法
https://blog.51cto.com/baoyw/5805456
删除空的表空间,但是不包含物理文件
drop tablespace tablespace_name;
注意:如果是非空表空间,则ORA-01549: tablespace not empty, use INCLUDING CONTENTS option
删除非空表空间,但是不包含物理文件
drop tablespace tablespace_name including contents;
删除空表空间,包含物理文件
drop tablespace tablespace_name including datafiles;
注意事项:
如果drop tablespace语句中含有datafiles,那datafiles之前必须有contents关键字,不然会提示ora-01911错误
删除非空表空间,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31397003/viewspace-2945504/ ,如需转载,请注明出处,否则将追究法律责任。