1. 首页 > ITPUX技术网 > 正文

Oracle数据库Drop表空间时报ORA-02429错误

前几天,客户说误删除了一个表空间的数据文件,干脆就把这个表空间删除
已经确认这个表空间没有用了,可以删除,但删除表空间时报错

SQL> drop tablespace test including contents cascade constraints;
drop tablespace test including contents cascade constraints
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-02429: cannot drop index used for enforcement of unique/primary key

因为你这个表空间中建立了一个INDEX,这个INDEX被其它表空间中的表用来当主键或唯一约束,所以必须先删除在这个表空间下的约束,才可以删除表空间

[color=#0000bb]SQL> alter table test2 drop constraint fk_test2[color=#007700];
[color=#007700]
SQL> drop tablespace test including contents and datafiles;
表空间已丢弃。

删除成功。

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息