본문 바로가기

프로그래밍/리눅스

Oracle Instant Client 11g on Ubuntu (우분투에 오라크 11g InstantClient 설치하기)





 
« on: May 04, 2009, 04:45:38 PM »

I know things have been quiet. I've been quite busy and I am also getting ready to share some things that I've been working on. One of the bigger things is looking at Ubuntu Server as a possible distro to use for our Linux servers. As you may already know that Oracle makes available Oracle Instant Client 11g as either RPM or zip package. Ubuntu being a debian based distro is out of luck. Also Oracle doesn't officially support debian or any debian based distro (which would explain the lack of binary packages). They do make 32-bit Oracle XE binaries available for Debian/Ubuntu ( http://www.oracle.com/technology/tech/linux/install/xe-on-kubuntu.html )?

So I tried to install things from .zip packages. The process is tedious and the files are all in one big directory which is totally different from RPM install/setup. Also shocking is the use of zip packages on Linux (and lack of symlink support in zip format). Another issue is that all those configure based scripts might not be able to handle the zip based installs. Also installing files from sources or zips kinda breaks the binary packagement rules. If you are still insistent on using ZIP packages here are updated notes from oracle: http://www.oracle.com/technology/pub/notes/technote_php_instant.html

So what do you do if Oracle won't release debian packages. The simple answer: build .deb(s) yourself. It's quite simple actually and works quite nicely. We will use a package called Alien. It's a great little tool that does binary package conversion.

Here's how:
1. Install libaio1 (this is now a requirement for Oracle 11g). you don't need it for Oracle 10g Instant Client:
Code:
apt-get install libaio1

2. Install alien:
Code:
apt-get install alien

3. Download the RPMs from here: http://www.oracle.com/technology/tech/oci/instantclient/index.html  I usually grab grab the Basic, Devel and SqlPlus. (Basic Lite RPM doesn't work if you want to install Devel and/or SQLPlus).

4. Convert RPMs to .deb using alien:
Code:
alien oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
 alien oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
 alien oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm

5. Install the debian packages:
Code:
dpkg -i oracle-instantclient11.1-basic_11.1.0.7.0-2_i386.deb oracle-instantclient11.1-devel_11.1.0.7.0-2_i386.deb  oracle-instantclient11.1-sqlplus_11.1.0.7.0-2_i386.deb

6. And you are pretty much done.
Code:
aptitude search oracle
p   cl-sql-oracle                                                          - CLSQL database backend, Oracle
p   libmono-oracle1.0-cil                                                  - Mono Oracle library
p   libmono-oracle2.0-cil                                                  - Mono Oracle library
i   oracle-instantclient11.1-basic                                         - Instant Client for Oracle Database 11g
i   oracle-instantclient11.1-devel                                         - Development headers for Instant Client.
i   oracle-instantclient11.1-sqlplus                                       - SQL*Plus for Instant Client.
p   spamoracle                                                             - A statistical analysis spam filter based on Bayes' formula
p   spamoracle-byte                                                        - A statistical analysis spam filter based on Bayes' formula

P.S. The added benefit is that "pear install pecl/oci8" works out of the box. Just hit enter at the prompt and you got yourself a working php oci8 binary module.

Enjoy,

Gena01