ERROR 704 & 12154 while connecting sqlloader to server
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
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
"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?
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.
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
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
精彩评论