Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Nilam.

Asked: September 27, 2002 - 9:17 am UTC

Last updated: November 21, 2003 - 4:28 pm UTC

Version: 8.1.7

Viewed 1000+ times

You Asked

I am getting following error while importing tables.

. . importing table "EGM_FILELEVEL_COUNTS"
IMP-00019: row rejected due to ORACLE error 2291
IMP-00003: ORACLE error 2291 encountered
ORA-02291: integrity constraint (NBTEST1.FK_EGM_FILECOUNT_FILE_ID) violated - parent key not found
Column 1 2
Column 2 1
Column 3 1
Column 4 fcnew2
Column 5 1
Column 6 3
Column 7 1.1


But I checked the parent table after import and it has the values in its columns which were refered by table EGM_FILELEVEL_COUNTS as foreign key.

The possible reason looks to me from the log file is that it is trying to import the rows in table EGM_FILELEVEL_COUNTS before it imports in table EGM_FILE_INFO and the primary key of EGM_FILE_INFO is foreign key in EGM_FILELEVEL_COUNTS(FK_EGM_FILECOUNT_FILE_ID).

Please, let me know what could be the actual problem and how can I resolve that.

and Tom said...

Did the tables already exist with constraints? If so, you'll need to drop the fkey constraint OR do a table by table import.

Normally, import will import all of the data and THEN add the constraints. What happened to you can only happen when importing into existing structures and then the only ways to "solve" it are

a) disable the constraint whilst importing
b) import the tables one by one manually.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Error

atul, November 20, 2003 - 11:21 am UTC

Hi,

I'm getting following error while running a batch program

"_l2: Non Fatal errorORA-02291: integrity constraint (ECE_CUP_FK)
violated - parent key not found><121><0>
MMS0010B.pc(4458): load_other_messages: Number of AUdit master is <4> and Detail <8>"


How can i find out the rows in two tables having primary key
and foreign key relationship which give such problem


Thanks.
Atul





Tom Kyte
November 21, 2003 - 4:28 pm UTC

you won't find any rows -- the error message means "we rejected the row"

with primary/foreign keys in place, you won't FIND any rows in violation (if you do, it is "a bug")