ora-00604,ora-02429:无法删除用于强制唯一/主键的索引。


今天删除数据库中的表空间时,发现始终删不掉,错误信息为:"ora-00604,ora-02429:无法删除用于强制唯一/主键的索引。"

最终发现是其他某个用户在创建索引时没有注意到其中tablespace设置,直接把这个索引的表空间指定到这个表空间中,故删除之,并重新创建到其他表空间中.故障接触.

操作语法:
select 'alter table '||owner||'.'||table_name||' drop constraint '||constraint_name||' ;'
from dba_constraints
where constraint_type in ('U', 'P')
   and (index_owner, index_name) in
       (select owner, segment_name
          from dba_segments
         where tablespace_name = 'ENESYS0922');

更多Oracle相关信息见Oracle 专题页面 http://www.bkjia.com/topicnews.aspx?tid=12

相关内容