symbol lookup error for DBD-Oracle 1.19 and Oracle instantclient10.2.0.3

symbol lookup error for DBD-Oracle 1.19 and Oracle instantclient10.2.0.3

am 24.09.2007 21:23:54 von koczan

Hello all,

I'm trying to get an Oracle client working under Linux and I'm having
problems running a test script. Here's the error:
[koczan@ator] lab $ perl oracle.pl
perl: symbol lookup error:
/s/oracle/perl5/lib/site_perl/5.8.6/i686-linux-64int/auto/DB D/Oracle/Oracle.so:
undefined symbol: OCINlsEnvironmentVariableGet

And here are details: I'm using Oracle's instantclient 10.2.0.3 and
stock DBD-Oracle 1.19 (except for I downloaded Makefile-instantclient.PL
and oracle-instantclient-config from
http://jeanchristophe.duber.free.fr/dbd_oracle_instantclient _linux/ and
changed paths in the config script as appropriate).

I used the .zip installers and changed some paths to fit better in our
infrastructure (e.g. the lib*.so files are in /s/oracle/lib and properly
symlinked).

I built using these commands:
perl Makefile-instantclient.PL PREFIX=/s/oracle/perl5
make
make install

It installed fine, but whenever I try to connect to a server, I get the
aforementioned error.

I have to muck with a few environment variables to connect via SQL*Plus,
specifically:
export ORACLE_HOME=/s/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TWO_TASK=INFOACCESS.CS.WISC.EDU
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin

sqlplus # which works after my username and password

So, in the perl script, I do this:
------------
#!/s/std/bin/perl

use DBI;
use lib '/s/oracle/perl5/lib';
use lib '/s/oracle/perl5/lib/site_perl';

use strict;

$ENV{ORACLE_HOME} ||= "/s/oracle";
$ENV{TWO_TASK} ||= "INFOACCESS.CS.WISC.EDU";
$ENV{LD_LIBRARY_PATH} ||= "$ENV{ORACLE_HOME}/lib";
$ENV{TNS_ADMIN} ||= "$ENV{ORACLE_HOME}/network/admin";

my $dbh = DBI->connect("dbi:Oracle:", [user], [password])
|| die "Couldn't connect to Oracle: $!";
#

# more stuff here that never executes
------------

The code after the connect attempt never executes because the script
exits after said failure.

I think that's all the details I can provide for now. Any ideas? Thanks
much.

Peter

Re: symbol lookup error for DBD-Oracle 1.19 and Oracle instantclient10.2.0.3

am 25.09.2007 17:46:01 von koczan

I'm using 32-bit Linux. I believe I tried something like this before and
it just wouldn't work (it didn't seem to like the instantclient) so I
looked around for alternative compilation methods.

I'll try this again with the stock Makefile.PL. Thanks. *fingers crossed*

Peter

John Scoles wrote:
> Are you using a 64 bit Linux??
>
> Though the instructions are ok at the link I do not think that makefile
> will work. I would stick with the Makefile.PL that comes with 1.19 as
> it compiles fine against 32 bit Linux. Just read the readmes and make
> sure you set the
> export ORACLE_HOME=/s/oracle
> export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
>
> before you do the compile
>
> cheers John Scoles
>
> Peter Koczan wrote:
>> Hello all,
>>
>> I'm trying to get an Oracle client working under Linux and I'm having
>> problems running a test script. Here's the error:
>> [koczan@ator] lab $ perl oracle.pl
>> perl: symbol lookup error:
>> /s/oracle/perl5/lib/site_perl/5.8.6/i686-linux-64int/auto/DB D/Oracle/Oracle.so:
>> undefined symbol: OCINlsEnvironmentVariableGet
>>
>> And here are details: I'm using Oracle's instantclient 10.2.0.3 and
>> stock DBD-Oracle 1.19 (except for I downloaded
>> Makefile-instantclient.PL and oracle-instantclient-config from
>> http://jeanchristophe.duber.free.fr/dbd_oracle_instantclient _linux/
>> and changed paths in the config script as appropriate).
>>
>> I used the .zip installers and changed some paths to fit better in our
>> infrastructure (e.g. the lib*.so files are in /s/oracle/lib and
>> properly symlinked).
>>
>> I built using these commands:
>> perl Makefile-instantclient.PL PREFIX=/s/oracle/perl5
>> make
>> make install
>>
>> It installed fine, but whenever I try to connect to a server, I get
>> the aforementioned error.
>>
>> I have to muck with a few environment variables to connect via
>> SQL*Plus, specifically:
>> export ORACLE_HOME=/s/oracle
>> export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
>> export TWO_TASK=INFOACCESS.CS.WISC.EDU
>> export TNS_ADMIN=$ORACLE_HOME/network/admin
>> export PATH=$PATH:$ORACLE_HOME/bin
>>
>> sqlplus # which works after my username and password
>>
>> So, in the perl script, I do this:
>> ------------
>> #!/s/std/bin/perl
>>
>> use DBI;
>> use lib '/s/oracle/perl5/lib';
>> use lib '/s/oracle/perl5/lib/site_perl';
>>
>> use strict;
>>
>> $ENV{ORACLE_HOME} ||= "/s/oracle";
>> $ENV{TWO_TASK} ||= "INFOACCESS.CS.WISC.EDU";
>> $ENV{LD_LIBRARY_PATH} ||= "$ENV{ORACLE_HOME}/lib";
>> $ENV{TNS_ADMIN} ||= "$ENV{ORACLE_HOME}/network/admin";
>>
>> my $dbh = DBI->connect("dbi:Oracle:", [user], [password])
>> || die "Couldn't connect to Oracle: $!";
>> #
>>
>> # more stuff here that never executes
>> ------------
>>
>> The code after the connect attempt never executes because the script
>> exits after said failure.
>>
>> I think that's all the details I can provide for now. Any ideas?
>> Thanks much.
>>
>> Peter

Re: symbol lookup error for DBD-Oracle 1.19 and Oracle instantclient10.2.0.3

am 25.09.2007 22:26:34 von koczan

I got some advice to try using the stock Makefile.PL, which I had
problems with before, and I'm still having problems with. My best guess
is that it's not linking properly, but I don't know how to fix it. Any
help would be appreciated.

Peter

Details follow:

- I had to manually specify the .mk file.
- The header files are in /s/oracle/include, the Makefile doesn't seem
to want to find them.
- Nothing in the READMEs pointed in the right directions.
- I know we're using an out of date DBI, though I doubt updating it will
fix the problems.
- I had to build this way since there is no other .mk file provided with
the instantclient.

[koczan@ator] DBD-Oracle-1.19 $ perl Makefile.PL PREFIX=/s/oracle/perl5
-m /s/oracle/share/demo.mk
Using DBI 1.47 (for perl 5.008006 on i686-linux-64int) installed in
/s/perl-5.8.6/i386_tao10/lib/site_perl/5.8.6/i686-linux-64in t/auto/DBI/

Configuring DBD::Oracle for perl 5.008006 on linux (i686-linux-64int)

Remember to actually *READ* the README file! Especially if you have any
problems.

Using Oracle in /s/oracle
DEFINE _SQLPLUS_RELEASE = "1002000300" (CHAR)
Oracle version 10.2.0.3 (10.2)
Found /s/oracle/share/demo.mk
Using /s/oracle/share/demo.mk
Your LD_LIBRARY_PATH env var is set to '/s/oracle/lib:'
Reading /s/oracle/share/demo.mk
Use of uninitialized value in substitution (s///) at Makefile.PL line 1333.
Use of uninitialized value in substitution (s///) at Makefile.PL line 1337.
Use of uninitialized value in substitution (s///) at Makefile.PL line 1340.
Use of uninitialized value in substitution (s///) at Makefile.PL line 1341.
Use of uninitialized value in substitution (s///) at Makefile.PL line 1342.
WARNING: Oracle /s/oracle/share/demo.mk doesn't define a 'build' rule.

WARNING: I will now try to guess how to build and link DBD::Oracle for you.
This kind of guess work is very error prone and Oracle-version
sensitive.
It is possible that it won't be supported in future versions
of DBD::Oracle.
*PLEASE* notify dbi-users about exactly _why_ you had to build
it this way.



*********************************************************
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.
*********************************************************


Checking for functioning wait.ph


System: perl5.008006 linux thugbert.cs.wisc.edu 2.4.21-15.0.4.tlsmp #1
smp tue aug 3 23:02:48 edt 2004 i686 unknown
Compiler: gcc -O2 -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
Linker: /usr/bin/ld
Sysliblist:
Oracle makefiles would have used these definitions but we override them:
CC: /usr/bin/g++296
LDFLAGS: -g
[-g]
Linking with -L../../ -locci -lclntsh -lpthread [from $(CCLIB)]


WARNING: If you have problems you may need to rebuild perl with
threading enabled.
Warning: -L../../ changed to -L/s/oracle/src/DBD-Oracle-1.19/../../
LD_RUN_PATH=/s/oracle/lib
Using DBD::Oracle 1.19.
Using DBD::Oracle 1.19.
Using DBI 1.47 (for perl 5.008006 on i686-linux-64int) installed in
/s/perl-5.8.6/i386_tao10/lib/site_perl/5.8.6/i686-linux-64in t/auto/DBI/
Writing Makefile for DBD::Oracle

*** If you have problems...
read all the log printed above, and the README and README.help.txt
files.
(Of course, you have read README by now anyway, haven't you?)

[koczan@ator] DBD-Oracle-1.19 $ make
cp Oracle.pm blib/lib/DBD/Oracle.pm
cp mkta.pl blib/lib/DBD/mkta.pl
cp oraperl.ph blib/lib/oraperl.ph
cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h
cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h
cp Oraperl.pm blib/lib/Oraperl.pm
cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h
cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm
cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm
/afs/cs.wisc.edu/s/perl-5.8.6/i386_tao10/bin/perl -p -e
"s/~DRIVER~/Oracle/g"
/s/perl-5.8.6/i386_tao10/lib/site_perl/5.8.6/i686-linux-64in t/auto/DBI//Driver.xst
> Oracle.xsi
/afs/cs.wisc.edu/s/perl-5.8.6/i386_tao10/bin/perl
/s/perl-5.8.6/i386_tao10/lib/5.8.6/ExtUtils/xsubpp -typemap
/s/perl-5.8.6/i386_tao10/lib/5.8.6/ExtUtils/typemap -typemap typemap
Oracle.xs > Oracle.xsc && mv Oracle.xsc Oracle.c
gcc -c
-I/s/perl-5.8.6/i386_tao10/lib/site_perl/5.8.6/i686-linux-64 int/auto/DBI/
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -DVERSION=\"1.19\"
-DXS_VERSION=\"1.19\" -fpic
"-I/s/perl-5.8.6/i386_tao10/lib/5.8.6/i686-linux-64int/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT
-DORA_OCI_VERSION=\"10.2.0.3\" Oracle.c
In file included from Oracle.h:15,
from Oracle.xs:1:
dbdimp.h:39:17: oci.h: No such file or directory
dbdimp.h:40:22: oratypes.h: No such file or directory
dbdimp.h:41:20: ocidfn.h: No such file or directory
In file included from Oracle.h:15,
from Oracle.xs:1:
dbdimp.h:54: error: parse error before "OCIEnv"
dbdimp.h:54: warning: no semicolon at end of struct or union
dbdimp.h:61: error: parse error before '}' token
dbdimp.h:75: error: parse error before "OCIEnv"
....Lots more parse errors, undefined variable errors, and dereferencing
pointer errors in dbdimp.h, Oracle.h, Oracle.xsi, Oracle.xs, and Oracle.c