Oracle-删除表空间及数据文件方法

来源:这里教程网 时间:2026-03-03 18:37:29 作者:

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;

相关推荐