[Gena01 Logo]
July 16, 2024, 05:02:18 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
   Home   Help Search Tags Login Register  
Pages: [1]
Author Topic: My recent learnings with Oracle Instant Client and OCI8 API.  (Read 138898 times)
0 Members and 1 Guest are viewing this topic.
Sr. Member
Posts: 423

« on: May 13, 2010, 03:10:12 pm »

I was recently involved in upgrading our Application servers to the latest Oracle Instant Client 11.g ( including installing the latest PHP OCI8 (http://pecl.php.net/package/ociCool module (1.4.1).

Currently Oracle provides binaries for Linux in RPM and ZIP(?) format. (Side note: It still puzzles me as to why Oracle uses ZIP files for Linux binaries as ZIP is common to Windows and is not always available or generally used on Linux.)

I thought I was well prepared for the upgrade and we had enough time allocated to do some other maintenance tasks in the same window as well so I wasn't worried. I made all the prep work before hand and I was all set. This was going to be a piece of cake. I've done this sort of setup in Development and a bunch of other servers a number of times. I have even created my own setup and steps involved for the whole process. Including a patch to make things easier during the configure process.

A couple of interesting things happened though:
1. RPMs that Oracle provides are broken. They don't define all the required dependencies that they need. I saw this on a cpl of systems where after installing the RPM packages and running sqlplus I was told that a library was missing and that sqlplus couldn't start. This is how I remembered that I also need libaio to be installed.
2. When trying to do 'pear upgrade pecl/oci8' I ran into a rather weird issue. I got a ton of errors and the package wouldn't compile. This had me scratching my head for a little while. As it turns out I had set ORACLE_HOME in my environment (I guess I should document as to what I was trying to achieve by using ORACLE_HOME) and this screwed up configure script. So configure script managed to find the libraries for linking but didn't do sufficient checking for the include directory as it though that a full oracle client was installed. When trying to make it failed to locate oci.h which in turn triggered a ton of errors and warnings.
LESSON: Make sure you unset or never set ORACLE_HOME when trying to compile oci8 from PECL.
3. I had Oracle Instant Client 11.1 installed on another box. This one is an Ubuntu (Debian DEB packaging) VM. Since this was a production server I was trying to take a safe approach. So I used alien to convert RPMs to Debs and then uninstalled everything but 11.1 basic. Then i went and installed 11.2 DEbs along side which was fine until I tried to remove 11.1 basic package. All hell broke loose as it turns out that during conversion Alien found Oracle Instant Client 11.1 and made that a dependency of Oracle Instant Client 11.2. I had to remove 11.1 completely and run alien again to rebuild the DEBs. This was a big surprise to me. I sure hope that Oracle starts producing DEBs along side RPMS.

On the positive side I still managed to complete all of my tasks during the maintenance window. I was also lucky enough that we allocated enough time for the maintenance itself. After talking to one of our Sys Admins (SA's) it might have been a good thing that I was doing the upgrade as SAs are not always knowledgeable as to why things break on the Oracle Client side. Also specific knowledge that ORACLE_HOME can break things that bad is also a little known fact.

I hope somebody finds these notes useful and is able to save a ton of time not repeating these mistakes.

Tags: PHP Oracle Oracle Instant Client 
Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines | Sitemap Valid XHTML 1.0! Valid CSS!