Oracle Database – Enterprise Edition
Information in this document applies to any platform.
Evidence
Datapump export schema job fails with errors:
[oracle@lovetech exp_dir]$ expdp scott/xxxxx@dbaprod schemas=SCOTT directory=datapump dumpfile=SCOTTSC.dmp logfile=expdpSCOTT.log
Export: Release 11.2.0.1.0 – Production on Wed Sep 8 23:58:24 2021
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.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-39087: directory name DATAPUMP is invalid
Findings
The directory DIRECTORY_NAME and DIRECTORY_PATH exists as can be seen below.
Determine if the logical directory path exist
SQL> desc dba_directories;
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
DIRECTORY_NAME NOT NULL VARCHAR2(30)
DIRECTORY_PATH VARCHAR2(4000)
SQL> select OWNER,DIRECTORY_NAME,DIRECTORY_PATH from dba_directories where DIRECTORY_NAME=’DATAPUMP’;
OWNER DIRECTORY_NAME
DIRECTORY_PATH
SYS DATAPUMP
/u01/exp_dir
SQL> !ls -l /u01/exp_dir
total 928
-rw-r–r–. 1 oracle oinstall 1725 Sep 9 00:03 expdpSCOTT.log
-rw-r–r–. 1 oracle oinstall 143 Sep 8 23:53 expdpscott.par
-rw-r–r–. 1 oracle oinstall 1875 Sep 8 23:35 scott.log
-rw-r—–. 1 oracle oinstall 180224 Sep 8 23:54 scotts_01.dmp
-rw-r—–. 1 oracle oinstall 45056 Sep 8 23:54 scotts_02.dmp
-rw-r—–. 1 oracle oinstall 221184 Sep 9 00:03 SCOTTSC.dmp
-rw-r—–. 1 oracle oinstall 241664 Sep 8 23:35 scotts.dmp
-rw-r–r–. 1 oracle oinstall 1759 Sep 8 23:54 scotts.log
-rw-r—–. 1 oracle oinstall 196608 Sep 8 23:48 scottss_01.dmp
-rw-r—–. 1 oracle oinstall 49152 Sep 8 23:48 scottss_02.dmp
Cause
Scott user was not granted read, write privileges to datapump directory.
SOLUTION
Grant read write permission to user performing the export (scott) and kick off the export again
SQL> grant read,write on directory datapump to scott;
Grant succeeded.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@lovetech exp_dir]$ expdp scott/xxxxx@dbaprod schemas=SCOTT directory=datapump dumpfile=SCOTTSC.dmp logfile=expdpSCOTT.log
Export: Release 11.2.0.1.0 – Production on Thu Sep 9 00:02:45 2021
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting “SCOTT”.”SYS_EXPORT_SCHEMA_01″: scott/@dbaprod schemas=SCOTT directory=datapump dumpfile=SCOTTSC.dmp logfile=expdpSCOTT.log
Estimate in progress using BLOCKS method…
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported “SCOTT”.”DEPT” 5.937 KB 4 rows
. . exported “SCOTT”.”EMP” 8.570 KB 14 rows
. . exported “SCOTT”.”SALGRADE” 5.867 KB 5 rows
. . exported “SCOTT”.”BONUS” 0 KB 0 rows
Master table “SCOTT”.”SYS_EXPORT_SCHEMA_01″ successfully loaded/unloaded
Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
/u01/exp_dir/SCOTTSC.dmp
Job “SCOTT”.”SYS_EXPORT_SCHEMA_01″ successfully complete
The Datapump job runs successfully after granting read, write permission on directory datapump to scott
Note: The use of any materials on this website is at your own risk. It is provided for educational purposes only. It has been tested internally, but we do not guarantee that it will work for you. We recommend you test in your test environment before using.
Recent Comments