Oracle Error 2298 Encountered
parent keys not found [message #507089] Thu, 12 May 2011 07:35 Database admin Messages: 365Registered: September 2006 Location: india Senior Member Hi, I received the below error while importing the dump file. IMP-00017: following statement failed with ORACLE error 2298: "ALTER TABLE "tab1" ENABLE CONSTRAINT "TSK_FK"" IMP-00003: ORACLE error 2298 encountered ORA-02298: cannot validate (bala.TSK_FK) - parent keys not found can anyone tell me how to resolve this error? Thanks [Updated on: Thu, 12 May 2011 08:04] by ModeratorReport message to a moderator Re: IMP-00017 [message #507090 is a reply to message #507089] Thu, 12 May 2011 07:36 ramoradba Messages: 2454Registered: January 2009 Location: AndhraPradesh,Hyderabad,I... Senior Member Quote:ORA-02298: cannot validate (bala.TSK_FK) - parent keys not found Its failed ..because dependent commands were also failed. Quote:parent keys not found check the log. Quote:Error: ORA-02298: cannot enable name - parent keys not found Cause: You tried to execute an ALTER TABLE ENABLE CONSTRAINT command, but it failed because your table has orphaned child records in it. Action: The options to resolve this Oracle error are: Remove the orphaned child records from the child table (foreign key relationship), and then re-execute the ALTER TABLE ENABLE CONSTRAINT command. Create the missing parent records in the parent table (foreign key relationship), and then re-execute the ALTER TABLE ENABLE CONSTRAINT command. ORA-02298: cannot validate (string.string) - parent keys not found Cause: an alter table validating constraint failed because the table has orphaned child records. Action: Obvious Sriram [Updated on: Thu, 12 May 2011 08:35] by ModeratorReport message to a moderator Re: IMP-00017 [message #507098 is a reply to message #507090] Thu, 12 May 2011 08:00 Database admin Messages: 365Registered: September 2006 Location: india Senior Member Thanks you Sriram for your explanation. Report message to a moderator Previous Topic: SQL Loader - Excel file different column order format Next Topic: Hot backup of tablespaces Goto Forum: - SQL & PL/SQLSQL & PL/SQLClient Tools- RDBMS ServerServer AdministrationBackup & RecoveryPerformance TuningSecurityNetworking and GatewaysEnterprise ManagerServer Utilities- Server OptionsRAC & FailsafeData GuardReplicationStreams & AQSpatialText & interMedia- Developer & ProgrammerApplication Express, ORDS & MOD_PLSQ
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > I got the errors duringimp Want to Advertise Here? Solved I got http://www.orafaq.com/forum/t/171083/ the errors duringimp Posted on 2006-06-17 Databases 1 Verified Solution 5 Comments 856 Views Last Modified: 2008-02-07 all record imported successfully, but I got this error, how to fix this without re-imp the data? About to enable constraints... IMP-00017: following statement failed with ORACLE error 2298: "ALTER TABLE "SIGNATURES" ENABLE CONSTRAINT "SIGN_PGIDFK"" IMP-00003: ORACLE https://www.experts-exchange.com/questions/21889933/I-got-the-errors-duringimp.html error 2298 encountered ORA-02298: cannot validate (STCLOUD.SIGN_PGIDFK) - parent keys not found Import terminated successfully with warnings. 0 Question by:salasadi Facebook Twitter LinkedIn Google LVL 6 Best Solution byJJSmith It may be that the data was not there at the time! Have you since tried to manually: ALTER TABLE "SIGNATURES" ENABLE CONSTRAINT "SIGN_PGIDFK"; what is the outcome? If you are sure that the Go to Solution 5 Comments LVL 25 Overall: Level 25 Databases 16 Message Expert Comment by:jrb12006-06-17 Hi salasadi, Were you doing something special on the import? If all the parent and child records imported correctly, you should be able to enable the constraints. Do you know what the parent keys for SIGN_PGIDFK are? You could do a SELECT on the data to see what is missing. Regards, John 0 LVL 16 Overall: Level 16 Databases 8 Message Expert Comment by:MohanKNair2006-06-18 The problem is that all data in parent table is anot available. The table may be r
exported first and parent table later ( Table with primary key) then there will be issue at importing because import of tables takes place in http://adminoracle10g.blogspot.com/2012/05/foreign-key-constraint-issues-in.html the same order as export has taken .There will be constraints error in importing child tables. In that case we have to import first all for parent table and in after that import chid tables . i.e we have to perform import twice. Once the parents tables and second time child tables So to avoid this workaround, one should be prudent in picking the tables order oracle error in export. Example: In the given eample table x have foriegn key reference with the table y. Tables export takes in the order x and y. exp scott/tiger@mediamat FILE=/home/oracle/expdrec/exp.dmp LOG=/home/oracle/expdrec/exp.LOG CONSISTENT=y tables=x,y Export: Release 10.2.0.4.0 - Production on Mon May 9 09:47:52 2011 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the oracle error 2298 Partitioning, OLAP, Data Mining and Real Application Testing options Export done in US7ASCII character set and AL16UTF16 NCHAR character set server uses WE8ISO8859P1 character set (possible charset conversion) About to export specified tables via Conventional Path ... . . exporting table X 2 rows exported . . exporting table Y 2 rows exported Export terminated successfully without warnings. [oracle@mediamath-server archs]$ imp impuser/impuser@mediamat FILE=/home/oracle/expdrec/exp.dmp LOG=/home/oracle/expdrec/exp.LOG ignore=y tables=y,x fromuser=scott touser=impuser Import: Release 10.2.0.4.0 - Production on Mon May 9 11:26:26 2011 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Export file created by EXPORT:V10.02.01 via conventional path Warning: the objects were exported by SCOTT, not by you import done in US7ASCII character set and AL16UTF16 NCHAR character set import server uses WE8ISO8859P1 character set (possible charset conversion) . importing SCOTT's objects into IMPUSER . . importing table "X" 127136 rows imported . . importing table "Y" 127209 rows imported IMP-00017: following statement failed with ORACLE error 2298: "ALTER TABLE "Y" ADD FOREIGN KEY ("AA_ID") REFERENCES "X" ("AA_ID") ENABLE" IMP-00003: ORACLE error 2298 encountered ORA-02298: cannot validate