前几天,客户说误删除了一个表空间的数据文件,干脆就把这个表空间删除
已经确认这个表空间没有用了,可以删除,但删除表空间时报错
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被其它表空间中的表用来当主键或唯一约束,所以必须先删除在这个表空间下的约束,才可以删除表空间
alter table test2 drop constraint fk_test2;
SQL> drop tablespace test including contents and datafiles;
表空间已丢弃。
删除成功。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7199859/viewspace-584889/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7199859/viewspace-584889/