ITPub博客

首页 > 数据库 > Oracle > Oracle-删除表空间及数据文件方法

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

Oracle 作者:不一样的天空w 时间:2023-04-13 14:11:25 0 删除 编辑

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/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: rman异机备份恢复
下一篇: swap扩容
请登录后发表评论 登录
全部评论

注册时间:2016-09-22

  • 博文量
    916
  • 访问量
    1400224