RPM Oracle Instant Client
+
Par Remi le vendredi 12 novembre 2010, 19:03 - HowTo - Lien permanent
A short guide to build RPM of Oracle Instant Client.
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.
Commentaires
There is a problem with unixODBC:
Fehler: Package: oracle-instantclient-odbc-11.2.0.2.0-1.fc14.i686 (/oracle-instantclient-odbc-11.2.0.2.0-1.fc14.i686)
Requires: libodbcinst.so.1
# rpm -q unixODBC
unixODBC-2.2.14-12.fc14.i686
# rpm -ql unixODBC|grep libodbcinst
/usr/lib/libodbcinst.so
/usr/lib/libodbcinst.so.2
/usr/lib/libodbcinst.so.2.0.0
@teekay, RPM only detect libraries required by the binaries provided by Oracle.
libodbcinst.so.1 is available on RHEL-5, and on fedora <= 10.
As new RHEL-6 (and fedora >= 11) provides libodbcinst.so.2, we could expect Oracle to publish a new version (they only support commercial distributions).
So, if you really need oracle ODBC client, you have to wait for Oracle. The others packages could be installed, and run without issue for the test I have done.
I can't do miracle with proprietary software... this could be so simple with the sources...
+
@Remi
Just being curious, why did you split the SPEC file?.
@teekay
About the libodbcinst library, you can create a link to libodbcinst.so.2 named libodbcinst.so.1, it's ugly but it'll work..
@teekay
Well, it MIGHT work, I see that there are some ABI changes also
@Ciro : spec is split to be simpler than a single one with a lot of conditional stuff. And each arch have separate release date.
A soname bump (for libodbcinst) always means and ABI change. So the link solution should never be expected as a working one.
+
Hmm, did some modifications to your spec files, merged them again (sorry :P)
About the precomp subpackage, the *.h file should go in a *-devel package, so the package names started to look long and ugly. Maybe we should just merge the sdk and precomp zips content in oracle-instantclient-devel...
%changelog
* Sat Jan 1 2011 Ciro Iriarte <ciro.iriarte@gmail.com> 11.2.0.2.0
- merge i386/x86_64 SPECs again
- fixed RPM Groups
- added Jean-Christophe Duberga's config script to help building Perl-DBD-Oracle
(this wasn't documented on my first change in 2007, and was lost in OBS)
- skip RPATH and BYTECODE verifications in OBS builds
- renamed oracle-instantclient-basic to oracle-instantclient
- added unzip to BuildRequires
- general cleanup to make openSUSE 11.3 sanity checks happy
o ToDo: Verify rpmlint filters
- add precomp and precomp-devel sub-packages
@Ciro : can you please share your changes ?
Of course... I plan to do at least another minor change (today?). My changes are kind of large this time because of the merge, so won't be practical to make a patch
Ref: http://cyruspy.wordpress.com/2011/0...
Update to version 11.2.0.3.0
Update to version 12.1.0.1.0
Client version 11.1 allow connection to server version 12.1, 11.2, 11.1, 10.2.0.2 and 9.2.0.4
Client version 12.1 allow connection to server version 12.1, 11.2, 11.1, and 10.2.0.2.
Update to version 12.1.0.2.0 (yes, I'm late)
Update to version 12.2.0.1.0
Update to version 18.3.0.0.0
Notice: client version 18c allow to connect to same server versions than previous one, so: 18c, 12.2, 12.1 and 11.2.
Update to version 19.3.0.0.0
Oracle Call Interface 19.3 can connect to Oracle Database 11.2 or later.
Update to version 18.5.0.0.0 (x86_64 only)
Update to version 19.5.0.0.0
Oracle Call Interface 19.5 can connect to Oracle Database 11.2 or later.
Update to version 19.6.0.0.0
Update to version 19.8.0.0.0
Update to version 21.1.0.0.0
Version 21.1 allow connection to server version 12.1 and later (11.2 will work but isn't officially supported)
Update to version 21.3.0.0.0
Update to version 21.4.0.0.0
Update to version 21.5.0.0.0
Update to version 21.7.0.0.0
Update to version 21.8.0.0.0
Update to version 21.10.0.0.0