oracle-databaseoracle19cexpdp

export table with expdp oracle


I am trying to export a table from my oracle database with SID=DB034 with username=b034. I am using this command:

expdp b034/aDmin123456789@DBB034 tables=B034.BIL_CUSTOMER_GROUP, DEPT directory=exp_test dumpfile=dump_test.dmp logfile=log_test.log

My directory is correct and also I had granted privileges to b034 user. After running the command I get this error:

ORA-12154: TNS:could not resolve the connect identifier specified

Can anyone help me with this?


Solution

  • The most common cause of ORA-12154 is that database alias (DBB034) can't be found in TNSNAMES.ORA file (the one expdp is using. If you have more than a single Oracle product installed on your computer, I suggest you use TNS_ADMIN environment variable. Say if you need instructions).

    That's something like old-fashioned telephones - you're trying to call someone, but can't find their name in any phone book.

    So, what to do? Add DBB034 into TNSNAMES.ORA.


    As you asked (in a comment) how TNSNAMES.ORA alias looks like, here you are:

    DBB034=
      (DESCRIPTION=
        (ADDRESS=
          (PROTOCOL=TCP)
          (HOST=11.222.33.44)        --> put host name or its IP address here
          (PORT=1521)                --> usually 1521, but doesn't have to be
        )
        (CONNECT_DATA=
          (SERVICE_NAME=dbb034)      --> lucky guess; maybe it is called differently
        )
      )
    

    Basically, if you aren't sure what to put in there, ask your DBA, they know.