libsqlplus.so: connot open shared object file : No such file or directory even though PATH contain the path
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.
Error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
If you have a parent script which calls (but does not source) two child scripts, any environment changes made by the first child script do not affect the parent or the other child.
As a simple example let's say you have an install.sh
script which contains:
#!/bin/bash
install_oraclexe.sh
create_schema.sh
where install_oraclexe.sh
contains the commands you showed in step c, including sourcing the environment script with . /etc/profile.d/oracle.sh
; and create_schema.sh
executes SQL*Plus.
Within install_oraclexe.sh
the environment is modified and PATH, LD_LIBRARY_PATH, etc. are available and have values that would allow you to run SQL*Plus later in that same child script. But those environment changes are only visible to that script. When it exits and control passes back to the parent script, its environment has not been touched, and it is not aware of anything the child has done. When it then executes the create_schema.sh
script it still doesn't have the Oracle-specfic environment settings, so the second child script doesn't have those either.
You can either move (or copy) the source command for the environment changes to the parent script:
#!/bin/bash
install_oraclexe.sh
. /etc/profile.d/oracle.sh
create_schema.sh
Or perhaps more neatly add it to the create_schema.sh
script:
#!/bin/bash
. /etc/profile.d/oracle.sh
sqlplus ...
Presumably as you are only installing the client you are connecting to a remote DB and are already using a suitable connection string, so you don't need to export ORACLE_SID=...
.
Not really relevant, but extracting files from the XE client installer seems a little odd; I would consider using the easier-to-install Oracle Instant Client instead. This seems like just the kind of distribution scenario it's designed for.
Error while loading shared libraries while running sqlplus
Alternatively Downloaded and installed sql developer from oracle from the link http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
Jenkins - Sqlplus script runner plugin - unable to load shared libraries
I think you have to set the ORACLE_HOME
correctly
I think you should set it to /appl/oracle/product/12.1.0.2/client_1/
Related Topics
How to Get the Variable Value Inside the Eof Tags
What Does the Mkdir -P Mean in a Script File
How to Clear the Scrollback in the Screen Command
In a Linux Shell How to Process Each Line of a Multiline String
Xdg Basedir Directories for Windows
How to Determine the Current Ip from a Known MAC Address
How and When to Use /Dev/Shm for Efficiency
Running Apt-Get for Another Partition/Directory
Testing Out of Disk Space in Linux
Checking for Installed Packages and If Not Found Install
Symbolic Link to a Hook in Git
How to Learn the Structure of Linux Wireless Drivers (Mac80211)
Linux Free Shows High Memory Usage But Top Does Not
How to Find a File/Directory That Could Be Anywhere on Linux Command Line