Is this all I need to set for LD_LIBRARY_PATH ?
$ echo $ORACLE_HOME /u01/oracle/11g/db
What could happen if I don't set LD_LIBRARY_PATH variable or if set it incorrectly ?
$ echo $LD_LIBRARY_PATH /u01/oracle/11g/db/lib
and I should get a
sqlplus / as sysdba
Will sqlplus binary work without setting LD_LIBRARY_PATH? I don't remember setting LD_LIBRARY_PATH either manually or sourcing profile file when I do the testing like above .
Connected to an idle instance.
LD_LIBRARY_PATH is used when linking modules & not during program executionThanks for the correction. I confused dynamic linking with dynamic load libraries. Similar in concept, but different in execution.
T.Boyd wrote:The kernel provides a number of call and service interfaces. So too does runtime environments used by C/C++ and other languages. These are typically implemented as shared libraries (aka DLLs in Windows).
LD_LIBRARY_PATH is used when linking modules & not during program execution
So, does this mean I don't have to set LD_LIBRARY_PATH for the above test scenario ? I don't have a RDBMS binary only machine now. Otherwise I could have tested it
Then I unset the LD_LIBRARY_PATH variable
ORACLE_BASE=/optware/oracle ORACLE_HOME=/optware/oracle/11g/TST/db ORACLE_SID=orcl PATH=/optware/oracle/11g/TST/db/bin:/optware/oracle/11g/TST/db/PATCH/OPatch:/optware/oracle/11g/TST/db/bin:/opt/SUNWspro/bin:/optware/oracle/O
$ echo $LD_LIBRARY_PATH /optware/oracle/11g/TST/db/lib $ unset LD_LIBRARY_PATH $ echo $LD_LIBRARY_PATH ksh: LD_LIBRARY_PATH: parameter not set $ sqlplus / as sysdba SQL*Plus: Release 220.127.116.11.0 Production on Thu Nov 24 11:19:06 2011 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 18.104.22.168.0 - 64bit Production With the Partitioning option SQL> select name from v$database; NAME --------- ORCL
There's also a SHLIB_PATH variable used by some Unix flavours.. could be pre-Posix perhaps? Seem to recall that this was used on older 32bit HP-UX kernels.
// current setting /home/billy> echo $LD_LIBRARY_PATH /home/billy/instantclient_10_2:/usr/lib/firefox: // sqlplus loads fine /home/billy> sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 24 11:38:59 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Enter user-name: // unset the environment variable and sqlplus fails to load /home/billy> unset LD_LIBRARY_PATH /home/billy> sqlplus /home/billy/instantclient_10_2/bin/sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory // this is what the dynamic link loader sees as shared libs that need to // be loaded - and which of these it does not find /home/billy> ldd /home/billy/instantclient_10_2/bin/sqlplus linux-gate.so.1 => (0x00cc1000) libsqlplus.so => not found libclntsh.so.10.1 => not found libnnz10.so => not found libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x006eb000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x005f5000) libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x001fe000) libnsl.so.1 => /lib/i386-linux-gnu/libnsl.so.1 (0x00d53000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x009ab000) /lib/ld-linux.so.2 (0x005a8000) // setting the environment and checking what the dynamic link loader sees /home/billy> export LD_LIBRARY_PATH=/home/billy/instantclient_10_2:/usr/lib/firefox: /home/billy> ldd /home/billy/instantclient_10_2/bin/sqlplus linux-gate.so.1 => (0x00bb3000) libsqlplus.so => /home/billy/instantclient_10_2/libsqlplus.so (0x00aa5000) libclntsh.so.10.1 => /home/billy/instantclient_10_2/libclntsh.so.10.1 (0x00fd8000) libnnz10.so => /home/billy/instantclient_10_2/libnnz10.so (0x00778000) libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00110000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x001ab000) libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x00114000) libnsl.so.1 => /lib/i386-linux-gnu/libnsl.so.1 (0x00bd1000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x001d1000) /lib/ld-linux.so.2 (0x00fba000)