0

I have a oracle database based on a server, and I want to import the data in the tables on the server. I am trying to use sqlloadr(sqlldr) for inserting all data in the oracle database, which is on localhost and there is no problem in this case, but the problem occurs while I try to connect a web-server(not localhost).

The command that I've used in localhost case:

sqlldr <usrname>/<password> control=table.ctl log=table.log ERRORS=25000

and following is concerning to web-server

sqlldr <usrname>/<password>@LABSERVER control=table.ctl log=table.log ERRORS=25000

where I created a tnsnames.ora as following:

LABSERVER =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(Host = <hostaddress>)(Port = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = <servicename>)
    )
  )

but I got this error:

SQL*Loader-704: Internal error: ulconnect:OCIServerAttache [0]

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

Any idea will be appreciated

0

5 Answers 5

2

We had a similar issue and did not have privileges to modify tnsnames.ora on local, so we had to specify the service in the command line like:

sqlldr userid=username/password@\"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myDBHost)(PORT= 1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=MYDBSID)))\" Control='mytable.ldr' Log='mytable.log'

thanks to https://hs2n.wordpress.com/2012/06/12/oracle-using-sqlplus-and-sqlldr-on-databases-without-tnsnames-entry/#comment-700

1

"where I created a tnsnames.ora which is like following:"

That seems to mean you have posted the TNSNAMES.ORA file from the database server.

Remember you also need a TNSNAMES.ORA file on the client. Is that correctly configured too?

1
  • the problem was that I had not found the TRASNAMES.ORA, so I created it and I put it in wrong folder, Thanks for your response
    – csuo
    Jun 4, 2011 at 10:47
1

if your password has a @ character , then sqlldr utility will not work , change ur password it will work http://www-01.ibm.com/support/docview.wss?uid=swg21347615

2
  • Thanks! Cant belive that was the problem. It happens even when you type the password at prompt.
    – Ughini
    Aug 16, 2019 at 14:33
  • The password need to be quoted like \"p@s\$word\"
    – VictorDDT
    Dec 17, 2020 at 2:00
0

Basically this error is telling you that given the host, port, protocol and service_name the client could not find a listening Oracle service. Make sure that your hostname is valid (e.g., you can ping it), that the listener is listening on 1521, and that the service_name in the server database is really the name you specified. You can verify it by issuing this command in sqlplus:

SHOW PARAMETER service_names

which tells you what the database is registering itself as with the listener.

0

For those, like me, who found this thread.

One thing to check: file permissions on the tnsnames.ora file.

For clients on the same machine yet not part of the DBA group and with ORACLE_HOME and ORACLE_BIN set correctly subject error was reported. File permissions of the tnsnames.ora file precluded world read; as the tnsnames.ora file could not be read 704 / 12514 thrown as service name could not be resolved.

From command prompt: chmod 644 $ORACLE_HOME/network/admin/tnsnames.ora

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.