Link to home
Create AccountLog in
Avatar of walkerdba
walkerdba

asked on

expdp utility

[oracle@new ~]$ expdp scott/tiger schemas=scott directory='/backup/dpump' dumpfile=dpump.dmp logfile=dpump.log

Export: Release 11.2.0.1.0 - Production on Sun Jul 14 19:58:07 2013

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 - 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 /BACKUP/DPUMP is invalid


[oracle@new ~]$
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Also the Oracle user acct has to be granted read priv on the ee_dir.
Avatar of walkerdba
walkerdba

ASKER

Why it is like this?


[oracle@new ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Jul 14 22:18:00 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create or replace directory ee_dir as '/BACKUP/DPUMP';


Directory created.

SQL> SQL> grant read, write on directory ee_dir to dpump;

SQL> grant read, write on directory ee_dir to dpump;
grant read, write on directory ee_dir to dpump
                                         *
ERROR at line 1:
ORA-01917: user or role 'DPUMP' does not exist


SQL> grant read, write on directory ee_dir to DPUMP;
grant read, write on directory ee_dir to DPUMP
                                         *
ERROR at line 1:
ORA-01917: user or role 'DPUMP' does not exist


SQL>  grant read, write on directory ee_dir to SCOTT;

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@new ~]$ expdp scott/tiger@orcl tables=emp,tab1 DIRECTORY=ee_dir DUMPFILE=tab.dmp logfile=emp1.log

Export: Release 11.2.0.1.0 - Production on Sun Jul 14 22:40:17 2013

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

UDE-12545: operation generated ORACLE error 12545
ORA-12545: Connect failed because target host or object does not exist

[oracle@new ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Jul 14 22:45:03 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$database;

NAME
---------
ORCL

SQL> conn scott/tiger
Connected.
SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
BONUS                          TABLE
DEPT                           TABLE
EMP                            TABLE
SALGRADE                       TABLE
TAB1                           TABLE
TAB2                           TABLE

6 rows selected.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@new ~]$ expdp scott/tiger@orcl tables=emp,tab1 DIRECTORY=ee_dir DUMPFILE=tab.dmp logfile=emp1.log
Is the tnsnames.ora has been configured in the system, as you are trying to connect using connect string.

you can set the SID and run the expdp command i.e.

[oracle@new ~]$export ORACLE_SID=ORCL


[oracle@new ~]$ expdp scott/tiger@orcl tables=emp,tab1 DIRECTORY=ee_dir DUMPFILE=tab.dmp logfile=emp1.log
Are you asking why you got an error granting to "DPUMP"?

The error message explains it,  there is no user named DPUMP, nor is there a role named DPUMP.

Even if there were such a user, you're logging in as SCOTT, so it wouldn't help to grant privileges to dpump.

If you're asking about the connection error, praveencpk has mentioned that above.  Make sure "orcl" is defined in your tnsnames or ldap if you're using that.  

Setting ORACLE_SID isn't necessary though since your providing the tns alias in the expdp command line @orcl
[oracle@new ~]$ export ORACLE_SID=orcl
[oracle@new ~]$ expdp scott/tiger@orcl tables=emp,tab1 DIRECTORY=ee_dir DUMPFILE=tab.dmp logfile=emp1.log

Export: Release 11.2.0.1.0 - Production on Mon Jul 15 06:34:41 2013

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

UDE-12545: operation generated ORACLE error 12545
ORA-12545: Connect failed because target host or object does not exist

[oracle@new ~]$
Walker, would it help to think of the ee_dir as a synonym, or alias, to the physical path on the host?  The permissions, and use in the utility, don't care what the O/S path is; just the alias.  You can change the O/S target, then, (and the alias) without breaking the SQL scripts.

HTH
setting ORACLE_SID doesn't help


is orcl defined in your tns lookup methods?

what does this produce?

tnsping orcl


and check that the path is something that oracle itself has access to read (not scott, not your OS user,  the "oracle" OS user)
[oracle@new admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-JUL-2013 16:29:23

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

TNS-01106: Listener using listener name LISTENER has already been started
[oracle@new admin]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-JUL-2013 16:29:30

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
[oracle@new admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-JUL-2013 16:29:41

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /oracle/app/oracle/product/11.2.0/db1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /oracle/app/oracle/product/11.2.0/db1/network/admin/listener.ora
Log messages written to /oracle/app/oracle/diag/tnslsnr/new/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=new)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                15-JUL-2013 16:29:41
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/11.2.0/db1/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/new/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=new)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@new admin]$ expdp scott/tiger@orcl tables=emp,tab1 directory=mydir1 dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log

Export: Release 11.2.0.1.0 - Production on Mon Jul 15 16:30:03 2013

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

UDE-12514: operation generated ORACLE error 12514
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

[oracle@new admin]$
>>ORA-12514: TNS:listener does not currently know of service requested in connect descriptor<<

It clearly states that the ORCL services is not register in the listener. Also as i mention in my previous post did you check the tnsnames.ora file.

what is the result you are getting by executing the below command.
 
[oracle@new admin]$ tnsping ORCL
$ tnsping orcl

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 16-JUL-2013 10:06:47

Copyright (c) 1997, 2009, Oracle.  All rights reserved.

Used parameter files:
/oracle/app/oracle/product/11.2.0/db1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = new)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (50 msec)
[oracle@new OC4J_DBConsole]$
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
http:#a39325563  answers the original question.

There were several add-ons there were also answered, by myself and others but the original question was answered in the first post.