Installing instant clients on Oracle Linux 8 in Oracle Cloud Infrastructure

I recently presented my views on upgrading to Oracle 19c to the DOAG community. As part of that I pointed out how easy it was to deploy the instant client on a VM using yum and dnf. I previously wrote about the installation of the instant client in an on-premises configuration.

This post describes the (admittedly short) procedure to deploy the current instant client to an Oracle Linux 8.3 installation. The steps in this post should also allow you to deploy the instant client in an on-premises environment the same way.

The OCI VM I created is as vanilla as it gets, I didn’t even put it under OS Management control.

Initial Deployment

After the VM has been provisioned, I found the following repositories enabled:

$ sudo dnf repolist
repo id               repo name
ol8_MySQL80           MySQL 8.0 for Oracle Linux 8 (x86_64)
ol8_UEKR6             Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_addons            Oracle Linux 8 Addons (x86_64)
ol8_appstream         Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest     Oracle Linux 8 BaseOS Latest (x86_64)
ol8_ksplice           Ksplice for Oracle Linux 8 (x86_64)
ol8_oci               Oracle Linux 8 OCI Packages (x86_64)
ol8_oci_included      Oracle Software for OCI users on Oracle Linux 8 (x86_64)

A quick search for the instant client reveals the following hits:

$ sudo dnf search instantclient
Last metadata expiration check: 0:22:35 ago on Fri 21 May 2021 06:38:23 GMT.
=================================== Name Matched: instantclient ====================================
oracle-instantclient-release-el8.x86_64 : Oracle Instant Client yum repository configuration
oracle-instantclient-release-el8.src : Oracle Instant Client yum repository configuration

That isn’t the actual instant client though:

$ sudo dnf info oracle-instantclient-release-el8
Last metadata expiration check: 0:23:34 ago on Fri 21 May 2021 06:38:23 GMT.
Available Packages
Name         : oracle-instantclient-release-el8
Version      : 1.0
Release      : 1.el8
Architecture : src
Size         : 15 k
Source       : None
Repository   : ol8_baseos_latest
Summary      : Oracle Instant Client yum repository configuration
License      : GPLv2
Description  : This package contains the  Oracle Instant Client yum repository configuration.

Add the Repository

So let’s add the repository:

$ sudo dnf install oracle-instantclient-release-el8
Last metadata expiration check: 0:25:04 ago on Fri 21 May 2021 06:38:23 GMT.
Dependencies resolved.
====================================================================================================
 Package                                Architecture Version          Repository               Size
====================================================================================================
Installing:
 oracle-instantclient-release-el8       x86_64       1.0-1.el8        ol8_baseos_latest        16 k

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

Total download size: 16 k
Installed size: 18 k
Is this ok [y/N]: y
Downloading Packages:
oracle-instantclient-release-el8-1.0-1.el8.x86_64.rpm               212 kB/s |  16 kB     00:00    
----------------------------------------------------------------------------------------------------
Total                                                               201 kB/s |  16 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                            1/1 
  Installing       : oracle-instantclient-release-el8-1.0-1.el8.x86_64                          1/1 
  Running scriptlet: oracle-instantclient-release-el8-1.0-1.el8.x86_64                          1/1 
  Verifying        : oracle-instantclient-release-el8-1.0-1.el8.x86_64                          1/1 

Installed:
  oracle-instantclient-release-el8-1.0-1.el8.x86_64                                                 

Complete!

With the repository configuration in place I should be able to install the instant client next.

Installing the instant client

The next search for the instant client is more successful. The repository configuration is added automatically, refreshed, and dnf presented the following hits:

$ sudo dnf search instantclient
Oracle Instant Client 21 for Oracle Linux 8 (x86_64)                 17 kB/s | 4.2 kB     00:00    
=================================== Name Matched: instantclient ====================================
oracle-instantclient-basic.x86_64 : Oracle Instant Client Basic package
oracle-instantclient-basiclite.x86_64 : Oracle Instant Client Light package
oracle-instantclient-devel.x86_64 : Development header files for Oracle Instant Client.
oracle-instantclient-jdbc.x86_64 : Supplemental JDBC features for the Oracle Instant Client
oracle-instantclient-odbc.x86_64 : Oracle Instant Client ODBC
oracle-instantclient-release-el8.x86_64 : Oracle Instant Client yum repository configuration
oracle-instantclient-release-el8.src : Oracle Instant Client yum repository configuration
oracle-instantclient-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package
oracle-instantclient-tools.x86_64 : Tools for Oracle Instant Client

I wanted to use SQL*Plus, which should pull the dependent *basic package as well. And it does:

$ sudo dnf install oracle-instantclient-sqlplus
Last metadata expiration check: 0:01:12 ago on Fri 21 May 2021 07:03:52 GMT.
Dependencies resolved.
====================================================================================================
 Package                          Arch       Version           Repository                      Size
====================================================================================================
Installing:
 oracle-instantclient-sqlplus     x86_64     21.1.0.0.0-1      ol8_oracle_instantclient21     706 k
Installing dependencies:
 oracle-instantclient-basic       x86_64     21.1.0.0.0-1      ol8_oracle_instantclient21      54 M

Transaction Summary
====================================================================================================
Install  2 Packages

Total download size: 54 M
Installed size: 241 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64.rpm         7.1 MB/s | 706 kB     00:00    
(2/2): oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm            35 MB/s |  54 MB     00:01    
----------------------------------------------------------------------------------------------------
Total                                                                35 MB/s |  54 MB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                            1/1 
  Installing       : oracle-instantclient-basic-21.1.0.0.0-1.x86_64                             1/2 
  Running scriptlet: oracle-instantclient-basic-21.1.0.0.0-1.x86_64                             1/2 
  Installing       : oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64                           2/2 
  Running scriptlet: oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64                           2/2 
  Verifying        : oracle-instantclient-basic-21.1.0.0.0-1.x86_64                             1/2 
  Verifying        : oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64                           2/2 

Installed:
  oracle-instantclient-basic-21.1.0.0.0-1.x86_64  oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64 

Complete!

Thankfully, sqlplus is in the path, and can be executed without setting PATH, or LD_LIBRARY_PATH.

$ sqlplus /nolog

SQL*Plus: Release 21.0.0.0.0 - Production on Fri May 21 07:07:56 2021
Version 21.1.0.0.0

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

Nice! A quick check on yum.oracle.com reveals the same instant client is available over there, too.

Have fun!