Ошибка ora 39002

May 10, 2021

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


invalid operation

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.

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.”

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

 1,603 views last month,  3 views today

Error:

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

Error occurred in Oracle EXPDB backup because directory path in not exists in Windows / Linux

Solution:

Step 1: Please check the directory which you used in expdp directory parameter.

expdp directory=dbbackup

Step 2: Login with sysdba and check the directory path.

Select * from dba_directories where directory_name = 'DBBACKUP';

Step 3: Check the path shown in above queries and check in Windows / Linux is path is correct.

I am using data pump to perform an import on 4 .dmp files and keep on receiving the set of errors as below:

ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation

I am new to oracle and cannot find a helpful solution.

I am performing the import as in here, although I’m using oracle 12c.

The command I run in the windows command like looks like this:

impdp user/pass@db_name directory=DUMP_DIR dimpfile="file_name.dmp" schemas=schema_name content=all parallel=4

DUMP_DIR is created in oracle and appropriate privs were granted.

I also ran this command with

... logfile=file_name.log

added at the end but I’m not sure if the log file was created or where it was saved.

I have found this — it’s about exactly the same set of errors but on export and on linux. At the end of the answer there’s a sentence ‘If we are on a Windows machine, then we need to make sure that both the listener and the database have been started with the exact same username.’ Is this useful in case of import? If yes — what does it mean exactly?

While taking export backup of database using expdp i faced below error,

ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at “SYS.UTL_FILE”, line 536
ORA-29283: invalid file operation

The error occurs because expdp logfile can not be opened on ASM Diskgroups. to resolve this error, change the logfile location to local path (Local Directory), pointes to the directory  DATA_PUMP_DIR

[oracle@gridone ~]$ expdp directory=expdp dumpfile=TESTONE_290616.dmp logfile=TESTONE_290616.log full=y

Export: Release 11.2.0.4.0 - Production on Wed Jun 29 16:15:58 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
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-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation

Database server details are as follows:

Hostname: gridone
OS : RHEL 5.2
Cluster : No
Oracle Grid (ASM) : Yes
Database version: 11.2.0.4
Name of database : TESTONE
Export Dump Directory : Created on ASM Diskgroup

I have created a directory on ASM diskgroup, so the dumpfile will be stored on ASM disks

SQL>create directory EXPDP as '+DATA/TESTONE/EXPBKP';

SQL> select * from dba_directories;

OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS EXPDP
+DATA/TESTONE/EXPBKP

SYS XMLDIR
/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/xml

SYS ORACLE_OCM_CONFIG_DIR
/u01/app/oracle/product/11.2.0/dbhome_1/ccr/hosts/gridone/state


OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS DATA_PUMP_DIR
/u01/app/oracle/admin/TESTONE/dpdump/

SYS ORACLE_OCM_CONFIG_DIR2
/u01/app/oracle/product/11.2.0/dbhome_1/ccr/state

The error occurs because expdp lofile can not be opened on mentioned ASM Diskgroups location, to resolve this error, change the logfile location to local path (Local Directory), pointe to the directory  DATA_PUMP_DIR. DATA_PUMP_DIR , directory is created at the time of installation with path ‘/u01/app/oracle/admin/TESTONE/dpdump/’

OR

use nologfile=y

nologfile=y will not create any logfile for export backup

After poining logfile to local directory, my export backup completed successfully.

[oracle@gridone ~]$ expdp directory=expdp dumpfile=TESTONE_290616.dmp logfile=DATA_PUMP_DIR:TESTONE_290616.log full=y

Export: Release 11.2.0.4.0 - Production on Wed Jun 29 16:21:04 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Starting "SYS"."SYS_EXPORT_FULL_01": /******** AS SYSDBA directory=expdp dumpfile=TESTONE_290616.dmp logfile=DATA_PUMP_DIR:TESTONE_290616.log full=y
Estimate in progress using BLOCKS method...
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 56.56 MB
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SYS_USER/USER
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/ROLE

I am running data import using data pump impdp (Oracle 11g)

impdp system directory= DATA_PUMP_DIR dumpfile=myschema.dmp logfile=myschema.log schemas=’MYSCHEMA’

I get prompted for password and after I enter it, the import seems to take off but then I get an error:

Import: Release 11.1.0.7.0 — 64bit Production on Tuesday, 21 May, 2013 8:27:58

Copyright (c) 2003, 2007, Oracle.  All rights reserved.
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 — 64bit 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-29283: invalid file operation
ORA-06512: at «SYS.UTL_FILE», line 536
ORA-29283: invalid file operation

I su as an oracle user and run the tool under system account. DATA_PUMP_DIR is defined and I cd into it before running the impdp

Usually this error occurs when the user does not have read and write permissions to DATA_PUMP_DIR, but system user would not have this issue, would it?

Can anyone help to resolve this issue?

Понравилась статья? Поделить с друзьями:
  • Ошибка ora 32004
  • Ошибка ora 305500
  • Ошибка ora 28040
  • Ошибка ora 28001
  • Ошибка ora 2000