sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
Your $LD_LIBRARY_PATH
does not include the path to Oracle libraries. Your bash profile shows:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
That line should be changed to:
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib:/usr/local/lib"
Or you can add this line to wherever you set your $ORACLE_HOME
variable (with export). Make sure $ORACLE_HOME
is set first.
Notice from your $ORACLE_HOME
value that the Oracle libraries are located at:
/usr/lib/oracle/12.1/client/lib
So that needs to be in your $LD_LIBRARY_PATH
. In some cases, like instantclient, you may need to add $ORACLE_HOME
to $LD_LIBRARY_PATH
. Also make sure that the library files themselves are readable.
You can use ldd
to verify that the library path is correct:
ldd $ORACLE_HOME/bin/sqlplus
Related videos on Youtube
NoobEditor
Updated on September 18, 2022Comments
-
NoobEditor over 1 year
echo $PATH
gives me below result :
/home/mayank/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-7-oracle/bin:/usr/lib/jvm/java-7-oracle/db/bin:/usr/lib/jvm/java-7-oracle/jre/bin:/usr/lib/oracle/12.1/client/bin
echo $ORACLE_HOME
fetches :
/usr/lib/oracle/12.1/client
echo LD_LIBRARY_PATH
gives (set through/etc/bash.bashrc
)
/usr/local/lib
doing
vim
for.bash_profile
shows below things set :[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib export LD_LIBRARY_PATH PATH=$PATH:/usr/local/bin export PATH
Despite setting the
ld_library_path
in above file I'm still not getting the correct path inenv
despite runningsudo ldconfig
and then rebooting my machine!!what help I'm looking for :
set env vars correctly
run sqlplus
I have been a linux user for very short time...so don't exactly know the workaround...if you can guide me, I'll be grateful!!!
-
NoobEditor about 10 years
-
NoobEditor almost 5 yearsi lost that laptop, so, cant check...nt sure if your answer is right! :\ :D