Database Reference
In-Depth Information
Shared Library Search Path
All current implementations of UNIX use shared libraries or runtime linking instead of static
linking. With static linking, libraries such as the Standard C library are statically linked into
programs at runtime. Dynamic linking adds the library to the text segment (where the machine
code instructions are) of the program at runtime. This approach results in smaller executables
and has the advantage that newer releases of shared libraries are picked up automatically by
the executables the next time they are run. On many UNIX platforms, the command ldd may
be used to find out which shared libraries an executable requires.
$ ldd `which perl`
libnsl.so.1 => /lib/libnsl.so.1 (0x0551c000)
libdl.so.2 => /lib/libdl.so.2 (0x00862000)
libm.so.6 => /lib/tls/libm.so.6 (0x00868000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x053f9000)
libutil.so.1 => /lib/libutil.so.1 (0x00cd8000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0097e000)
libc.so.6 => /lib/tls/libc.so.6 (0x00734000)
/lib/ld-linux.so.2 (0x0071a000)
In the preceding output, libc.so.6 is the Standard C library, libm.so is the math library,
and libdl.so is part of the dynamic linker itself.
The initial step on the way to a correct shared library search path is to determine whether
$ORACLE_HOME/perl/ bin/perl is a 32-bit or a 64-bit executable. This can be done using the
UNIX command file . On an AIX system, this might yield the following:
$ file $ORACLE_HOME/perl/bin/perl
/opt/oracle/product/10.2.0.2.1/perl/bin/perl: executable (RISC System/6000) or
object module not stripped
Since there is no mention of 64-bit in the preceding output, perl is a 32-bit executable. On
a 32-bit Linux system, it might look as follows:
$ file `which perl`
/opt/oracle10/app/oracle/product/10.2.0.2/db_rac/perl/bin/perl: ELF 32-bit LSB
executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5,
dynamically linked (uses shared libs), not stripped
On this Solaris 9 system, perl is a 64-bit executable.
$ file /opt/oracle/product/10.2.0.2.0/perl/bin/perl
/opt/oracle/product/10.2.0.2.0/perl/bin/perl: ELF 64-bit MSB executable SPARCV9
Version 1, dynamically linked, not stripped
The next step consists of locating the ORACLE client shared library libclntsh.so with the
same word length (32-bit or 64-bit) as perl . ORACLE installations can be 32-bit or 64-bit. ORACLE
DBMS software is only available in a 64-bit version for platforms such as AIX and HP-UX, whereas
32-bit versions exist for Sparc Solaris, Solaris x86, and Linux. Matters are simple on an oper-
ating system that only supports 32-bit executables, such as Linux x86. On these platforms,
$ORACLE_HOME/lib contains a suitable 32-bit client shared library.
 
Search WWH ::




Custom Search