The following shell commands try to demonstrate how parts of Oracle's instant client can be installed on Linux. It installs the
Basic Light package (only English error messages and US and European character set),
SQL*Plus and
tools (Data Pump,
SQL*Loader and Workload Replay Client). Notably,
tnsping
is not part of the instant client.
Setting PATH and LD_LIBRARY_PATH to execute binaries
LD_LIBRARY_PATH
must be set to the directory into which the files were extracted:
export LD_LIBRARY_PATH=$DESTDIR/instantclient_21_13:$LD_LIBRARY_PATH
Alternatively, the library path can be more permanently be configured like so:
sudo sh -c "echo $DESTDIR/instantclient_21_13 > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig
Then, the binaries can be executed:
$DESTDIR/instantclient_21_13/sqlplus …
Adding the directory to PATH
as well allows to execute the binaries without having to type the full path to the executable:
PATH=$PATH:$DESTDIR/instantclient_21_10:$LD_LIBRARY_PATH
Alternatively, symbolic links can be created from a directory that is pointed at by the $PATH
variable to the executables of the instant client.
find $DESTDIR/instantclient_21_13 -type f -executable -exec ln -s {} ~/bin \;
Copying files
Even another alternative to modifying
PATH
and
LD_LIBRARY_PATH
is to copy shared objects (i. e. executables which match the regular expression
.so(\.\d)?
) to
/usr/lib
and other executables to
/usr/bin
.
This can be achieved with the following
find
command:
sudo find $DESTDIR -executable -type f \
\( -regex '.*\.so\(\.\d\)?.*' -exec cp -i {} /usr/lib \; -o \
-exec cp -i {} /usr/bin \; \)
Missing libaio.so.1
It's possible that
libaio must be installed:
$ sqlplus rene/rene@ora23
sqlplus: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
In this case, it needs to be installed as well
$ sudo apt install -y libaio1