user1570194
user1570194

Reputation: 37

Oracle DB Export does not preserve order or dependencies

I'm trying to export an Oracle DB using Oracle SQL Developer having tables, sequences, view, packages, etc. with dependencies on each other.

When I use Tools -> Database Export and select all DDL options, unfortunately the exported SQL file does not preserve the other that is some DB objects should be created before some other.

Is there a way to make the DB export utility preserve object dependencies/order? Or Is there any other tool do you use for this task?

Thank you

Upvotes: 2

Views: 501

Answers (1)

user123664
user123664

Reputation:

Normally expdp does a pretty good job. Problems arise when there are dependencies on objects/users that are not part of the dump. This is because the counter part, impdp, does not add grants on objects that are not created by impdp. I call that the 'not created by me syndrome' that impdp has.

If you have no external dependencies (external meaning to schema's that are not part of the dump), expdp/impdp do a good job for you. You might not be able to use it if you can not have access to the database server since expdp writes it's files on the database server.

If you happen to have access to a database server that is able to connect to the original database, you could pull the data over into your local database using a database link.

Upvotes: 1

Related Questions