ORA-02429: cannot drop index used for enforcement of unique/primary key

[oracle@localhost ~]$            oerr ora 2429
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.


很明显,它具有索引和约束名的意义;也就是:

采用alter table tb1 add constraint unique(object_id);

而不是:create unique index on tb1(object_id);


解决办法:

// *Action: drop the constraint instead of the index.

如果不知道查询sql references =>搜索drop constraint

:alter table tb1 drop unique(object_id);

SQL> alter table ca1 drop unique(object_id);

Table altered.


所以大家要知道个概念:

create unique index只建立索引在dba_straints里面是查询不到U的约束类型

而alter table .....unique(column_name);是具备索引和约束名;



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值