Thursday, May 23, 2019

Install SQLPlus client on Ubuntu 20.04 or CentOS 8

I share example how  to install SQLPlus client on Ubuntu or Centos

UBUNTU

Steps:

1.   you need to install alien package.

sudo apt-get install alien



2. You need to download Instant Client Downloads ,  you choose the current version on page (basic*.rpm,  sqlplus.rpm and devel*.rmp).  you run command with your version.





sudo alien -i oracle-instantclient*-basic*.rpm
sudo alien -i oracle-instantclient*-sqlplus*.rpm
sudo alien -i oracle-instantclient*-devel*.rpm





3. Create Oracle configuration file:

sudo sensible-editor /etc/ld.so.conf.d/oracle.conf






4. Add the next line,  depends if your machine 32 or 64 bit.

#for 32 bits
/usr/lib/oracle/<your version>/client/lib/ 

#for 64 bits
/usr/lib/oracle/<your version>/client64/lib/



 

5. Update the configuration

sudo ldconfig




6. Try to connect using:

# if you have 32 bits
sqlplus username/password@//dbhost:1521/SID

# if you have 64 bits
sqlplus64 username/password@//dbhost:1521/SID



CENTOS 8

Steps:

1. You need to download Instant Client Downloads ,  you choose the current version on page (basic*.rpm,  sqlplus.rpm and devel*.rmp).  you run command with your version.

sudo yum localinstall oracle-instantclient*-basic*.rpm
sudo yum localinstall oracle-instantclient*-sqlplus*.rpm
sudo yum localinstall oracle-instantclient*-devel*.rpm

2.  Run the next command

sudo yum install libnsl 

3. Create Oracle configuration file:

sudo nano /etc/ld.so.conf.d/oracle.conf

4. Add the next line,  depends if your machine 32 or 64 bit.

#for 32 bits
/usr/lib/oracle/32/client/lib/ 

#for 64 bits
/usr/lib/oracle/64/client64/lib/ 

5. Update the configuration

sudo ldconfig

6. Try to connect using:

# if you have 32 bits
sqlplus username/password@//dbhost:1521/SID

# if you have 64 bits
sqlplus64 username/password@//dbhost:1521/SID

That is it.




References: https://askubuntu.com/questions/159939/how-to-install-sqlplus/207145




5 comments:

  1. Awesome man! You really saved me! Many thanks

    ReplyDelete
  2. sudo: Idconfig: command not found

    ReplyDelete
  3. sudo alien -i oracle-instantclient*-basic*.rpm
    oracle-instantclient*-basic*.rpm" not found.

    ReplyDelete
  4. Where can I set up my username and password?
    Thanks!

    ReplyDelete

Virtual Threads in Java 21: Simplified Concurrency for Modern Applications

  With Java 21, Virtual Threads have redefined how we approach concurrency, offering a lightweight and efficient way to handle parallel and ...