9

I downloaded Instant Oracle Client Version 11.2.0.4.0(basic, sqlplus, devel .rpm file) by Oracle website in Ubuntu. After converting .rpm into .deb using alien, I installed it, basic first and sqlplus and last devel.

And then I tried to run sqlplus.

But It is saying sqlplus64: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

Even though my PATH contains the PATH.

The below shows my PATH and the location of libsqlplus.so.

A@ubuntu:~$ sudo find / -name libsqlplus.so
/usr/lib/oracle/11.2/client64/lib/libsqlplus.so

A@ubuntu:~$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/sangmin/eclipse:/usr/lib/oracle/11.2/client64/lib:/usr/lib/oracle/11.2/client64
SangminKim
  • 8,358
  • 14
  • 69
  • 125

2 Answers2

16

Test your Oracle client. User either sqlplus either sqlplus64 depending on your platform. In my case, I used:

$ sqlplus64 username/password@//dbhost:1521/SID

If you get the next message, then you need to instruct sqlplus to use the proper libray:

sqlplus64: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory.

To do so, first find the location of Oracle libraries. The path should be something like /usr/lib/oracle/<version>/client(64)/lib/. In my case (Ubuntu 14.04 LTS, Intel on 64-bit), it was /usr/lib/oracle/11.2/client64/lib/.

Now, add this path to the system library list. Create and edit a new file:

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

Add inside the path:

/usr/lib/oracle/11.2/client64/lib/

Run now the dynamic linker run-time bindings utility:

$ sudo ldconfig

If sqlplus yields of a missing libaio.so.1 file, run:

$ sudo apt-get install libaio1

For other errors when trying to run sqlplus, please consult the Ubuntu help page.

user3335966
  • 2,673
  • 4
  • 30
  • 33
sontp
  • 306
  • 4
  • 11
  • Oracle's installation instructions at the base of http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html did not hint of the need to edit the system library list. Thank you for this. – mysteryegg Feb 06 '17 at 22:11
  • there is no `oracle.conf` in `/etc/ld.so.conf.d/` – Toolkit Sep 22 '17 at 09:18
0

Might worth checking the permissions issue: sqlplus: error while loading shared libraries

PERMISSIONS: I want to stress the importance of permissions for "sqlplus".

  1. For any "Other" UNIX user other than the Owner/Group to be able to run sqlplus and access an ORACLE database , read/execute permissions are required (rx) for these 4 directories :

    $ORACLE_HOME/bin , $ORACLE_HOME/lib, $ORACLE_HOME/oracore, $ORACLE_HOME/sqlplus

  2. Environment. Set those properly:

    A. ORACLE_HOME (example: ORACLE_HOME=/u01/app/oranpgm/product/12.1.0/PRMNRDEV/)

    B. LD_LIBRARY_PATH (example: ORACLE_HOME=/u01/app/oranpgm/product/12.1.0/PRMNRDEV/lib)

    C. ORACLE_SID

    D. PATH

     export PATH="$ORACLE_HOME/bin:$PATH"
    
Community
  • 1
  • 1
gidi gob
  • 51
  • 1
  • 6