In this tutorial, you will learn how to install SQL*PLUS in Linux, I am using the Ubuntu system to demonstrate this. Actually, to install SQL*PLUS on Linux, you need to install Oracle Instant Client so that you can connect to Oracle Database using SQL*PLUS. Below is the step by step guide.
The following are the software version details, used in this tutorial:
- Ubuntu 16.04 (32-bit)
- Oracle Instant Client 18.3 x86
1. Download The Oracle Instant Client Software
First, you need to download the Oracle Instant Client software, click the following link to download Oracle Client software. I chose the version x86 because I have Ubuntu 16.04 32-bit installed on my Virtual Machine.
After selecting the version above it will direct you on the following page, then choose the following highlighted Oracle Client Software as shown in the image below:
2. Install Alien to Support Conversion for RPM Packages
After downloading all these three files, you can cut and paste to move the files to another folder, for example, I moved the above three files to /home/vin/sqlplusinstall directory.
Now open the Terminal in Ubuntu and give the following command:
sudo apt-get install alien
It may ask you to enter the password for the current user, then type the password and hit enter to continue.
3. Install SQL*PLUS (Oracle Instant Client 18.3) on Linux (Ubuntu)
After completing the above installation, in Terminal, change the directory to your downloaded RPM files directory, for example, /home/vin/sqlplusinstall and give the following command to see the content of the folder:
ls
oracle-instantclient18.3-basic-18.3.0.0.0-1.i386.rpm oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.i386.rpm oracle-instantclient18.3-devel-18.3.0.0.0-1.i386.rpm
It will list out the files something like above. Now start the installation of these three files one by one as mentioned below:
sudo alien -i oracle-instantclient18.3-basic-18.3.0.0.0-1.i386.rpm
sudo alien -i oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.i386.rpm
sudo alien -i oracle-instantclient18.3-devel-18.3.0.0.0-1.i386.rpm
4. Install Libaio1
After completing all these three installations, give the following command to install libaio:
sudo apt-get install libaio1
5. Configure Oracle.conf File
Now edit the configuration file to add the path (/usr/lib/oracle/18.3/client/lib/) in it, give the following command to open the editor in Ubuntu:
sudo sensible-editor /etc/ld.so.conf.d/oracle.conf
In the editor, copy & paste the following line, save and close the editor.
/usr/lib/oracle/18.3/client/lib/
If your Oracle client version is different, for example, 18.3.1, then you need to change in the above path. To check you can go to the folder /usr/lib/oracle.
6. Load the Configuration
After modifying the configuration file, load the configuration with the following command:
sudo ldconfig
7. Connect to Oracle Using SQL*PLUS
The installation and configuration of Oracle Instant Client are complete. You can run SQL*PLUS now to test the connection. Give the following command:
sqlplus scott/[email protected]//YourHost:1521/orcl
Change the username and password and the YourHost with your host IP or name.