In October 2018 Oracle Corp. has made available RPM to install Oracle Instant Client 18c on Linux: actually it has already been possible to install Oracle Instant Client RPM that you could download from OTN (for example Oracle Instant Client 12.2.0.1 RPM for Linux). But you had to:
What is new with Oracle Instant Client 18c is that now you can install this RPM directly from Oracle public yum repositories without connecting to OTN with your Oracle account and without accepting the OTN License Agreement as detailed in Sergio Leunissen blog post.
In this blog post I will document the steps I have run on Red Hat Linux 7.6 to install these RPMs.
As usual I have run my tests on a minimal Red Hat Linux 7.6 virtual machine that has 4 GB of RAM (and 4GB of swap), one 40 GB disk and internet connection. This machine is registered in Red Hat Developer network:
# subscription-manager list
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux Server
Product ID: 69
Version: 7.6
Arch: x86_64
Status: Subscribed
Status Details:
Starts: 08/14/2018
Ends: 08/15/2019
# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
repo id repo name status
rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 23 346
repolist: 23 346
I have first installed wget:
# yum -y install wget Loaded plugins: product-id, search-disabled-repos, subscription-manager Resolving Dependencies --> Running transaction check ---> Package wget.x86_64 0:1.14-18.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================== Package Arch Version Repository Size ===================================================================================================================================================== Installing: wget x86_64 1.14-18.el7 rhel-7-server-rpms 547 k Transaction Summary ===================================================================================================================================================== Install 1 Package Total download size: 547 k Installed size: 2.0 M Downloading packages: wget-1.14-18.el7.x86_64.rpm | 547 kB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : wget-1.14-18.el7.x86_64 1/1 Verifying : wget-1.14-18.el7.x86_64 1/1 Installed: wget.x86_64 0:1.14-18.el7 Complete!
I have installed yum-utils:
# yum install -y yum-utils Loaded plugins: product-id, search-disabled-repos, subscription-manager Resolving Dependencies --> Running transaction check ---> Package yum-utils.noarch 0:1.1.31-50.el7 will be installed --> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-50.el7.noarch --> Running transaction check ---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed --> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch --> Running transaction check ---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be installed --> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================== Package Arch Version Repository Size ===================================================================================================================================================== Installing: yum-utils noarch 1.1.31-50.el7 rhel-7-server-rpms 121 k Installing for dependencies: python-chardet noarch 2.2.1-1.el7_1 rhel-7-server-rpms 227 k python-kitchen noarch 1.1.1-5.el7 rhel-7-server-rpms 266 k Transaction Summary ===================================================================================================================================================== Install 1 Package (+2 Dependent packages) Total download size: 614 k Installed size: 2.8 M Downloading packages: (1/3): python-kitchen-1.1.1-5.el7.noarch.rpm | 266 kB 00:00:00 (2/3): python-chardet-2.2.1-1.el7_1.noarch.rpm | 227 kB 00:00:01 (3/3): yum-utils-1.1.31-50.el7.noarch.rpm | 121 kB 00:00:00 ----------------------------------------------------------------------------------------------------------------------------------------------------- Total 388 kB/s | 614 kB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : python-chardet-2.2.1-1.el7_1.noarch 1/3 Installing : python-kitchen-1.1.1-5.el7.noarch 2/3 Installing : yum-utils-1.1.31-50.el7.noarch 3/3 Verifying : python-chardet-2.2.1-1.el7_1.noarch 1/3 Verifying : python-kitchen-1.1.1-5.el7.noarch 2/3 Verifying : yum-utils-1.1.31-50.el7.noarch 3/3 Installed: yum-utils.noarch 0:1.1.31-50.el7 Dependency Installed: python-chardet.noarch 0:2.2.1-1.el7_1 python-kitchen.noarch 0:1.1.1-5.el7 Complete!
I have downloaded Oracle Linux public yum repo file:
# cd /etc/yum.repos.d/ # wget http://yum.oracle.com/public-yum-ol7.repo --2018-12-24 17:08:21-- http://yum.oracle.com/public-yum-ol7.repo Resolving yum.oracle.com (yum.oracle.com)... 23.205.82.159 Connecting to yum.oracle.com (yum.oracle.com)|23.205.82.159|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 15423 (15K) [text/plain] Saving to: ‘public-yum-ol7.repo’ 100%[===========================================================================================================>] 15,423 --.-K/s in 0.01s 2018-12-24 17:08:22 (1.17 MB/s) - ‘public-yum-ol7.repo’ saved [15423/15423]
I have enabled the Oracle Instant Client yum repository:
# yum-config-manager --enable ol7_oracle_instantclient Loaded plugins: product-id, subscription-manager ========================================================== repo: ol7_oracle_instantclient =========================================================== [ol7_oracle_instantclient] async = True bandwidth = 0 base_persistdir = /var/lib/yum/repos/x86_64/7Server baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ cache = 0 cachedir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient check_config_file_age = True compare_providers_priority = 80 cost = 1000 deltarpm_metadata_percentage = 100 deltarpm_percentage = enabled = 1 enablegroups = True exclude = failovermethod = priority ftp_disable_epsv = False gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient/gpgcadir gpgcakey = gpgcheck = True gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient/gpgdir gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle hdrdir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/headers http_caching = all includepkgs = ip_resolve = keepalive = True keepcache = False mddownloadpolicy = sqlite mdpolicy = group:small mediaid = metadata_expire = 21600 metadata_expire_filter = read-only:present metalink = minrate = 0 mirrorlist = mirrorlist_expire = 86400 name = Oracle Instant Client for Oracle Linux 7Server (x86_64) old_base_cache_dir = password = persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient pkgdir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/packages proxy = False proxy_dict = proxy_password = proxy_username = repo_gpgcheck = False retries = 10 skip_if_unavailable = False ssl_check_cert_permissions = True sslcacert = sslclientcert = sslclientkey = sslverify = True throttle = 0 timeout = 30.0 ui_id = ol7_oracle_instantclient/x86_64 ui_repoid_vars = releasever, basearch username =
I have downloaded the required GPG key from Oracle yum repositories to avoid: GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle" :
# wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle --2018-12-24 17:14:00-- http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 Resolving public-yum.oracle.com (public-yum.oracle.com)... 23.201.154.122 Connecting to public-yum.oracle.com (public-yum.oracle.com)|23.201.154.122|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1011 [text/plain] Saving to: ‘/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle’ 100%[===========================================================================================================>] 1,011 --.-K/s in 0s 2018-12-24 17:14:02 (80.2 MB/s) - ‘/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle’ saved [1011/1011]
I have installed 3 Oracle Instant Client RPM in order to be able to use SQL*Plus and SQL*Loader:
# yum -y install oracle-instantclient18.3-basic.x86_64 oracle-instantclient18.3-sqlplus.x86_64 oracle-instantclient18.3-tools.x86_64 Loaded plugins: product-id, search-disabled-repos, subscription-manager Resolving Dependencies --> Running transaction check ---> Package oracle-instantclient18.3-basic.x86_64 0:18.3.0.0.0-2 will be installed ---> Package oracle-instantclient18.3-sqlplus.x86_64 0:18.3.0.0.0-2 will be installed ---> Package oracle-instantclient18.3-tools.x86_64 0:18.3.0.0.0-2 will be installed --> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================== Package Arch Version Repository Size ===================================================================================================================================================== Installing: oracle-instantclient18.3-basic x86_64 18.3.0.0.0-2 ol7_oracle_instantclient 52 M oracle-instantclient18.3-sqlplus x86_64 18.3.0.0.0-2 ol7_oracle_instantclient 703 k oracle-instantclient18.3-tools x86_64 18.3.0.0.0-2 ol7_oracle_instantclient 936 k Transaction Summary ===================================================================================================================================================== Install 3 Packages Total size: 54 M Installed size: 228 M Downloading packages: warning: /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/packages/oracle-instantclient18.3-sqlplus-18.3.0.0.0-2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle Importing GPG key 0xEC551F03: Userid : "Oracle OSS group (Open Source Software group) " Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : oracle-instantclient18.3-basic-18.3.0.0.0-2.x86_64 1/3 Installing : oracle-instantclient18.3-sqlplus-18.3.0.0.0-2.x86_64 2/3 Installing : oracle-instantclient18.3-tools-18.3.0.0.0-2.x86_64 3/3 Verifying : oracle-instantclient18.3-sqlplus-18.3.0.0.0-2.x86_64 1/3 Verifying : oracle-instantclient18.3-basic-18.3.0.0.0-2.x86_64 2/3 Verifying : oracle-instantclient18.3-tools-18.3.0.0.0-2.x86_64 3/3 Installed: oracle-instantclient18.3-basic.x86_64 0:18.3.0.0.0-2 oracle-instantclient18.3-sqlplus.x86_64 0:18.3.0.0.0-2 oracle-instantclient18.3-tools.x86_64 0:18.3.0.0.0-2 Complete!
I have checked Oracle Client target directories:
# ls -al /usr/lib/oracle/18.3/client64/lib total 228772 drwxr-xr-x. 3 root root 4096 Dec 31 17:10 . drwxr-xr-x. 4 root root 28 Dec 31 17:10 .. -rwxr-xr-x. 1 root root 342 Oct 20 02:39 glogin.sql -rwxr-xr-x. 1 root root 8348633 Oct 20 02:39 libclntshcore.so.18.1 -rwxr-xr-x. 1 root root 77879027 Oct 20 02:39 libclntsh.so.18.1 -rwxr-xr-x. 1 root root 3537979 Oct 20 02:39 libipc1.so -rwxr-xr-x. 1 root root 467468 Oct 20 02:39 libmql1.so -rwxr-xr-x. 1 root root 77405 Oct 20 02:39 libnfsodm18.so -rwxr-xr-x. 1 root root 6636088 Oct 20 02:39 libnnz18.so -rwxr-xr-x. 1 root root 2229347 Oct 20 02:39 libocci.so.18.1 -rwxr-xr-x. 1 root root 126949719 Oct 20 02:39 libociei.so -rwxr-xr-x. 1 root root 160875 Oct 20 02:39 libocijdbc18.so -rwxr-xr-x. 1 root root 394835 Oct 20 02:39 libons.so -rwxr-xr-x. 1 root root 118171 Oct 20 02:39 liboramysql18.so -rwxr-xr-x. 1 root root 1655813 Oct 20 02:39 libsqlplusic.so -rwxr-xr-x. 1 root root 1616347 Oct 20 02:39 libsqlplus.so drwxr-xr-x. 3 root root 19 Dec 31 17:10 network -rw-r--r--. 1 root root 4109057 Oct 20 02:41 ojdbc8.jar -rw-r--r--. 1 root root 37519 Oct 20 02:41 xstreams.jar # ls -al /usr/lib/oracle/18.3/client64/bin total 4548 drwxr-xr-x. 2 root root 121 Dec 31 17:10 . drwxr-xr-x. 4 root root 28 Dec 31 17:10 .. -rwxr-xr-x. 1 root root 40227 Oct 20 02:40 adrci -rwxr-xr-x. 1 root root 1062611 Oct 20 02:43 exp -rwxr-xr-x. 1 root root 228252 Oct 20 02:43 expdp -rwxr-xr-x. 1 root root 57268 Oct 20 02:40 genezi -rwxr-xr-x. 1 root root 530557 Oct 20 02:43 imp -rwxr-xr-x. 1 root root 240274 Oct 20 02:43 impdp -rwxr-xr-x. 1 root root 1679005 Oct 20 02:43 sqlldr -rwxr-xr-x. 1 root root 22569 Oct 20 02:43 sqlplus -rwxr-xr-x. 1 root root 786154 Oct 20 02:43 wrc
I have created a specific Linux account:
# groupadd apps # useradd -g apps app
I have added following remote host name in /etc/hosts:
192.168.56.26 ol7defs1 ol7defs1.localdomain
On ol7defs1, I have stopped firewall service:
# systemctl stop firewalld
On local host I have switched to "app" account to test SQL*Plus on a remote database instance:
# su - app Last login: Mon Dec 24 17:04:45 CET 2018 on pts/0 $ PATH=/usr/lib/oracle/18.3/client64/bin/:$PATH $ export LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client64/lib:$LD_LIBRARY_PATH $ sqlplus -v SQL*Plus: Release 18.0.0.0.0 - Production Version 18.3.0.0.0 $ sqlplus system/oracle@ol7defs1:1521/cdb SQL*Plus: Release 18.0.0.0.0 - Production on Mon Dec 24 17:09:08 2018 Version 18.3.0.0.0 Copyright (c) 1982, 2018, Oracle. All rights reserved. Last Successful login time: Mon Dec 24 2018 16:08:26 +01:00 Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production Version 18.3.0.0.0 SQL> column name format a10 SQL> select name, con_id from v$containers; NAME CON_ID ---------- ---------- CDB$ROOT 1 PDB$SEED 2 PDB 3 SQL> Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production Version 18.3.0.0.0 $
It is also possible to use tnsnames.ora aliases in connect strings with TNS_ADMIN environment variable.
I have also disabled Oracle Linux 7 repositories in order to keep only the Red Hat one to avoid mixing Oracle Linux and Red Hat Linux packages:
# yum repolist Loaded plugins: product-id, search-disabled-repos, subscription-manager repo id repo name status ol7_UEKR5/x86_64 Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64) 134 ol7_latest/x86_64 Oracle Linux 7Server Latest (x86_64) 11 718 ol7_oracle_instantclient/x86_64 Oracle Instant Client for Oracle Linux 7Server (x86_64) 7 rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 23 346 repolist: 35 205 # yum-config-manager --disable ol7_oracle_instantclient Loaded plugins: product-id, subscription-manager ====================================================================== repo: ol7_oracle_instantclient ====================================================================== [ol7_oracle_instantclient] async = True bandwidth = 0 base_persistdir = /var/lib/yum/repos/x86_64/7Server baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/ cache = 0 cachedir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient check_config_file_age = True compare_providers_priority = 80 cost = 1000 deltarpm_metadata_percentage = 100 deltarpm_percentage = enabled = 0 enablegroups = True exclude = failovermethod = priority ftp_disable_epsv = False gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient/gpgcadir gpgcakey = gpgcheck = True gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient/gpgdir gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle hdrdir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/headers http_caching = all includepkgs = ip_resolve = keepalive = True keepcache = False mddownloadpolicy = sqlite mdpolicy = group:small mediaid = metadata_expire = 21600 metadata_expire_filter = read-only:present metalink = minrate = 0 mirrorlist = mirrorlist_expire = 86400 name = Oracle Instant Client for Oracle Linux 7Server (x86_64) old_base_cache_dir = password = persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient pkgdir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/packages proxy = False proxy_dict = proxy_password = proxy_username = repo_gpgcheck = False retries = 10 skip_if_unavailable = False ssl_check_cert_permissions = True sslcacert = sslclientcert = sslclientkey = sslverify = True throttle = 0 timeout = 30.0 ui_id = ol7_oracle_instantclient/x86_64 ui_repoid_vars = releasever, basearch username = # yum-config-manager --disable ol7_latest Loaded plugins: product-id, subscription-manager ============================================================================= repo: ol7_latest ============================================================================= [ol7_latest] async = True bandwidth = 0 base_persistdir = /var/lib/yum/repos/x86_64/7Server baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/ cache = 0 cachedir = /var/cache/yum/x86_64/7Server/ol7_latest check_config_file_age = True compare_providers_priority = 80 cost = 1000 deltarpm_metadata_percentage = 100 deltarpm_percentage = enabled = 0 enablegroups = True exclude = failovermethod = priority ftp_disable_epsv = False gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_latest/gpgcadir gpgcakey = gpgcheck = True gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_latest/gpgdir gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle hdrdir = /var/cache/yum/x86_64/7Server/ol7_latest/headers http_caching = all includepkgs = ip_resolve = keepalive = True keepcache = False mddownloadpolicy = sqlite mdpolicy = group:small mediaid = metadata_expire = 21600 metadata_expire_filter = read-only:present metalink = minrate = 0 mirrorlist = mirrorlist_expire = 86400 name = Oracle Linux 7Server Latest (x86_64) old_base_cache_dir = password = persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_latest pkgdir = /var/cache/yum/x86_64/7Server/ol7_latest/packages proxy = False proxy_dict = proxy_password = proxy_username = repo_gpgcheck = False retries = 10 skip_if_unavailable = False ssl_check_cert_permissions = True sslcacert = sslclientcert = sslclientkey = sslverify = True throttle = 0 timeout = 30.0 ui_id = ol7_latest/x86_64 ui_repoid_vars = releasever, basearch username = # yum-config-manager --disable ol7_UEKR5 Loaded plugins: product-id, subscription-manager ============================================================================= repo: ol7_UEKR5 ============================================================================== [ol7_UEKR5] async = True bandwidth = 0 base_persistdir = /var/lib/yum/repos/x86_64/7Server baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/UEKR5/x86_64/ cache = 0 cachedir = /var/cache/yum/x86_64/7Server/ol7_UEKR5 check_config_file_age = True compare_providers_priority = 80 cost = 1000 deltarpm_metadata_percentage = 100 deltarpm_percentage = enabled = 0 enablegroups = True exclude = failovermethod = priority ftp_disable_epsv = False gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_UEKR5/gpgcadir gpgcakey = gpgcheck = True gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_UEKR5/gpgdir gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle hdrdir = /var/cache/yum/x86_64/7Server/ol7_UEKR5/headers http_caching = all includepkgs = ip_resolve = keepalive = True keepcache = False mddownloadpolicy = sqlite mdpolicy = group:small mediaid = metadata_expire = 21600 metadata_expire_filter = read-only:present metalink = minrate = 0 mirrorlist = mirrorlist_expire = 86400 name = Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64) old_base_cache_dir = password = persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_UEKR5 pkgdir = /var/cache/yum/x86_64/7Server/ol7_UEKR5/packages proxy = False proxy_dict = proxy_password = proxy_username = repo_gpgcheck = False retries = 10 skip_if_unavailable = False ssl_check_cert_permissions = True sslcacert = sslclientcert = sslclientkey = sslverify = True throttle = 0 timeout = 30.0 ui_id = ol7_UEKR5/x86_64 ui_repoid_vars = releasever, basearch username = # yum repolist Loaded plugins: product-id, search-disabled-repos, subscription-manager repo id repo name status rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 23 346 repolist: 23 346