Last week I blogged about the option to install Oracle’s Instant Client via the public YUM repository. If you go ahead and try this, there is one thing you will undoubtedly notice: file locations are rather unusual if you have worked with Oracle for a while. This is true at least for the 19c Instant Client, it might be similar for older releases although I didn’t check. I’d like to thank @oraclebase for prompting me to write this short article!
Installing the 19.3 “Basic” Instant Client package
So to start this post I am going to install the 19.3 “Basic” package on my Oracle Linux 7.6 lab environment:
$ sudo yum install oracle-instantclient19.3-basic Loaded plugins: ulninfo Resolving Dependencies --> Running transaction check ---> Package oracle-instantclient19.3-basic.x86_64 0:188.8.131.52.0-1 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: oracle-instantclient19.3-basic x86_64 184.108.40.206.0-1 ol7_oracle_instantclient 51 M Transaction Summary ================================================================================ Install 1 Package Total download size: 51 M Installed size: 225 M Is this ok [y/d/N]: y Downloading packages: oracle-instantclient19.3-basic-220.127.116.11.0-1.x86_64.rpm | 51 MB 00:09 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : oracle-instantclient19.3-basic-18.104.22.168.0-1.x86_64 1/1 Verifying : oracle-instantclient19.3-basic-22.214.171.124.0-1.x86_64 1/1 Installed: oracle-instantclient19.3-basic.x86_64 0:126.96.36.199.0-1 Complete!
With the software installed, let’s have a look at where everything is:
$ rpm -ql oracle-instantclient19.3-basic /etc/ld.so.conf.d/oracle-instantclient.conf /usr/lib/oracle /usr/lib/oracle/19.3 /usr/lib/oracle/19.3/client64 /usr/lib/oracle/19.3/client64/bin /usr/lib/oracle/19.3/client64/bin/adrci /usr/lib/oracle/19.3/client64/bin/genezi /usr/lib/oracle/19.3/client64/lib /usr/lib/oracle/19.3/client64/lib/libclntsh.so /usr/lib/oracle/19.3/client64/lib/libclntsh.so.10.1 /usr/lib/oracle/19.3/client64/lib/libclntsh.so.11.1 /usr/lib/oracle/19.3/client64/lib/libclntsh.so.12.1 /usr/lib/oracle/19.3/client64/lib/libclntsh.so.18.1 /usr/lib/oracle/19.3/client64/lib/libclntsh.so.19.1 /usr/lib/oracle/19.3/client64/lib/libclntshcore.so /usr/lib/oracle/19.3/client64/lib/libclntshcore.so.19.1 /usr/lib/oracle/19.3/client64/lib/libipc1.so /usr/lib/oracle/19.3/client64/lib/libmql1.so /usr/lib/oracle/19.3/client64/lib/libnnz19.so /usr/lib/oracle/19.3/client64/lib/libocci.so.19.1 /usr/lib/oracle/19.3/client64/lib/libociei.so /usr/lib/oracle/19.3/client64/lib/libocijdbc19.so /usr/lib/oracle/19.3/client64/lib/liboramysql19.so /usr/lib/oracle/19.3/client64/lib/network /usr/lib/oracle/19.3/client64/lib/network/admin /usr/lib/oracle/19.3/client64/lib/network/admin/README /usr/lib/oracle/19.3/client64/lib/ojdbc8.jar /usr/lib/oracle/19.3/client64/lib/xstreams.jar /usr/share/oracle /usr/share/oracle/19.3 /usr/share/oracle/19.3/client64 /usr/share/oracle/19.3/client64/doc /usr/share/oracle/19.3/client64/doc/BASIC_LICENSE /usr/share/oracle/19.3/client64/doc/BASIC_README
As you can see in the RPM output, files are found under /usr/lib/oracle. That’s why I meant the file location is unusual. I for my part have followed the directory structure suggested by previous release’s Oracle Universal Installer (OUI) defaults and installed it under /u01/app/oracle/product/version/client_1. The actual location however doesn’t really matter.
No more manually calling ldconfig with 19.3
Note that before 19.3 you had to manually run ldconfig after installing the Instant Client RPM file. In 19c this is handled via a post-install script. The RPM adds its configuration in /etc/ld.so.conf.d/oracle-instantclient.conf.
$ rpm -q --scripts oracle-instantclient19.3-basic postinstall scriptlet (using /bin/sh): ldconfig postuninstall scriptlet (using /bin/sh): ldconfig
This is nicer – at least in my opinion – than setting LD_LIBRARY_PATH in a shell. This seemed to work just fine: I installed the SQLPlus package (oracle-instantclient19.3-sqlplus) and I could start it without any problems.
If you have a requirement to add a TNS naming file, you should be able to do so by either setting TNS_ADMIN or place the file in /usr/lib/oracle/19.3/client64/lib/network/admin. I have a tnsnames.ora file pointing to my XE database here:
$ cat /usr/lib/oracle/19.3/client64/lib/network/admin/tnsnames.ora xepdb1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oraclexe)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xepdb1) ) )
I can connect to my database without setting any specific environment variables:
$ env | egrep -i 'tns|ld_library' | wc -l 0 $ sqlplus martin@xepdb1 SQL*Plus: Release 188.8.131.52.0 - Production on Mon May 13 09:38:12 2019 Version 184.108.40.206.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Enter password: Last Successful login time: Mon May 13 2019 09:22:11 -04:00 Connected to: Oracle Database 18c Express Edition Release 220.127.116.11.0 - Production Version 18.104.22.168.0
The SQLPlus package places a symbolic link to /usr/lib/oracle/19.3/client64/bin/sqlplus into /usr/bin so I don’t even have to adjust the PATH variable.
Being able to use the Instant Client out of the box is very useful for automated deployments where all you have to do is add a repository followed by a call to yum. This should make a lot of peoples’ lives much easier.