Avatar of daniesh
daniesh

asked on 

will the error will affect the data in the target database?

Hi ,

I took a export of one schema and import it to other schema. user complains that some of the data has been not tranferred from source schema to target schema.
When i check the import log file.
IMP-00019: row rejected due to ORACLE error 2291
IMP-00003: ORACLE error 2291 encountered
ORA-02291: integrity constraint (PVW_DEV_OWNER.REL_139) violated - parent key not found

I found the error.
could you please tell me if i am getting this error, that means that data will not get imported to the target schema?
Oracle Database

Avatar of undefined
Last Comment
daniesh
Avatar of DrSQL - Scott Anderson
DrSQL - Scott Anderson
Flag of United States of America image

That's what it means.  The table with that constraint was not loaded.

Good luck!
Avatar of daniesh
daniesh

ASKER

from the above error how i wiil come to know which table is affected.
the table or constraint does not get imported or both.
SOLUTION
Avatar of DrSQL - Scott Anderson
DrSQL - Scott Anderson
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of daniesh
daniesh

ASKER

how to prevent this error?
Avatar of daniesh
daniesh

ASKER

we have to below query  on source schema.
select table_name,r_constraint_name from user_constraints
 where constraint_name='REL_139';
Shouldn't matter which schema, actually.  Preventing this - I'd need to know the options you used to run the export and the options on the import.
Avatar of daniesh
daniesh

ASKER

we had LOB objects in source schema.
what we do we first take the export of source schema.
the exp command is
exp username/password file=name.dmp log=name.log consistent=n buffer=somevalue
then we drop the target schema and again recreate the target schema.
as there is a LOB object in the source schema we first create the structure of the source schema. for this we run the below imp command.
imp username/passwd file=expfile.dmp log=name.log fromuser=sourceschemaname touser=targetschemaname index=name.sql
after running the above command structure get created.
we again run the below imp command
imp username/passwd  file=expfile.dmp log=name.log  fromuser=sourceschemaname touser=targetschemaname  ignore=y
please let me know what needs to be done so that all the data get imported in the target schema as user is running behind me.
he is asking me to give the list of table which get affected.
how to do that?
please help me?
Avatar of daniesh
daniesh

ASKER

how do i find which table got affected .
i run the above query connecting as sys.
i got the result as
no rows selected.
i see the same errror in the whole log imp file.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of daniesh
daniesh

ASKER

thanks for the help,
the thing is that the user is asking for table which got affected from the log file.
from the above error how can i find the table.
could you please let me know?
I am confused.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of daniesh
daniesh

ASKER

thank for all your time.
If I will take import next time, then i have to take using imp parameter constraint=n
so that in future i can prevent this error.
i have one doubt if i will use parameter constraint =n then  constraint will not get imported.
please correct if i am wrong.
daniesh,
    The parameter "constraint=n" does not mean to disable constraints.  On the export command it means do not include the definition of any constraints (primary keys, foreign key references, checks, and others) in the export file.  On the import command it means do not apply any constraints found in the import file to the database objects being imported.  But if you have already created an exact copy of the schema and are just bringing in the data, then the "constraint=n" will have no effect because you already HAVE constraints.  The only way to disable them is to use the commands I gave you, or don't create the constraints when you build the objects in the target schema.

Good luck!
Avatar of daniesh
daniesh

ASKER

The thing is that i got an integrity constraint errror violated error.
now in future whenever i refresh the schema, i dont want prevent this error?
how to overcome this?
i know that i am asking too much
please help me?
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
ASKER CERTIFIED SOLUTION
Avatar of daniesh
daniesh

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of daniesh
daniesh

ASKER

thanks for the help.
i appreciate the way you explain me the whole concept.
Avatar of daniesh
daniesh

ASKER

I need to know how to disable the constraint for the particular schema.
Oracle Database
Oracle Database

Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.

81K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo