I got “ORA-39070: Unable to open the log file. ” error in Oracle database.
Details of error are as follows.
#> expdp ankush/thavali directory=datapump_dir dumpfile=full.dmp full=y logfile=full.log
Copyright (c) 2003, 2017, Oracle. All rights reserved.
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
Unable to open the log file
This ORA-39070 errors are related with the directory object and granted read/write access to the directory.
Make sure that the /export/dump directory has 660 permission.
To solve this error, create or replace your directory and grant the following priviliges to user.
create directory datapump_dir as '/export/dump';
grant read,write on directory datapump_dir to ankush;
grant datapump_exp_full_database to ankush;
grant datapump_imp_full_database to ankush;
Then now try to execute expdp command, it will work fine.
If you got this error on the Windows system, 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
b. Check with the Windows Explorer that the directory d:\ exists at OS level
c. From cmd window set ORACLE_SID= 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 using UTL_FILE Package from sqlplus in this DB.
Note:
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.