DBD-Oracle - Re: DBD and Oracle Instantclient 10

Posted on Fri Apr 28 20:42:29 2006 by flexx in response to 1484 (See the whole thread of 18)
Re: DBD and Oracle Instantclient 10
> I also had trouble with the environment variables; this is what finally worked: > ORACLE_HOME=/usr/lib/oracle/10.2.0.1/client/lib > LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.1/client/lib > after those two changes, I could run `perl Makefile.PL` with no args and get a working makefile.

I got a makefile, using the same trick with Instant Client 10.2.0.2 and DBD::Oracle 1.17 (unaltered from CPAN), on my gentoo linux box, too.

However things didn't work after installation. When I tried to connect to a database (with a script that works fine on other host with a DBI::Oracle compiled against the full client) i get:

ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc.

It seems that the makefile looks for a directory $ORACLE_HOME/sdk/include which is included in the dirstibution file /usr/portage/distfiles/instantclient-sdk-linux32-10.2.0.2-20060331.zip:

# unzip -l /usr/portage/distfiles/instantclient-sdk-linux32-10.2.0.2-20060331.zip Archive: /usr/portage/distfiles/instantclient-sdk-linux32-10.2.0.2-20060331.zip Length Date Time Name -------- ---- ---- ---- 0 02-05-06 06:50 instantclient_10_2/sdk/ 0 02-05-06 06:50 instantclient_10_2/sdk/include/ 2115 02-05-06 06:50 instantclient_10_2/sdk/include/occi.h 38724 02-05-06 06:50 instantclient_10_2/sdk/include/occiCommon.h 73063 02-05-06 06:50 instantclient_10_2/sdk/include/occiControl.h 35218 02-05-06 06:50 instantclient_10_2/sdk/include/occiData.h 29156 02-05-06 06:50 instantclient_10_2/sdk/include/occiObjects.h 11600 02-05-06 06:50 instantclient_10_2/sdk/include/occiAQ.h 150915 02-05-06 06:50 instantclient_10_2/sdk/include/oci.h 7155 02-05-06 06:50 instantclient_10_2/sdk/include/oci1.h 10361 02-05-06 06:50 instantclient_10_2/sdk/include/oci8dp.h 410791 02-05-06 06:50 instantclient_10_2/sdk/include/ociap.h 6055 02-05-06 06:50 instantclient_10_2/sdk/include/ociapr.h 43225 02-05-06 06:50 instantclient_10_2/sdk/include/ocidef.h 4014 02-05-06 06:50 instantclient_10_2/sdk/include/ocidem.h 11331 02-05-06 06:50 instantclient_10_2/sdk/include/ocidfn.h 8954 02-05-06 06:50 instantclient_10_2/sdk/include/ociextp.h 6638 02-05-06 06:50 instantclient_10_2/sdk/include/ocikpr.h 4351 02-05-06 06:50 instantclient_10_2/sdk/include/ocixmldb.h 19099 02-05-06 06:50 instantclient_10_2/sdk/include/odci.h 6605 02-05-06 06:50 instantclient_10_2/sdk/include/oratypes.h 102726 02-05-06 06:50 instantclient_10_2/sdk/include/ori.h 15031 02-05-06 06:50 instantclient_10_2/sdk/include/orid.h 157674 02-05-06 06:50 instantclient_10_2/sdk/include/orl.h 42626 02-05-06 06:50 instantclient_10_2/sdk/include/oro.h 116591 02-05-06 06:50 instantclient_10_2/sdk/include/ort.h 9520 02-05-06 06:50 instantclient_10_2/sdk/include/xa.h 85310 02-05-06 06:50 instantclient_10_2/sdk/include/nzt.h 33230 02-05-06 06:50 instantclient_10_2/sdk/include/nzerror.h 0 02-05-06 06:50 instantclient_10_2/sdk/demo/ 4053 02-05-06 06:50 instantclient_10_2/sdk/demo/demo.mk 14146 02-05-06 06:50 instantclient_10_2/sdk/demo/cdemo81.c 7202 02-05-06 06:50 instantclient_10_2/sdk/demo/occidemo.sql 1868 02-05-06 06:50 instantclient_10_2/sdk/demo/occidemod.sql 7351 02-05-06 06:50 instantclient_10_2/sdk/demo/occidml.cpp 4727 02-05-06 06:50 instantclient_10_2/sdk/demo/occiobj.cpp 60 02-05-06 06:50 instantclient_10_2/sdk/demo/occiobj.typ 298274 02-05-06 06:50 instantclient_10_2/sdk/ottclasses.zip 346 02-05-06 06:50 instantclient_10_2/sdk/ott -------- ------- 1780105 39 files

Then we have the basic package of course:

#unzip -l /usr/portage/distfiles/instantclient-basic-linux32-10.2.0.2-20060331.zip Archive: /usr/portage/distfiles/instantclient-basic-linux32-10.2.0.2-20060331.zip Length Date Time Name -------- ---- ---- ---- 1594191 02-05-06 06:50 instantclient_10_2/classes12.jar 18774535 02-05-06 06:50 instantclient_10_2/libclntsh.so.10.1 5623929 02-05-06 06:50 instantclient_10_2/libnnz10.so 1398088 02-05-06 06:50 instantclient_10_2/libocci.so.10.1 70690282 02-05-06 06:50 instantclient_10_2/libociei.so 119919 02-05-06 06:50 instantclient_10_2/libocijdbc10.so 1540457 02-05-06 06:50 instantclient_10_2/ojdbc14.jar -------- ------- 99741401 7 files

On my gentoo linux box the installation resides under /usr/lib/oracle/10.2.0.2/client as follows:

#tree /usr/lib/oracle/10.2.0.2/client/ /usr/lib/oracle/10.2.0.2/client/ |-- bin | `-- sqlplus |-- include | |-- nzerror.h | |-- nzt.h | |-- occi.h | |-- occiAQ.h | |-- occiCommon.h | |-- occiControl.h | |-- occiData.h | |-- occiObjects.h | |-- oci.h | |-- oci1.h | |-- oci8dp.h | |-- ociap.h | |-- ociapr.h | |-- ocidef.h | |-- ocidem.h | |-- ocidfn.h | |-- ociextp.h | |-- ocikpr.h | |-- ocixmldb.h | |-- odci.h | |-- oratypes.h | |-- ori.h | |-- orid.h | |-- orl.h | |-- oro.h | |-- ort.h | `-- xa.h `-- lib |-- classes12.jar |-- glogin.sql |-- libclntsh.so -> /usr/lib/oracle/10.2.0.2/client/lib/libclntsh.so.10.1 |-- libclntsh.so.10.1 |-- libheteroxa10.so |-- libnnz10.so |-- libocci.so -> /usr/lib/oracle/10.2.0.2/client/lib/libocci.so.10.1 |-- libocci.so.10.1 |-- libociei.so |-- libocijdbc10.so |-- libsqlplus.so |-- libsqlplusic.so |-- ojdbc14.jar `-- orai18n.jar

Well, quite a lot has moved:

1. the demo directory from the SDK was omitted (should not be a problem)
2. the ott directory from the SDK was ommitted (should not be a problem)
3. the files of the basic package moved from / to /lib
4. the rest of the SDK moved from /sdk/include to /include

Item 3 probably explains why setting $ORACLE_HOME to ../lib appears to work on gentoo, but also explains why the include files cannot be found during installation:

********************************************************* I can't find the header files I need in your Oracle installation. You probably need to install some more Oracle components. For Instant Client that means the SDK package. I'll keep going, but the compile will probably fail. See README.clients.txt for more information. *********************************************************

I am bit stuck now.

The "correct" ORACLE_HOME for my system is /usr/lib/oracle/10.2.0.2/client, but with that the installation is not recogized correctly in the build process. If I set ORACLE_HOME and LD_LIBRARY_PATH to /usr/lib/oracle/10.2.0.2/client/lib the build finishes, but the build module does not work (probably because at runtime ORACLE_HOME has to point to /usr/lib/oracle/10.2.0.2/client again, unless I want to break lots of other things in my system).

Perhaps the makefile could not look for specific things in specific directories unter $ORACLE_HOME, but rather simply look for the files it needs *anywhere* below $ORACLE_HOME.

I haven't the time to dig in more myself now unfortunately, I was just hoping these observations might be of help to byterock or someone else who *has* the time to dig in... ;)

Cheers,
Flexx

flexx "at" chello.at

Direct Responses: 2211 | Write a response