Question

I am trying to import data to an Oracle database. I have ".imp" and ".dmp" files for importing data. The database is using port 1521 and database name is "DB". I have tried the following command, but doesn't work.

impdp root/password@xxx.xxx.xxx.xxx:1521:DB 
    dumpfile=transmart.dmp
    logfile=transmart.imp
    schemas=i2b2hive,i2b2metadata,i2b2sampledata,i2b2demodata,i2b2workdata
             ,biomart,biomart_user,deapp,searchapp,tm_cz,tm_lz,tm_wz

ERROR: either ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA or ORA-12545: Connect failed because target host or object does not exist

I can telnet the IP and port with no problem.

Can anyone suggest please?

Thanks!

Was it helpful?

Solution

You have a syntax error in your EZConnect string.

Try this instead (no need to fuss with tnsnames.ora this way):

impdp root/password@xxx.xxx.xxx.xxx:1521/DB

Notice the replacement of the ":" with a "/" between port and service name.

As a side note, I long ago got out of the habit of putting passwords in command lines, where they may be easily snooped while the command is running. Let the program prompt you for the password:

impdp root@xxx.xxx.xxx.xxx:1521/DB

Especially if you're going to use root for your commands ;-)

OTHER TIPS

Your reference to telnet suggests you are running this from a remote client rather than locally on the database server.

You need to edit your client's TNSNAMES.ORA file with the location information for DB. Perhaps you think you've already done this, in which case you've probably introduced a typo or got the syntax wrong.

The other thing to check is that the listener is running on the database server, as that's a very common cause of ORA-12545.

to import the latest transmart database dump we used the following:

wget https://github.com/transmart/transmartApp-DB/zipball/master
unzip master
tar zxvf transmart.dmp.tar.gz
cp transmart.dump /u01/app/oracle/admin/XE/dpdump
chown oracle:dba /u01/app/oracle/admin/XE/dpdump/transmart.dmp
impdp SYSTEM dumpfile=transmart.dmp logfile=transmart3.log full=y

If you don't use the full=y you will end up missing a number of tables. Hope this is still useful to you or someone else.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top