Saturday, 24 July 2010

datapump nightmares

give me the old imp/exp

if someone gives you a simple task to datapump your way to victory, don’t trust em.

Datapump uses this thing called a directory to tell it where to grab the dump files from.

The parfile will look something like:

# PY impdp parfile
schemas=PRODCTL,PRODDTA
remap_schema=PRODCTL:CRPCTL,PRODDTA:CRPDTA
table_exists_action=truncate
content=data_only
directory=data_pump_myriad_dir
dumpfile=prod.dmp
logfile=crp_impdp.log  
job_name=crp_impdp

Note that this has the remap, which is guaranteed to generate REDO – thanks oracle!

But where is this pointing to? directory=data_pump_myriad_dir

look no further than: SELECT * FROM DBA_DIRECTORIES !  OF course you think!

Use the following to create a directory in the table:

create directory some_dir;
grant read, write on directory some_dir to micky_mouse;

1 comment:

Craig VdV said...

Oracle directories ain't so bad once you get used to the concept. I agree it took me a while though. :)
NB#1 if you're impdp-ing more than just data you'll also need the remap_tablespace param in the parfile.
NB#2 if you perform a metadata_only impdp you'll need to "unlock" the table statistics afterwards, so using content=all might be preferred.

Extending JDE to generative AI