Installing the Oracle Instant Client RPM via YUM on Oracle Linux 7

Many applications require Oracle’s instant client to enable connectivity with the database. In the past, getting hold of the instant client required you to agree to the license agreement before you could download the software. For a little while now, Oracle offers a YUM repository with the instant client RPMs. There are a couple of announcements to that effect, for example on Oracle’s Linux blog. It’s a great step ahead for usability, and I really appreciate the move. After a small exchange on Twitter I had to give this a go and see how this works. The following article is a summary of what I learned.

Instead of pulling the RPMs straight from the repository location using curl or wget, you can add the repository to your YUM configuration just as easily. How you do this depends on your installed Oracle Linux image. Oracle changed the way the contents of /etc/yum.repos.d is handled earlier this year. If your system is already using the new modular approach – many cloud images for example use the new modular approach already – the steps are slightly different from the monolithic configuration file.

Monolithic public-yum-ol7.repo

My virtualised lab environment (for which I actually do have a backup!) is based on Oracle Linux 7.6 and still uses /etc/yum.repos.d/public-yum-ol7.repo. The files belonging to the oraclelinux-release-el7 RPM are present but disabled. I am conscious of the fact that this configuration file is deprecated.

To enable the instant client repository you can either edit public-yum-ol7.repo with your text editor of choice, or use yum-config-manager. Ansible users can use the ini_file module to do the same thing in code. I used yum-config-manager:

$ sudo yum-config-manager --enable ol7_oracle_instantclient

With the repository enabled you can search for the oracle-instantclient RPMS

$ sudo yum search oracle-instant
Loaded plugins: ulninfo
ol7_UEKR5                                                | 1.2 kB     00:00     
ol7_latest                                               | 1.4 kB     00:00     
ol7_oracle_instantclient                                 | 1.2 kB     00:00     
(1/4): ol7_oracle_instantclient/x86_64/primary             | 4.4 kB   00:00     
(2/4): ol7_oracle_instantclient/x86_64/updateinfo          |  145 B   00:00     
(3/4): ol7_latest/x86_64/updateinfo                        | 907 kB   00:00     
(4/4): ol7_latest/x86_64/primary                           |  13 MB   00:02     
ol7_latest                                                          12804/12804
ol7_oracle_instantclient                                                  21/21
========================= N/S matched: oracle-instant ==========================
oracle-instantclient18.3-basic.x86_64 : Oracle Instant Client Basic package
oracle-instantclient18.3-basiclite.x86_64 : Oracle Instant Client Light package
oracle-instantclient18.3-devel.x86_64 : Development headers for Instant Client.
oracle-instantclient18.3-jdbc.x86_64 : Supplemental JDBC features for the Oracle
                                     : Instant Client
oracle-instantclient18.3-odbc.x86_64 : Oracle Instant Client ODBC
oracle-instantclient18.3-sqlplus.x86_64 : SQL*Plus for Instant Client.
oracle-instantclient18.3-tools.x86_64 : Tools for Oracle Instant Client
oracle-instantclient18.5-basic.x86_64 : Oracle Instant Client Basic package
oracle-instantclient18.5-basiclite.x86_64 : Oracle Instant Client Light package
oracle-instantclient18.5-devel.x86_64 : Development headers for Instant Client.
oracle-instantclient18.5-jdbc.x86_64 : Supplemental JDBC features for the Oracle
                                     : Instant Client
oracle-instantclient18.5-odbc.x86_64 : Oracle Instant Client ODBC
oracle-instantclient18.5-sqlplus.x86_64 : SQL*Plus for Instant Client.
oracle-instantclient18.5-tools.x86_64 : Tools for Oracle Instant Client
oracle-instantclient19.3-basic.x86_64 : Oracle Instant Client Basic package
oracle-instantclient19.3-basiclite.x86_64 : Oracle Instant Client Light package
oracle-instantclient19.3-devel.x86_64 : Development header files for Oracle
                                      : Instant Client.
oracle-instantclient19.3-jdbc.x86_64 : Supplemental JDBC features for the Oracle
                                     : Instant Client
oracle-instantclient19.3-odbc.x86_64 : Oracle Instant Client ODBC
oracle-instantclient19.3-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package
oracle-instantclient19.3-tools.x86_64 : Tools for Oracle Instant Client

  Name and summary matches only, use "search all" for everything.

As you can see, there are instant clients for 18.3, 18.5 and 19.3 at the time of writing.

Modular YUM configuration

If your system is already configured to use the modular YUM configuration, you need to know which RPM contains the configuration for the instant client repository. The YUM getting started guide comes to the rescue again. If you consult the table in section Installing Software from Oracle Linux Yum Server, you’ll notice that you have to install oracle-release-el7.

$ sudo yum install oracle-release-el7
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracle-release-el7.x86_64 0:1.0-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package                  Arch         Version           Repository        Size
 oracle-release-el7       x86_64       1.0-2.el7         ol7_latest        14 k

Transaction Summary
Install  1 Package

Total download size: 14 k
Installed size: 18 k
Is this ok [y/d/N]: y
Downloading packages:
oracle-release-el7-1.0-2.el7.x86_64.rpm                    |  14 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : oracle-release-el7-1.0-2.el7.x86_64                          1/1 
  Verifying  : oracle-release-el7-1.0-2.el7.x86_64                          1/1 

  oracle-release-el7.x86_64 0:1.0-2.el7                                         


As part of the YUM command, the instant client repository configuration is laid down and enabled. From this point onward, everything is exactly the same as previously shown with in the section detailing the monolithic repository configuration file.