Oracle Instant Client RPM installation where to find things

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!

UPDATE 250220: The post has been updated for the latest Instant Client, release 23ai. The commands/instructions you find in this post are the same as for the 19c and 21c Instant Client.

Installing the 19.3 “Basic” Instant Client package

Let’s start by installing the Instant Client for Oracle Database 23ai in an Oracle Linux 8.10 (x86-64) VM. If the package doesn’t show up for your system, you may have to enable the YUM repository first. I wrote about this procedure in an earlier post.

[opc@demohost ~]$ sudo dnf install oracle-instantclient-basic
Last metadata expiration check: 0:11:00 ago on Thu 20 Feb 2025 11:29:14 AM GMT.
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
oracle-instantclient-basic x86_64 23.7.0.25.01-1.el8 ol8_oracle_instantclient23 79 M

Transaction Summary
========================================================================================================================
Install 1 Package

Total download size: 79 M
Installed size: 318 M
Is this ok [y/N]: y
Downloading Packages:
oracle-instantclient-basic-23.7.0.25.01-1.el8.x86_64.rpm 73 MB/s | 79 MB 00:01
------------------------------------------------------------------------------------------------------------------------
Total 73 MB/s | 79 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : oracle-instantclient-basic-23.7.0.25.01-1.el8.x86_64 1/1
Running scriptlet: oracle-instantclient-basic-23.7.0.25.01-1.el8.x86_64 1/1
Verifying : oracle-instantclient-basic-23.7.0.25.01-1.el8.x86_64 1/1

Installed:
oracle-instantclient-basic-23.7.0.25.01-1.el8.x86_64

Complete!

With the software installed, let’s have a look at where everything is:

[opc@demohost ~]$ rpm -ql oracle-instantclient-basic
/etc/ld.so.conf.d/oracle-instantclient.conf
/usr/lib/.build-id
/usr/lib/.build-id/18
/usr/lib/.build-id/18/88882fe527e5b708f135431626c9c11865b371
/usr/lib/.build-id/18/ca8cd377bb56817163c99121b649982cb716bf
/usr/lib/.build-id/1d
/usr/lib/.build-id/1d/b298b2e8e1f986654fdd7966eec40074cdb673
/usr/lib/.build-id/48
/usr/lib/.build-id/48/5eb3b3d64c80b395df64e8668ebbaee72f946b
/usr/lib/.build-id/6e
/usr/lib/.build-id/6e/145d49af424f93fd20f27304223cdf6b1c0e83
/usr/lib/.build-id/99
/usr/lib/.build-id/99/4d97abc7fedd52f05789c2e2c019ffac6f68b0
/usr/lib/.build-id/c7
/usr/lib/.build-id/c7/8489a3dc1195413e747dbfa84ddbdd64e8ec9a
/usr/lib/.build-id/db
/usr/lib/.build-id/db/b926d709ac73de76820b8c8354b07d3fe50bd3
/usr/lib/.build-id/dd
/usr/lib/.build-id/dd/bc1f0d22f842db545396fb1e1723293c2dbc6e
/usr/lib/.build-id/ec
/usr/lib/.build-id/ec/0bebda6b1781a596f5b02e7b4f17bda376799f
/usr/lib/.build-id/f4
/usr/lib/.build-id/f4/3c403e1d799c8379f61150206bceeaa2ae0d31
/usr/lib/oracle
/usr/lib/oracle/23
/usr/lib/oracle/23/client64
/usr/lib/oracle/23/client64/bin
/usr/lib/oracle/23/client64/bin/adrci
/usr/lib/oracle/23/client64/bin/genezi
/usr/lib/oracle/23/client64/lib
/usr/lib/oracle/23/client64/lib/fips.so
/usr/lib/oracle/23/client64/lib/legacy.so
/usr/lib/oracle/23/client64/lib/libclntsh.so
/usr/lib/oracle/23/client64/lib/libclntsh.so.10.1
/usr/lib/oracle/23/client64/lib/libclntsh.so.11.1
/usr/lib/oracle/23/client64/lib/libclntsh.so.12.1
/usr/lib/oracle/23/client64/lib/libclntsh.so.18.1
/usr/lib/oracle/23/client64/lib/libclntsh.so.19.1
/usr/lib/oracle/23/client64/lib/libclntsh.so.20.1
/usr/lib/oracle/23/client64/lib/libclntsh.so.21.1
/usr/lib/oracle/23/client64/lib/libclntsh.so.22.1
/usr/lib/oracle/23/client64/lib/libclntsh.so.23.1
/usr/lib/oracle/23/client64/lib/libclntshcore.so
/usr/lib/oracle/23/client64/lib/libclntshcore.so.23.1
/usr/lib/oracle/23/client64/lib/libnnz.so
/usr/lib/oracle/23/client64/lib/libocci.so
/usr/lib/oracle/23/client64/lib/libocci.so.10.1
/usr/lib/oracle/23/client64/lib/libocci.so.11.1
/usr/lib/oracle/23/client64/lib/libocci.so.12.1
/usr/lib/oracle/23/client64/lib/libocci.so.18.1
/usr/lib/oracle/23/client64/lib/libocci.so.19.1
/usr/lib/oracle/23/client64/lib/libocci.so.20.1
/usr/lib/oracle/23/client64/lib/libocci.so.21.1
/usr/lib/oracle/23/client64/lib/libocci.so.22.1
/usr/lib/oracle/23/client64/lib/libocci.so.23.1
/usr/lib/oracle/23/client64/lib/libociei.so
/usr/lib/oracle/23/client64/lib/libocijdbc23.so
/usr/lib/oracle/23/client64/lib/network
/usr/lib/oracle/23/client64/lib/network/admin
/usr/lib/oracle/23/client64/lib/network/admin/README
/usr/lib/oracle/23/client64/lib/ojdbc8.jar
/usr/lib/oracle/23/client64/lib/pkcs11.so
/usr/lib/oracle/23/client64/lib/xstreams.jar
/usr/share/oracle
/usr/share/oracle/23
/usr/share/oracle/23/client64
/usr/share/oracle/23/client64/doc
/usr/share/oracle/23/client64/doc/BASIC_LICENSE
/usr/share/oracle/23/client64/doc/BASIC_README

As you can see in the RPM output, files are found under /usr/lib/oracle. That’s why I said that 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 when using the RPM

The RPM-based installation takes care of a few manual steps you have to complete when using the Instant Client ZIP files, such as manually running ldconfig, etc. The RPM post-install script does it instead.

Note that the RPM adds its library configuration in /etc/ld.so.conf.d/oracle-instantclient.conf (see output above). You can see that a call to ldconfig isn’t required:

[opc@demohost ~]$ rpm -q --scripts oracle-instantclient-basic
postinstall scriptlet (using /bin/sh):
ldconfig
postuninstall scriptlet (using /bin/sh):
ldconfig
[opc@demohost ~]$

This is nicer – at least in my opinion – than setting LD_LIBRARY_PATH in a shell. And it just works.

Network Configuration

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/23/client64/lib/network/admin. I have a tnsnames.ora file pointing to my FREEPDB1 database here:

[opc@demohost ~]$ cat /usr/lib/oracle/23/client64/lib/network/admin/tnsnames.ora
freepdb1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oraclefree)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = freepdb1)
)
)

I can connect to my database without setting any specific environment variables (sqlplus can be found in the
oracle-instantclient-sqlplus RPM)

[opc@demohost ~]$ sqlplus -L emily@freepdb1

SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Thu Feb 20 12:09:03 2025
Version 23.7.0.25.01

Copyright (c) 1982, 2024, Oracle. All rights reserved.

Enter password:
Last Successful login time: Thu Feb 20 2025 12:10:29 +00:00

Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.6.0.24.10

The SQLPlus RPM places a symbolic link to /usr/lib/oracle/23/client64/bin/sqlplus into /usr/bin so I don’t even have to adjust the PATH variable – nice.

[opc@demohost ~]$ ls -l /usr/bin/sqlplus
lrwxrwxrwx. 1 root root 39 Jan 16 11:38 /usr/bin/sqlplus -> /usr/lib/oracle/23/client64/bin/sqlplus

However, if all you need it to interact with the database you are probably better off using SQL Developer Command Line (SQLcl).

Summary

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.