Oracle Database

How to Install Oracle Instant Client in Linux?

Oracle Instant Client is a freely available lightweight software that offers the libraries and tools that help us in connecting to Oracle databases from a variety of programming languages. As a developer or a system administrator, you may need to connect to the Oracle database with your OCI, OCCI, JDBC, and ODBC applications in Linux-based operating systems. In these types of applications, the connection can be made by installing the Oracle Instant Client in Linux.

This guide will explain how to install Oracle Instant Client in Linux using:

How to Install Oracle Instant Client in Linux Using RPM File?

To install Oracle Instant Client in Linux, download the RPM file (Instant Client for Linux x86-64) from the Oracle Instant Client Downloads page:

Next, download the “Basic rpm” file from the “Oracle Instant Client Downloads for Linux x86-64 (64-bit)” page:

After the successful download, open the terminal in the “Downloads” directory. Type the below-given command to install the Oracle Instant Client:

sudo dnf install oracle-instantclient-basic-linuxx64.rpm

After this command, type “y” to confirm the installation.

Output

The output showed that the Oracle Instant Client was successfully installed in the system.

Install Oracle Instant Client in Linux From the YUM Server

Before starting the installation of the Oracle Instant Client in Linux from the YUM server, open the terminal and update the system by typing the given below command:

sudo dnf update

Output

The output displayed that the system has been updated.

To install the Oracle Instant Client utilizing the YUM server, execute the command below given:

sudo dnf install oracle-instantclient-release-el8

Executing the above-mentioned command will ask you for confirmation, type “y” to continue the installation.

Output

The output depicted the success message after the installation of Oracle Instant Client in the system.

NOTE: The above command is used for the installation of Oracle Instant Client in Oracle Linux 8.

Install Oracle Instant Client Basic Package
To install the basic package of Oracle Instant Client, type the given command in the Linux terminal:

sudo dnf install oracle-instantclient-basic

After the command type “y” for the confirmation of installation.

Output

The output depicts that the basic package of Oracle Instant Client has been successfully installed using the basic Packages.

Install Oracle Instant Client SQL*Plus Package
Other Oracle Instant Client packages like SQL*Plus can also be installed by typing the given below command in the terminal:

sudo dnf install oracle-instantclient-sqlplus

Output

The output displayed that the Oracle Instant Client SQL*Plus package has been installed in the system.

Install Oracle Instant Client in Linux Using a ZIP File

To install the Oracle Instant Client, download the “ZIP” file from the “Oracle Instant Client Downloads for Linux” page:

After the download, open the terminal and create a directory in “/opt/” by typing the given below command:

sudo mkdir -p /opt/oracle/

In the above command, the directory name is “oracle”.

Move the Oracle Instant Client zip file to the newly created directory by typing the below command:

sudo cp Downloads/instantclient-basic-linuxx64.zip /opt/oracle/

Go to the newly created directory using the “cd” command:

cd /opt/oracle/

Confirm the file in the current directory:

ls

Output

The output showed that the directory has been created and the Oracle Instant Client zip file has been moved.

Unzip the Oracle Instant Client zip file in the current directory by using the “unzip” utility, the command is given below:

sudo unzip instantclient-basic-linuxx64.zip

Output

The output showed that the file has been unzipped.

Oracle Instant Client requires an “Asynchronous I/O” utility to run properly, and “libaio” provides the required support for asynchronous I/O operations. To install “libaio” type the given command:

sudo yum install libaio

Output

The output showed that the “libaio” was already installed in the system.

In Linux-based operating systems, “LD_LIBRARY_PATH” is an environment variable that specifies a list of directories where the operating system should look for shared libraries when running a program. Type the given below command to set the “LD_LIBRARY_PATH” environment variable to include the path “/opt/oracle/instantclient_21_1”:

export LD_LIBRARY_PATH=/opt/oracle/instantclient_21_1:$LD_LIBRARY_PATH

Output

The error-free output showed that the path has been added and the Oracle Instant Client has been installed using the zip file.

How to Remove Oracle Instant Client?

To remove the Oracle Instant Client in Linux, type the given below command:

sudo dnf remove oracle-instantclient-basic-21.9.0.0.0-1.el8.x86_64

Type “y” to continue the uninstallation process.

Output

The output showed that the Oracle Instant Client has been removed.

Conclusion

The Oracle Instant Client can be installed using the YUM server, RPM, and ZIP file. Download the RPM and ZIP file of the Oracle Instant Client from the “Oracle Instant Client Downloads for Linux” page and install it. To install the Oracle Instant Client using the YUM server use the “dnf” command. This guide has provided detailed information on how to install Oracle Instant Client in Linux.

About the author

Danish Ghafoor

I am a computer science graduate with a certification in cybersecurity. My passion for technology has led me to develop a deep understanding of the challenges and solutions in the field of information security. I am dedicated to staying up-to-date with the latest industry trends and technologies, and constantly seeking out new opportunities to expand my knowledge and skills.