I got ” ORA-39002: invalid operation ” error in Oracle database.
ORA-39002: invalid operation
Details of error are as follows.
[[email protected] ~]$ expdp mehmet/deveci DIRECTORY=datapump_dir DUMPFILE=mehmet.dmp logfile=mehmet.log schemas=mehmet With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-39087: directory name datapump_dir is invalid
This ORA-39002 error is related with the read, write access to the directory or existing of directory.
1. The Data Pump Export can fail with the following errors:
#> expdp system/<password> directory=<directory_name> dumpfile=<dump_name>.dmp logfile=<log_name>.log Export: Release 10.2.0.4.0 - 64bit Production on Thursday, 05 March, 2009 10:43:55 Copyright (c) 2003, 2007, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production with the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 488 ORA-29283: invalid file operation
2. DataPump export fails with same errors even after dropping and re-creating the DataPump utility and re-creating the directory.
Can report the following errors when attempt to run a datapump export
ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 488 ORA-29283: invalid file operation
Follow the next steps to progress this issue:
1. Run expdp using the following steps:
a. Using Windows Explorer create a new directory in D drive called <OS_directory_name>
b. Check with the Windows Explorer that the directory d:\<OS_directory_name> exists at OS level
c. From cmd window set ORACLE_SID=<SID of your database> and within a sqlplus session execute:
connect / as sysdba SQL> create or replace directory <directory_name> as 'd:\<OS_directory_name>'; SQL> grant read,write on directory <directory_name> to system;
2. Execute the datapump export dump using the following command:
set ORACLE_SID=<SID of your database> expdp system/<password> directory=<directory_name> dumpfile=<dump_name>.dmp full=y content=metadata_only logfile=<log_name>.log
Note: Do not use sqlnet connection for the export execution. This is only for test purposes. Run expdp using exactly with the above steps. If the issue still reproduces then please execute Step 3 to make sure there is no issue with the directory.
3. Attempt to write a file in the <directory_name> directory using UTL_FILE Package from sqlplus in this DB.
- After changing the file ownerships/permissions etc. the database and listener should be bounced so that they correctly read the updated changes.
- When EXPDP is calling the UTL_FILE pkg, there isn’t a way to know that the problem is related to the temp file until you run the export with the FULL=y and CONTENT=METADATA_ONLY parameters.”
205 views last month, 4 views today