How To

Install Oracle Instant Client on Linux

This page is a fast and easy (trivial) guide to install Oracle Instant Client 11g R2 into a fresh installed Red Hat Enterprise Linux 5 [Ed. for RHEL-6, RHEL-7, OEL-X, CentOS-X too].

Instant Client allows for a fast and easy configuration of base Oracle client software. In few minutes You can connect to Oracle with SQL*Plus or from Your programs.
Oracle Instant client is licensed but is free of charge.

Prerequisites
Almost none!

Preparation (as root)

Download all the required RPM from the official site and put them on the target system.
Current RPMs for 32bit are:
 oracle-instantclient11.2-basic-11.2.0.2.0-1.rpm
 oracle-instantclient11.2-sqlplus-11.2.0.2.0-1.rpm

[Ed. 2016-08 update: oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm]

Install Install RPMs: # rpm -ilv oracle-instantclient11.2-sqlplus-11.2.0.2.0-1.rpm oracle-instantclient11.2-basic-11.2.0.2.0-1.rpm Create oracle user, group, ... configure profile: # groupadd -g 500 dba # useradd -u 500 -d /usr/lib/oracle/11.2/client -g "dba" oracle $ vi ~oracle/.bash_profile export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib export TNS_ADMIN=/usr/lib/oracle/11.2/client export ORACLE_HOME=/usr/lib/oracle/11.2/client Test Create new /usr/lib/oracle/11.2/client/tnsnames.ora like this:

TEST =
  (DESCRIPTION =
    (ADDRESS_LIST =
        (ADDRESS =
          (COMMUNITY = tcp.world)
          (PROTOCOL = TCP)
          (Host = tst-ora11.xenialab.it)
          (Port = 1521)
        )
    )
    (CONNECT_DATA = (SID = ORA11TST)
    )
  )
Connect to Your database with: $ sqlplus scott/tiger@TEST You can also use the Easy Connect connection string format (does not use TNSNAMES): $ sqlplus scott/tiger@tst-ora11.xenialab.it:1521/ORA11TST
If You prefer the italian version of this document...

Version: 1.0.1
Author: mail@meo.bogliolo.name