Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Import of external table fail because directory object doesn't exist

PyrocksDec 23 2012 — edited Dec 24 2012
Hi,

In our databases we have a few external tables which rely on files that can be located in different physical directories, and these directories are being created dynamically.
loading these files is not an issue since we can create directory objects dynamically - and it works great.
The directory names are created as 'AUTO_GENERATED_DIR_n' where n is derived from a sequence - we cannot reuse directory names because of certain limitations.

The problem starts when trying to import the extenral table from an expdp export - they exist in the export with the latest directory object used (in example DEFAULT DIRECTORY AUTO_GENERATED_DIR_1), and then impdp fails to import them to a database where the dynamically created directory objects don't exist (AUTO_GENERATED_DIR_1 doesn't exist).

how can we bypass it?
Is there a way to do a transform - like can be done on types using TRANSFORM=oid:n:type ?
or maybe remap all directory objects to a directory object that i can assure exists in all of our DBs ?

Since i'm not familiar with such switches - I thought about an alternative, but it is also problematic:
change the default directory of all external tables before the export to a directory that exists in all DBs, but for that we must ensure that no one will be changing the default dir during the export or by the time the export is issued (and in 99% of the time this will happen because files are being loaded all the time and we can't stop everything from working).
We can also try to pre-create all possible directory object names in all DBs but i want to avoid it as it is both ugly and not 100% failsafe.

any suggestions would be more than welcome.
thanks
-Mor
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 21 2013
Added on Dec 23 2012
11 comments
1,309 views