8

I tried to install Oracle instant client on a redhat machine. I have instantClient basic, sdk, and sqlplus but I could not find any sqlldr. Can some one help me do it? Thanks

Masih
  • 1,633
  • 4
  • 19
  • 38
  • `sqlldr` is part of the server installation. – mustaccio Aug 26 '15 at 17:11
  • At http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html sqlldr is not listed as being a component of the instant client. It is probably available with the full client install. – Shannon Severance Aug 26 '15 at 18:46
  • @ShannonSeverance, Where can I find full client? – Masih Aug 28 '15 at 16:08
  • 1
    It's sort of [possible](http://www.nyoug.org/Presentations/2007/200703_Ji_Instant%20Client.pdf) to add SQL\*Loader to Instant Client, apparently - I haven't tried and am not advocating that. But you'd need the full client anyway; you can get that from the [database installer](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html), so you might as well just use that. Before you do, have you considered using external tables instead? – Alex Poole Aug 28 '15 at 17:26

3 Answers3

19

Following the information @Alex Poole provided in his comment, I was able to add the sqlldr binary to an Oracle instant client installation on redhat linux. The key is to have access to a full oracle client (or database) installation from which to obtain the sqlldr binary.

In summary here was the process I took with Oracle 11.2.0.3.0:

Install Oracle Instant Client

Download from oracle instant client rpms:

  • oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
  • oracle-instantclient11.2-jdbc-11.2.0.3.0-1.x86_64.rpm
  • oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
  • oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm

Install:

yum install oracle* --nogpgcheck

Create Oracle Environment Variables

In /etc/profile.d/oracle.sh

export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin

Copy sqlldr and message file from full Oracle client/database

[root@redhat bin]# pwd
/usr/lib/oracle/11.2/client64/bin
[root@redhat bin]# scp root@oracleServer:/OracleHome/db/product/11gR2/bin/sqlldr .

Try it:

[root@redhat bin]# sqlldr
Message 2100 not found; No message file for product=RDBMS, facility=ULMessage 2100 not found; No message file for product=RDBMS, facility=UL

We need to copy over the ulus.msb file from the Oracle database. But first we need to create the proper directory structure:

[root@redhat client64]# pwd
/usr/lib/oracle/11.2/client64
[root@redhat client64]# mkdir -p rdbms/mesg
[root@redhat client64]# scp root@oracleServer:/OracleHome/db/product/11gR2/rdbms/mesg/ulus.msb rdbms/mesg/

With the message file in place, try again:

[root@redhat client64]# sqlldr

SQL*Loader: Release 11.2.0.3.0 - Production on Tue Oct 20 10:12:55 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Usage: SQLLDR keyword=value [,keyword=value,...]
....

Success!

Brice Roncace
  • 10,110
  • 9
  • 60
  • 69
  • 2
    Works, but some of the steps are not needed. You can just use the basic client zip file, without needing to install anything: With the instantclient-basic-linux.x64-12.1.0.2.0.zip extracted to ./instantclient/, all that you need to do is to add the folder ./instantclient/rdbms/mesg/ folder and the file ./instantclient/rdbms/mesg/ulus.msb, and then add the ./instantclient folder to both your PATH and LD_LIBRARY_PATH variables. – jmiserez Nov 01 '16 at 11:55
2

Install oracle-instantclient12.2-tools, which has sqlldr; and make sure your PATH includes /usr/lib/oracle/12.2/client64/bin.

Adjust versions accordingly.

vesperto
  • 804
  • 1
  • 6
  • 26
  • You'll probably also need to ensure that your library path includes a reference to the lib directory as well i.e. export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib – Dom G Oct 26 '21 at 16:49
1

Simpler alternative to the accepted answer that does not require an existing full client install to steal the sqlldr binary from:

You can download SQL loader from OTN in a separate instant client package called "Instant Client Package - Tools: Includes Data Pump, SQL*Loader and Workload Replay Client"

Here is the link for linux: Instant Client Downloads for Linux x86-64

Otto
  • 1,787
  • 1
  • 17
  • 25
  • When adding an answer to an older question with an existing accepted answer it can be helpful to discuss how your answer differs and what new information it brings to the question. For example is the link that you provide a better one that the one that Alex left in his comment? – Jason Aller Jan 30 '18 at 16:48