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: TNS:could not resolve the connect identifier specified
Need a help
If your environment has a proper TNS setup, you have to change the command line to something like sqlldr GANUKA/[email protected] control=... If not, you can use an Easy Connect string: sqlldr GANUKA/GANUKA@//172.21. 0.180:1521/orcl control=...
SQL*Loader uses the field specifications in the control file to interpret the format of the datafile, parse the input data, and populate the bind arrays that correspond to a SQL INSERT statement using that data. The Oracle database accepts the data and executes the INSERT statement to store the data in the database.
SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database. Its syntax is similar to that of the DB2 load utility, but comes with more options. SQL*Loader supports various load formats, selective loading, and multi-table loads.
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/[email protected] 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With