Mark Harrison Mark Harrison - 1 year ago 105
Linux Question

installing Oracle Instantclient on Linux without setting environment variables?

Oracle's instructions specify setting LD_LIBRARY_PATH. This makes my application dependent on random users' configuration and is very troublesome to set up.

How can I avoid having to set any environment variables?

related note for OS/X: installing Oracle Instantclient on Mac OS/X without setting environment variables?

Answer Source

Oracle's instantclient installation instructions specify that the user set LD_LIBRARY_PATH. This is very troublesome to manage for multiple users.

To use the instantclient without setting any environment variables:

Download the instantclient distribution from For doing non-java software development, you will need (assuming Oracle 10.2):

Unzip the three files. This will give you a directory


Copy the files to /usr, which is one of the default places the dynamic loader searches.

sudo cp instantclient_10_2/sdk/include/*.h /usr/include
sudo cp instantclient_10_2/sqlplus         /usr/bin
sudo cp instantclient_10_2/*.so*           /usr/lib

If you use tnsnames.ora, copy it to /etc, which is the default global place the oracle runtime searches.

sudo cp tnsnames.ora /etc

Test with

/usr/bin/sqlplus scott/tiger@myoracle
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download