Introduction


Why did I need the 9i version of the instantclient package? Why not use the Oracle 10g or 11i InstantClient package? If you googled so far, you might already have an idea why. In our environment is a legacy Oracle  8 database, version 8.0.5, in full production. Whatever the reasons for not upgrading it, I needed a way to monitor it and connect remotely. The first problem, which version of Oracle is backward compatible to what?  This information was difficult to get: it turns out that the last version of Oracle that supports Oracle 8.0.5 is Oracle 9i. Everything after that will not connect. This includes the OCI client and JDBC drivers as well. Luckily Oracle 9i is still available for download, but only in the full 3-disk database package, requiring a full installation. I needed the OCI instantclient funtionality to make the Nagios monitoring plugin check_oracle work. Also, I wanted to use the SQLplus and tnsping commandline.

Download the Oracle 9i 64bit Edition and extract the content:


My target system is a 64bit SuSE Linux Enterprise Server SP2 with Nagios 3.0.2, so I downloaded the Oracle 9i 64bit packages. Don't get irritated by the "amd64" file name references to AMD, it certainly works with Intel 64bit also...

fm@ml08460:/home/sw/Oracle9i>
ls -l
total 1461956
-rw-r--r-- 1 root root 552344576 2008-06-19 11:56 amd64_db_9204_Disk1.cpio
-rw-r--r-- 1 root root 587835392 2008-06-19 11:58 amd64_db_9204_Disk2.cpio
-rw-r--r-- 1 root root 355244544 2008-06-19 11:59 amd64_db_9204_Disk3.cpio

extract it with:

fm@ml08460:/home/sw/Oracle9i> gunzip amd64_db_9204_Disk1.cpio.gz
fm@ml08460:/home/sw/Oracle9i> gunzip amd64_db_9204_Disk2.cpio.gz
fm@ml08460:/home/sw/Oracle9i> gunzip amd64_db_9204_Disk3.cpio.gz

fm@ml08460:/home/sw/Oracle9i> cpio -idcmv < amd64_db_9204_Disk1.cpio
fm@ml08460:/home/sw/Oracle9i> cpio -idcmv < amd64_db_9204_Disk2.cpio
fm@ml08460:/home/sw/Oracle9i> cpio -idcmv < amd64_db_9204_Disk3.cpio

fm@ml08460:/home/sw/Oracle9i> ls -ld D*
drwxr-xr-x 6 2840 502 4096 2004-05-01 06:49 Disk1
drwxr-xr-x 3 2840 502 4096 2004-05-01 06:49 Disk2
drwxr-xr-x 3 2840 502 4096 2004-05-01 06:49 Disk3

Create the new home directory for Oracle 9i


There is no need to create a extra oracle user or group, as long as the account accessing the Oracle client has the ORACLE_HOME and LD_LIBRARY_PATH set correctly. LD_LIBRARY PATH can be avoided by an entry in /etc/ld.so.conf. For my setup, the installation required approximately 46 MB of disk space.

mkdir -p /home/oracle/instantclient_9
cd /home/oracle/instantclient_9

Extract the bare minimum client libraries required for the OCI client


This is the most tricky part to figure out. Error messages pointed the way to which files are missing, and strace is a great help to determine what else goes wrong. For this step we need the Java development kit (JAVASDK) to get the Java binary jar, allowing us to ectract the libraries from its Oracle package containers. Jar handling is almost like tar.

fm@ml08460:/home/oracle/instantclient_9> jar xf
/home/sw/Disk2/stage/Components/oracle.rdbms.sqlplus/9.2.0.4.0/1/DataFiles/lib.1.1.jar
fm@ml08460:/home/oracle/instantclient_9> jar xf
/home/sw/Disk2/stage/Components/oracle.rdbms.occi/9.2.0.4.0/1/DataFiles/lib.1.1.jar
fm@ml08460:/home/oracle/instantclient_9> jar xf
/home/sw/Disk1/stage/Components/oracle.rsf.clntsh_rsf/9.2.0.4.0/1/DataFiles/lib.1.1.jar

fm@ml08460:/home/oracle/instantclient_9> ln -s libclntsh.so.9.0 libwtc9.so

Extract the SQLplus and Oracle NET client commands, add the SQLplus message file


These files provide the commandline interface and the basic error messages.

fm@ml08460:/home/oracle/instantclient_9> mkdir bin
fm@ml08460:/home/oracle/instantclient_9> cd bin
fm@ml08460:/home/oracle/instantclient_9/bin> jar xf
/home/sw/Disk2/stage/Components/oracle.rdbms.sqlplus/9.2.0.4.0/1/DataFiles/bin.1.1.jar
fm@ml08460:/home/oracle/instantclient_9/bin> jar xf
/home/sw/Disk2/stage/Components/oracle.networking.netclt/9.2.0.4.0/1/DataFiles/bin.1.1.jar
fm@ml08460:/home/oracle/instantclient_9/bin> cd ..

fm@ml08460:/home/oracle/instantclient_9> mkdir -p sqlplus/mesg

fm@ml08460:/home/oracle/instantclient_9> cd sqlplus/mesg
fm@ml08460:/home/oracle/instantclient_9/sqlplus/mesg> jar xf
/home/sw/Disk2/stage/Components/oracle.rdbms.sqlplus/9.2.0.4.0/1/DataFiles/mesg.1.1.jar
fm@ml08460:/home/oracle/instantclient_9/sqlplus/mesg>
cd ../..

Extract the TimeZone Info file for SQLplus


Next, we need the timezone.dat and timezonelrg.dat files

fm@ml08460:/home/oracle/instantclient_9> mkdir -p oracore/zoneinfo
fm@ml08460:/home/oracle/instantclient_9> cd oracore/zoneinfo
fm@ml08460:/home/oracle/instantclient_9/oracore/zoneinfo> jar xf
/home/sw/Disk1/stage/Components/oracle.rsf.oracore_rsf/9.2.0.4.0/1/DataFiles/zone.1.1.jar
fm@ml08460:/home/oracle/instantclient_9/oracore/zoneinfo> cd ../..

Extract the Network Client message files


Now we are extracting the network client message files, i.e. containing the tnsping error messages:

fm@ml08460:/home/oracle/instantclient_9> mkdir -p network/mesg
fm@ml08460:/home/oracle/instantclient_9> cd network/admin
fm@ml08460:/home/oracle/instantclient_9/network/admin> jar xf
/home/sw/Oracle9i/Disk2/stage/Components/oracle.networking.netclt/9.2.0.4.0/1/DataFiles/mesg.1.1.jar
fm@ml08460:/home/oracle/instantclient_9/network/admin> cd ../..

Almost there. We create the client configuration files, tnsnames.ora and sqlnet.ora.


Appearantly, the values there depend on your DB location and settings.

fm@ml08460:/home/oracle/instantclient_9> mkdir -p network/admin
fm@ml08460:/home/oracle/instantclient_9> cd network/admin
fm@ml08460:/home/oracle/instantclient_9/network/admin> vi tnsnames.ora
fm@ml08460:/home/oracle/instantclient_9/network/admin> vi sqlnet.ora

In order for the check_oracle to work in nagios, I added the export commands on top of /etc/init.d/nagios startup program.

fm@ml08460:/home/oracle> export ORACLE_HOME=/home/oracle/instantclient_9
fm@ml08460:/home/oracle/> export LD_LIBRARY_PATH=/home/oracle/instantclient_9

Finally we can try it out:


Voila, it works...

fml08460:/home/oracle/instantclient_9 # bin/sqlplus xxxxx@yyyy
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jun 24 17:42:16 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Enter password:

Connected to:
Oracle8 Enterprise Edition Release 8.0.5.2.1 - Production
PL/SQL Release 8.0.5.2.0 - Production

SQL>

ml08460:/home/local/oracle/instantclient_9 # du -sk .
45464

Reference file listing


Below is a complete list of files, representing a working Oracle 9i instantclient setup.

fm@ml08460:~ # ls -lR /home/oracle/instantclient_9
/home/oracle/instantclient_9: total 36792
drwxr-xr-x 2 root root     4096 2008-06-25 09:18 bin
-rw-r--r-- 1 root root     2588 2008-06-24 16:47 facility.lis
-rw-r--r-- 1 root root 13189409 2008-06-24 16:47 libclntsh.so.9.0
-rw-r--r-- 1 root root 21223006 2008-06-24 16:47 libclntst9.a
-rw-r--r-- 1 root root  1024802 2008-06-24 16:48 libocci9.a
-rw-r--r-- 1 root root   471160 2008-06-24 16:48 libocci.so.9.0
-rw-r--r-- 1 root root  1332204 2008-06-24 16:47 libsqlplus.a
lrwxrwxrwx 1 root root       51 2008-06-24 18:46 libwtc9.so ->
 /home/oracle/instantclient_9/libclntsh.so.9.0
-rw-r--r-- 1 root root   319208 2008-06-24 16:47 libxsd9.a
drwxr-xr-x 4 root root     4096 2008-06-25 09:20 network
drwxr-xr-x 3 root root     4096 2008-06-24 17:16 oracore
-rw-r--r-- 1 root root     2638 2008-06-25 17:09 readme.20080624
-rw-r--r-- 1 root root     1432 2008-06-24 16:47 s0afimai.o
drwxr-xr-x 3 root root     4096 2008-06-24 17:01 sqlplus
-rw-r--r-- 1 root root       25 2008-06-24 16:47 sysliblist

/home/oracle/instantclient_9/bin:
total 7164
-rwxr-xr-x 1 root root   12977 2008-06-25 09:14 adapters
-rwxr-xr-x 1 root root    2387 2008-06-25 09:14 gensyslib
-rwxr-xr-x 1 root root    2131 2008-06-23 13:10 helpins
-rwxr-xr-x 1 root root 3182232 2008-06-25 09:14 namesctl
-rwxr-xr-x 1 root root    2365 2008-06-25 09:14 oerr
-rwxr-xr-x 1 root root 3342889 2008-06-25 09:14 onrsd
-rwxr-xr-x 1 root root    1745 2008-06-23 13:10 pupbld
-rwxr-xr-x 1 root root  700268 2008-06-23 13:10 sqlplus
-rwxr-xr-x 1 root root   20116 2008-06-25 09:14 tnsping
-rwxr-xr-x 1 root root    2967 2008-06-25 09:14 trcasst.sbs
-rwxr-xr-x 1 root root    1268 2008-06-25 09:14 trcfmt
-rwxr-xr-x 1 root root   30892 2008-06-25 09:14 trcroute

/home/oracle/instantclient_9/network:
total 8
drwxr-xr-x 2 root root 4096 2008-06-23 13:11 admin
drwxr-xr-x 2 root root 4096 2008-06-25 09:21 mesg

/home/oracle/instantclient_9/network/admin:
total 8
-rw-r--r-- 1 root root  44 2008-06-23 13:11 sqlnet.ora
-rw-r--r-- 1 root root 530 2008-06-23 13:11 tnsnames.ora

/home/oracle/instantclient_9/network/mesg:
total 764
-rw-r--r-- 1 root root   6144 2008-06-25 09:21 ncrus.msb
-rw-r--r-- 1 root root  16420 2008-06-25 09:21 ncrus.msg
-rw-r--r-- 1 root root   5632 2008-06-25 09:21 ncxus.msb
-rw-r--r-- 1 root root  11426 2008-06-25 09:21 ncxus.msg
-rw-r--r-- 1 root root  10240 2008-06-25 09:21 niqus.msb
-rw-r--r-- 1 root root  52054 2008-06-25 09:21 niqus.msg
-rw-r--r-- 1 root root   3584 2008-06-25 09:21 nmpus.msb
-rw-r--r-- 1 root root   5895 2008-06-25 09:21 nmpus.msg
-rw-r--r-- 1 root root   4608 2008-06-25 09:21 nmrus.msb
-rw-r--r-- 1 root root  12464 2008-06-25 09:21 nmrus.msg
-rw-r--r-- 1 root root   5632 2008-06-25 09:21 nncus.msb
-rw-r--r-- 1 root root  21630 2008-06-25 09:21 nncus.msg
-rw-r--r-- 1 root root   8704 2008-06-25 09:21 nnfus.msb
-rw-r--r-- 1 root root  17859 2008-06-25 09:21 nnfus.msg
-rw-r--r-- 1 root root  26624 2008-06-25 09:21 nnlus.msb
-rw-r--r-- 1 root root  67325 2008-06-25 09:21 nnlus.msg
-rw-r--r-- 1 root root  13312 2008-06-25 09:21 nnous.msb
-rw-r--r-- 1 root root  62515 2008-06-25 09:21 nnous.msg
-rw-r--r-- 1 root root   5120 2008-06-25 09:21 nplus.msb
-rw-r--r-- 1 root root  11827 2008-06-25 09:21 nplus.msg
-rw-r--r-- 1 root root   9216 2008-06-25 09:21 nzus.msb
-rw-r--r-- 1 root root   9256 2008-06-25 09:21 nzus.msg
-rw-r--r-- 1 root root   6144 2008-06-25 09:21 snlus.msb
-rw-r--r-- 1 root root   4658 2008-06-25 09:21 snlus.msg
-rw-r--r-- 1 root root   3584 2008-06-25 09:21 tnlus.msb
-rw-r--r-- 1 root root   1041 2008-06-25 09:21 tnlus.msg
-rw-r--r-- 1 root root   7168 2008-06-25 09:21 tnplus.msb
-rw-r--r-- 1 root root   5697 2008-06-25 09:21 tnplus.msg
-rw-r--r-- 1 root root  46592 2008-06-25 09:21 tnsus.msb
-rw-r--r-- 1 root root 233050 2008-06-25 09:21 tnsus.msg

/home/oracle/instantclient_9/oracore:
total 4
drwxr-xr-x 2 root root 4096 2008-06-24 17:28 zoneinfo

/home/oracle/instantclient_9/oracore/zoneinfo:
total 520
-rw-r--r-- 1 root root 370494 2008-06-24 17:28 timezlrg.dat
-rw-r--r-- 1 root root 148797 2008-06-24 17:28 timezone.dat

/home/oracle/instantclient_9/sqlplus:
total 4
drwxr-xr-x 2 root root 4096 2008-06-24 17:11 mesg

/home/oracle/instantclient_9/sqlplus/mesg:
total 196
-rw-r--r-- 1 root root   4096 2008-06-24 17:10 cpyus.msb
-rw-r--r-- 1 root root   1817 2008-06-24 17:10 cpyus.msg
-rw-r--r-- 1 root root  11264 2008-06-24 17:10 sp1us.msb
-rw-r--r-- 1 root root  16590 2008-06-24 17:10 sp1us.msg
-rw-r--r-- 1 root root  31232 2008-06-24 17:10 sp2us.msb
-rw-r--r-- 1 root root 114029 2008-06-24 17:10 sp2us.msg
-rw-r--r-- 1 root root   3584 2008-06-24 17:10 sp3us.msb
-rw-r--r-- 1 root root    506 2008-06-24 17:10 sp3us.msg