ORA-02429

SQL> drop tablespace CMS_DYY_DATA including contents and datafiles;
drop tablespace CMS_DYY_DATA including contents and datafiles
*
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
oracle@linux-qfcb:~> oerr ora 02429
02429, 00000, "cannot drop index used for enforcement of unique/primary key"
// *Cause: user attempted to drop an index that is being used as the
//         enforcement mechanism for unique or primary key.
// *Action: drop the constraint instead of the index.

SQL> drop user GZYYCMS cascade;

User dropped.

SQL> drop tablespace CMS_DYY_DATA including contents and datafiles;

Tablespace dropped.

偷了一个懒,直接把该用户下的所有表,视图都删除掉,然后再来删除表空间。
正确应该是先找出该表空间里面有哪些unique or primary key然后删除。
  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=' TABLESPACE_NAME')

注:TABLESPACE_NAME 为需要删除的表空间名。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22779291/viewspace-704063/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22779291/viewspace-704063/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值