Re: HELP: Cannot (re-)enable constraint

From: Tim Auckland <auckland_at_probita.com>
Date: 1996/08/23
Message-ID: <mortDwM280.HFu_at_netcom.com>#1/1


R2,

Thanks for your quick response.

I've done some more testing by copying the offending table (ie. the one with the foreign constraint which I can't enable) to a temporary table.

The following sequence causes no errors:

TRUNCATE OFFENDING_TABLE;
ALTER TABLE OFFENDING_TABLE ENABLE CONSTRAINT OFFENDING_CONSTRAINT; INSERT INTO OFFENDING_TABLE SELECT * FROM TEMP_TABLE; COMMIT; (This reports 37311 rows created)

However, the 'enable constraint' cluase fails (parent keys not found) in the following sequence:

TRUNCATE OFFENDING_TABLE;
INSERT INTO OFFENDING_TABLE SELECT * FROM TEMP_TABLE; COMMIT;
ALTER TABLE OFFENDING_TABLE ENABLE CONSTRAINT OFFENDING_CONSTRAINT; Look's like an Oracle bug to me.

TIm.

Randy <rmramos.gbs_at_worldnet.att.net> wrote:

>auckland_at_probita.com (Tim Auckland) wrote:
>>We're running Oracle 7.1.4 on HPUX 10.10
>>
>>During an import process, we disable foreign key constraints, and
>>re-enable them after the import has finished.
>>
>>We can re-enable some of the constraints without a problem, but some,
>>even referring to the same indexed table column, fail with
>>
>>ORA-02298 ... - parent keys not found.
>>
>>The parent keys definitely exist.
>>
>>Any help with this problem would be greatly appreciated.
>>
>>Tim Auckland.
>>
>***********
>Tim
 

>first I would check dba_constraints and make sure the status column shows
>the parent PK enabled.
 

>If it is and the Whole key exists...I'm at a loss.
>The only other thing I can think of is check the FK table and double
>check that the constraint is against the PK and not UK. Other wise
>DISABLE the PK with cascade...REENABLE the PK....then REENABLE the FK.
 

>Good Luck
>R2
>Independent Oracle Consultant
Received on Fri Aug 23 1996 - 00:00:00 CEST

Original text of this message