Database

ORA-39087: directory name is invalid tips

steloflute 2013. 5. 22. 00:33
http://www.dba-oracle.com/t_ora_39087_directory_name_invalid.htm

 

 

 

ORA-39087: directory name is invalid tips

Expert Oracle Tips by Burleson Consulting

December 23, 2010

Question: I am getting the ORA-39087 error when running expdp:

$ expdp myschema/mypass DIRECTORY=MY_DATA_PUMP_DIRECTORY DUMPFILE=Test1.dmp logfile=Test1.log SCHEMAS=myschema

Export: Release xx.x.x.x.x - xxbit Production on Tuesday, xx xxxxxxxx, xxxx xx:xx:xx

Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release xx.x.x.x.x - xxbit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name MY_DATA_PUMP_DIRECTORY is invalid

How do I correct or avoid this ORA-39087 error?

Answer: Unlike the old exp export utility, with a data pump export you must specify a default database directory in which to place dump file set and log file before you perform any export or import operation. Failure to create a directory before performing an export will result in an error.

You need to grant read, write on directory MY_DATA_PUMP_DIRECTORY to system and your myschema.

Here are the two steps you must take to prepare the directory:

  1. Grant “create any directory” privilege to the export/import administrator.

    SQL> grant create any directory to myschema;
    Grant succeeded.

  2. Create a directory for dump file set and log file.

    SQL> create directory my_data_pump_directory as 'u01/oracle/export';
    Directory created.