Wednesday, January 11, 2017

ORA-39087: directory name MY_DATA_PUMP_DIRECTORY is invalid

When performing a database export using the expdp utility you can run into an error like:

expdp <user>/<passwd> schemas=<schema_to_be_exported> dumpfile=my_dmp_file.dmp logfile=my_log_file.log

ORA-39002: invalid operation 
ORA-39070: Unable to open the log file. 
ORA-39087: directory name MY_DATA_PUMP_DIRECTORY is invalid

That happens because the current user default output directory is not defined.

To solve that, grant “create any directory” privilege to your user:


SQL> grant create any directory to <user>;

Grant succeeded.


And then create a directory to be used by the expdp utility:


SQL> create directory my_data_pump_directory as '/tmp/db_dmp';

Directory created.

1 comment:

Note: Only a member of this blog may post a comment.