1830050 Members
25971 Online
109998 Solutions
New Discussion

DBD doesn't work

 
SOLVED
Go to solution
itai weisman
Super Advisor

DBD doesn't work

hi people,
after succesfully installation of DBD for oracle,
progrmas won't work:
install_driver(Oracle) failed: Can't locate loadable object for module DBD::Oracle in @INC (@INC contains: /opt/perl/lib/5.8.
6/PA-RISC2.0 /opt/perl/lib/5.8.6 /opt/perl/lib/site_perl/5.8.6/PA-RISC2.0 /opt/perl/lib/site_perl/5.8.6 /opt/perl/lib/site_pe
rl .) at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a module that DBD::Oracle requires hasn't been fully installed
at ./cr_ts_esn_storage_pl line 55

i'm using perl 5.8.6 32bit with DBI 1.50, DBD Oracle 1.16, trying to connect to oracle 9i (Dbd has been compiled with oracle 32bit shared libraries)
thanks!
19 REPLIES 19
Marin Marinov
Occasional Advisor

Re: DBD doesn't work

hi itai,

from the data you have provided it seems that DBD::Oracle has not been installed correctly, or the perl instance you are using to run you programs is not able to find it. this could be seen as install_driver() method is failing.

my suggestion would be to test first if DBD::Oracle driver is actually available for DBI - this can be done using DBI class methods: available_drivers(), installed_drivers () and installed_versions(). more info about their exact syntax can be found at: http://search.cpan.org/~timb/DBI-1.50/DBI.pm
if DBI is not able to list Oracle with installed_versions, it most probably means that something got wrong with installation, although it has been reported as successful. does the test suite passed?

check also if DBD/Oracle.pm is available in the directories listed in @INC, as this is the include path used by perl interpreter.

a good idea when troubleshooting perl would be to post the output of perl -V command.

because of many people has had problems with Perl + DBI on HP-UX a respected colleague of us - H.Merijn, has created a page hosting a precompiled versions of Perl + selected modules for HP-UX. you can take a look at it at: http://mirrors.develooper.com/hpux/downloads.html

hope this hels as an initial steps to further investigate the problem.

best regards,
marin
itai weisman
Super Advisor

Re: DBD doesn't work

this is perl -V output
root@key2: perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=hpux, osvers=11.11, archname=PA-RISC2.0
uname='hp-ux r3 b.11.11 u 9000800 1909236376 unlimited-user license '
config_args='-Dusedevel -Dcc=gcc -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=unde
f
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-mpa-risc-2-0 -D_HPUX_SOURCE -DDEBUGGING -fno-strict-ali
asing -pipe -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-g -O',
cppflags='-mpa-risc-2-0 -D_HPUX_SOURCE -mpa-risc-2-0 -D_HPUX_SOURCE -DDEBUGG
ING -fno-strict-aliasing -pipe -I/pro/local/include'
ccversion='', gccversion='3.4.3', gccosandvers='hpux11.11'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize
=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='/usr/bin/ld', ldflags ='-L/pro/local/lib'
libpth=/pro/local/lib /lib /usr/lib /usr/ccs/lib /usr/local/lib
libs=-lcl -lpthread -lnsl -lnm -lndbm -lgdbm -ldb -lmalloc -ldld -lm -lcrypt
-lsec -lc
perllibs=-lcl -lpthread -lnsl -lnm -lmalloc -ldld -lm -lcrypt -lsec -lc
libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferr
ed '
cccdlflags='-fPIC', lddlflags='-b -L/pro/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING USE_LARGE_FILES
Locally applied patches:
defined-or
Built under hpux
Compiled at Nov 30 2004 08:22:28
@INC:
/opt/perl/lib/5.8.6/PA-RISC2.0
/opt/perl/lib/5.8.6
/opt/perl/lib/site_perl/5.8.6/PA-RISC2.0
/opt/perl/lib/site_perl/5.8.6
/opt/perl/lib/site_perl
.

i could find a Oracle.pm file under includes directories
Marin Marinov
Occasional Advisor

Re: DBD doesn't work

could you please post the output of the following command?

perl -MDBI -e "DBI->installed_versions"
itai weisman
Super Advisor

Re: DBD doesn't work

root@key2: perl -MDBI -e "DBI->installed_versions"
Perl : 5.008006 (PA-RISC2.0)
OS : hpux (11.11)
DBI : 1.46
DBD::Sponge : 11.10
DBD::Proxy : install_driver(Proxy) failed: Can't locate RPC/PlClient.pm i
n @INC
DBD::Oracle : 1.16
DBD::File : 0.31
DBD::ExampleP : 11.12
DBD::DBM : 0.02
DBD::CSV : 0.21
Matti_Kurkela
Honored Contributor

Re: DBD doesn't work

Have you set up the required environment variables?

The most essential ones are ORACLE_HOME and SHLIB_PATH, because DBD needs to use some libraries from the Oracle client installation.
The "Can't locace loadable object..." error message suggests that SHLIB_PATH might not be correct. The script /usr/local/bin/oraenv may help in setting these.

The ORACLE_SID and NLS_LANG are almost as important, and their correct values depend on the choices you have made.
MK
itai weisman
Super Advisor

Re: DBD doesn't work

during runtime or installation? I have configured these variables for installation... I have also set them before running the perl proggram
Alzhy
Honored Contributor

Re: DBD doesn't work

Shalom Itai,

You need to build DBD::Oracle on an environment that has a working Oracle installation.. you need to have the following defined:


# env|egrep "LD_|ORA|TNS|TWO"
ORACLE_BASE=/oracle/app/oracle
ORA_DUMP=/oracle/app/oracle/admin/dummy/bdump
ORACLE_SID=dummy
ORACLE_OWNER=oracle
TNS_ADMIN=/oracle/app/oracle/product/9.2.0.6/network/admin
ORACLE_TERM=xterm
LD_LIBRARY_PATH=/opt/cobol/lib:/oracle/app/oracle/product/9.2.0.6/lib:/usr/lib:/opt/hpws/apache/lib
ORACLE_HOME=/oracle/app/oracle/product/9.2.0.6
ORAENV_ASK=NO

Hakuna Matata.
Alzhy
Honored Contributor

Re: DBD doesn't work

And of course :

LD_PRELOAD=/oracle/app/oracle/product/9.2.0.6/JRE/lib/PA_RISC/native_threads/libjava.sl

Hakuna Matata.
H.Merijn Brand (procura
Honored Contributor
Solution

Re: DBD doesn't work

LD_PRELOAD should NOT be needed for DBD::Oracle

What's the output of this command?

> perl -MDynaLoader -MDBD::Oracle -wle'system qq{chatr $_} for grep/Oracle/,@DynaLoader::dl_shared_objects'
/pro/asql/o82AC/lib/perl/5.8.5/PA-RISC2.0/auto/DBD/Oracle/Oracle.sl:
shared library
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path enabled first /pro/oracle/v817/lib
shared library list:
dynamic /pro/oracle/v817/lib//libclntsh.sl.8.0
dynamic /pro/oracle/v817/lib//libwtc8.sl
dynamic /usr/lib/librt.2
dynamic /usr/lib/libpthread.1
dynamic /usr/lib/libdld.2
dynamic /usr/lib/libm.2
dynamic /pro/oracle/v817/lib//libqsmashr.sl
shared vtable support disabled
explicit unloading enabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
third quadrant global data space disabled
data page size: D (default)
instruction page size: D (default)
nulptr references disabled
>

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Alzhy
Honored Contributor

Re: DBD doesn't work

Strange Procura, without LD_PRELOAD defined, I am unable to build DBD::Oracle on my custom built Perl 5.8.7 installation.

I got the tip from the accompanying README/INSTALL document that came with the Perl 5.8.7 source tree...

Hakuna Matata.
H.Merijn Brand (procura
Honored Contributor

Re: DBD doesn't work

If I look in README and README.hpux in the current development perl source tree, neither does refer to LD_PRELOAD.

INSTALL *does* mention LD_PRELOAD, but only for Linux.

The README.hpux.txt on DBD/Oracle-1.17 (which I' have just recently updated completely) *does* mention this variable in the context you say, but IMHO it should not be the preferred solution to these kind of problems.

use $HLIB_PATH and/or $LD_LIBRARY_PATH, as these are both supported on all HP-UX versions as of 11.00. (HP-UX 10.20 does not support LD_LIBRARY_PATH, but only supports SHLIB_PATH).

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
itai weisman
Super Advisor

Re: DBD doesn't work

thanks people,
I Didn't understand what command should i issue...
H.Merijn Brand (procura
Honored Contributor

Re: DBD doesn't work

perl -MDynaLoader -MDBD::Oracle -wle'system qq{chatr $_} for grep/Oracle/,@DynaLoader::dl_shared_objects'

Show us the output please.

[ don't forget to think about the points once you have your solution ]

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
itai weisman
Super Advisor

Re: DBD doesn't work

don't worry everyone will get what he earn :)

>> grep/Oracle/,@DynaLoader::dl_shared_objects'
/opt/perl/lib/site_perl/5.8.6/PA-RISC2.0/auto/DBD/Oracle/Oracle.sl:
shared library
shared library dynamic path search:
SHLIB_PATH enabled second
embedded path enabled first /OracleTools/9.2.0/lib32:/OracleToo
ls/9.2.0/rdbms/lib32
shared library list:
dynamic /OracleTools/9.2.0/lib32//libclntsh.sl.9.0
dynamic /usr/lib/libm.2
shared vtable support disabled
explicit unloading enabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
third quadrant global data space disabled
data page size: D (default)
instruction page size: D (default)
nulptr references disabled
shared library private mapping disabled
H.Merijn Brand (procura
Honored Contributor

Re: DBD doesn't work

For Oracle9 I miss libqsmashr.sl in that list. Weird.
What does

ldd /opt/perl/lib/site_perl/5.8.6/PA-RISC2.0/auto/DBD/Oracle/Oracle.sl

show you?

Anyway, the shared object *IS* found, but cannot be loaded for some less obvious reason.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
itai weisman
Super Advisor

Re: DBD doesn't work

did you mean ld ? (and not ldd)
ld shows no output...
H.Merijn Brand (procura
Honored Contributor

Re: DBD doesn't work

No, I mean ldd.

ldd - print shared library dependencies

maybe the ldd you have also supports -v

ldd -v shared_object.sl

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
itai weisman
Super Advisor

Re: DBD doesn't work

root@key2: te_perl/5.8.6/PA-RISC2.0/auto/DBD/Oracle/Oracle.sl <
/usr/lib/libm.2 => /usr/lib/libm.2
/OracleTools/9.2.0/lib32//libclntsh.sl.9.0 => /OracleTools/9.2.0/lib32
/libclntsh.sl.9.0
/usr/lib/libcl.2 => /usr/lib/libcl.2
/usr/lib/libisamstub.1 => /usr/lib/libisamstub.1
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libm.2 => /usr/lib/libm.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libnss_dns.1 => /usr/lib/libnss_dns.1
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libpthread.1 => /usr/lib/libpthread.1
/usr/lib/librt.2 => /usr/lib/librt.2
/OracleTools/9.2.0/lib32/libwtc9.sl => /OracleTools/9.2.0/lib32/libwtc9
.sl
root@key2:

Alzhy
Honored Contributor

Re: DBD doesn't work

Itai,

Peace and Clean Air.

If you want, I can share with you our custom build of Perl 5.8.7 with the latest DBI and DBD::Oracle (comiples against Oracle 9.X..).

It installs in /usr/local/perl5.8.7 so it maintains your existing perl installed trees. It just completed intensive testing. It was compiled using HP aCC C.37 under HP-UX 11.11.

Let me know if want and provide me with a temp. FTP site. (the binaries are around 40MB).

Hakuna Matata.