Load data to remote DB using sqlldr
I wanted to load data to remote db using sqlldr.I did it using following command
>sqlldr GANUKA/GANUKA@jdbc:oracle:thin:@172.21.0.180:1521:orcl control=D:\Work\CLSTMAS.ctl
log=D:\Work\CLSTMAS.log
But it gives the following error.
SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
ORA-12154:开发者_StackOverflow社区 TNS:could not resolve the connect identifier specified
Need a help
You're mixing up two different worlds here. One is the OCI world where sqlldr lives. It expects Oracle instance names defined in TNSNAMES.ORA (or a similar service). The other world is the JDBC world that uses connection identifiers with words like "jdbc" or "thin".
So you have two options:
If your environment has a proper TNS setup, you have to change the command line to something like
sqlldr GANUKA/GANUKA@MONTY.CORP control=...
If not, you can use an Easy Connect string:
sqlldr GANUKA/GANUKA@//172.21.0.180:1521/orcl control=...
I ended up having to use a thin client connection string. I couldn't get @Codo 's solution to work.
sqlldr \'username/passwd@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost.com)(PORT=1111)))(CONNECT_DATA=(SID=MYSIDE)(SERVER=DEDICATED)))\' control=loader.ctl data=data.csv
精彩评论