Installing the Oracle Instant Client is probably the simplest solution to get a Oracle server access from a Unix/Linux/Windows/MacOS client. Oracle provides some RPM (usable with Fedora) for some versions and for some architectures. For others versions, only ZIP archives are available on their site.

Personally, official RPM don't suits my need for various reasons:

  • Installation in /usr/lib instead of /usr/lib64
  • No provides (mandatory to solve dependencies between packages)
  • No configuration for the shared libraries dynamic load

For this reasons, I'm used, for years, to build my own RPM, which I use to build and run tora or php-oci8. Of course, it will be great if I could distribute them on my repository, but the Oracle license probably don't allow this.

This is an update of this small guide for the new version 11.2.0.2.0 which will be used for my next build.

Setting the environment

About 300Mio of disk space will be required.

Under the root account, install the needed tools

yum install rpmdevtools rpm-build unzip

Create a dedicated account, you must never build under the root account, and a dedicated account is always a good idea.

useradd orabuild

Under the new orabuild account, setup the needed directories

rpmdev-setuptree

Getting the latest versions

Download from the Oracle web site the last version of the available archives, and save them in the  ~/rpmbuild/SOURCES folder

32 bits version :

  • instantclient-basic-linux32-11.2.0.2.0.zip
  • instantclient-jdbc-linux32-11.2.0.2.0.zip
  • instantclient-odbc-linux32-11.2.0.2.0.zip
  • instantclient-sdk-linux32-11.2.0.2.0.zip
  • instantclient-sqlplus-linux32-11.2.0.2.0.zip
  • instantclient-tools-linux32-11.2.0.2.0.zip

64 bits version:

  • instantclient-basic-linux-x86-64-11.2.0.2.0.zip
  • instantclient-jdbc-linux-x86-64-11.2.0.2.0.zip
  • instantclient-odbc-linux-x86-64-11.2.0.2.0.zip
  • instantclient-sdk-linux-x86-64-11.2.0.2.0.zip
  • instantclient-sqlplus-linux-x86-64-11.2.0.2.0.zip
  • instantclient-tools-linux-x86-64-11.2.0.2.0.zip

Download from my repository the last version of the source RPM, into the ~/rpmbuild/SRPMS folder

For i386 : oracle-instantclient-i386-11.2.0.2.0-1.remi.nosrc.rpm

For x86_64 : oracle-instantclient-x86_64-11.2.0.2.0-1.remi.nosrc.rpm

Bulding the RPM

Always under the  orabuild account:

rpmbuild --rebuild rpmbuild/SRPMS/oracle-instantclient-*-11.2.0.2.0-1.remi.nosrc.rpm

After a few minutes... you'll have the RPM available in the ~/rpmbuild/RPMS/i386 or ~/rpmbuild/RPMS/x86_64 folder:

Wrote: /home/orabuild/rpmbuild/RPMS/x86_64/oracle-instantclient-basic-11.2.0.2.0-1.fc14.x86_64.rpm
Wrote: /home/orabuild/rpmbuild/RPMS/x86_64/oracle-instantclient-devel-11.2.0.2.0-1.fc14.x86_64.rpm
Wrote: /home/orabuild/rpmbuild/RPMS/x86_64/oracle-instantclient-jdbc-11.2.0.2.0-1.fc14.x86_64.rpm
Wrote: /home/orabuild/rpmbuild/RPMS/x86_64/oracle-instantclient-odbc-11.2.0.2.0-1.fc14.x86_64.rpm
Wrote: /home/orabuild/rpmbuild/RPMS/x86_64/oracle-instantclient-sqlplus-11.2.0.2.0-1.fc14.x86_64.rpm
Wrote: /home/orabuild/rpmbuild/RPMS/x86_64/oracle-instantclient-tools-11.2.0.2.0-1.fc14.x86_64.rpm

Installation / Utilisation

You can now install this RPM as usually, under the root account:

yum install --nogpgcheck /home/orabuild/rpmbuild/RPMS/*/oracle-instantclient-*-11.2.0.2.0-1.*.rpm

You can test your access to the server with the usual command:

sqlplus  user/login@serveur:port/SID

To continue, you can read, for example Accès aux bases de données Oracle en PHP (which need to be translated)

As always, your feedback is welcome.