首先假设表FC_owner中存在外键OINSID重复;其对应的约束名称为:PK_FC_OWNER_I_OPTINST
1、通过创建表exceptions
C:/oracle/ora92/rdbms/admin/utlexcpt.sql
crreate table exceptions(row_id rowid,
owner varchar2(30),
table_name varchar2(30),
constraint varchar2(30));
2、执行启用约束
alter table realstar.fc_owner enable constraint PK_FC_OWNER_I_OPTINST exceptions into exceptions
会提示异常:ORA-02299: 无法验证 (REALSTAR.PK_FC_OWNER_I_OPTINST) - 未找到重复关键字
3、查询导致原因
select * from fc_owner where rowid in (select row_id from exceptions);
4、处理。。。