Install Oracle Instant Client on Ubuntu (Linux)

To Access Oracle form the Ubuntu Linux as its open Source Platform, is easy and its installation process is also easy. As Oracle instant client is a free tool that is provided by Oracle Corporation and easily available on Oracle website. This client is are available for every Platform like Windows, Linux,Unix and all other platform. Latest Version of Oracle Instant client is 12.2 which is for all platform like windows, Linux x86-64 and all other platforms. you can download this on this

Every one need Basic Instant Client or Basic-Lite..

First you need to download these 3 packages that you can download from

  1. oracle-instantclient12.2-basic-
  2. oracle-instantclient12.2-sqlplus-
  3. oracle-instantclient12.2-devel-

These Packages that you can download from website keep these all RPM file in one folder and now open the command line of Ubuntu install alien package on Ubuntu. this package convert the .RPM file into .Deb file that are executable on Ubuntu Linux.

sudo apt-get install alien

after installing alien on Ubuntu now install the RPM package on Ubuntu using alien.

sudo alien -i oracle-instantclient12.2-basic-

sudo alien -i oracle-instantclient12.2-sqlplus-

sudo alien -i oracle-instantclient12.2-devel-

after installing these packages now try to connect the oracle instant client with oracle with following string.

sqlplus username/password@//dbhost:1521/SID

While exeucting sqlplus if you got error that sqlplus: command not found then you need to add ORACLE_HOME variables. so first install libaio1

sudo apt-get install libaio1

sudo apt-get install libaio1:i386  —(32 bit instant client on 64 bit OS)

Oracle Libraries Integration

if sqlplus is complain about the missing libraries then you can add the libraries to the LD_LIBRARY_PATH using the following command.

export LD_LIBRARY_PATH=/usr/lib/oracle/<version>/client(64)/lib/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

for Example if the version 12.2 and Linux x86-64 the you will execute the following command.

export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client(64)/lib/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

now Execute the following command to add it to the system library list, create new file as follow

sudo vi /etc/ && sudo chmod o+r /etc/    and add /usr/lib/oracle/12.2/client64/lib/   (for 64 bit OS)   /usr/lib/oracle/12.2/client/lib/   ( for 32 bit OS)

now run:-  sudo ldconfig


Oracle database applications look for Oracle software in the location specified in the environment variable ‘ORACLE_HOME’.

 to define this variable in a system-wide location.

sudo sudo vi /etc/profile.d/ && sudo chmod o+r /etc/profile.d/ 

Add the following Line : –

export ORACLE_HOME=/usr/lib/oracle/<version>/client(64)

For example

export ORACLE_HOME=/usr/lib/oracle/12.2/client64

Alternatively, each user can define this in their ~/.bash_profile

 sqlplus was not recognized as a command untill the following line was also included in the file:


Fixing SDK

The instant client sometimes places the include files, such as oci.h, in /usr/include/oracle/<version>/client.

Run Following command to identify

ls -d /usr/include/oracle/*/client*/*

if  ORACLE_HOME, and it is located over in /usr/include/oracle/ , create a symbolic link 

sudo ln -s /usr/include/oracle/12.2/client $ORACLE_HOME/include


sudo ln -s /usr/include/oracle/12.2/client64 $ORACLE_HOME/include

And then check it is correct


Now on Command line run the below command

sqlplus username/password@//dbhost:1521/SID

as you run this command your prompt will come on


now you can run queries and run you oracle related tool..

Leave a Reply

Your email address will not be published. Required fields are marked *