On Sun, 18 Aug 2002 13:23:28 -0400 "WAZA,SANJAY (Non-HP-PaloAlto,ex1)" 
<[EMAIL PROTECTED]> wrote:

> I changed the script as you suggested
> 
> #!/opt/perl5.6.1/bin/perl -w
> use strict;
> use DBI;
> my $dbh = DBI->connect( 'dbi:Oracle:p1db',
>                         'partner1',
>                         'p1admin',
>                         {
>                           RaiseError => 1,
>                           AutoCommit => 0
>                         }
>                       ) || die "Database connection not made:
> $DBI::errstr";

If I want a custom error message I normally use { PrintError => 0,
RaiseError => 0, AutoCommit => 0 } and then set $dbh -> {RaiseError} to 1
after connect().  Otherwise, connect() never returns on error.  I normally
use something like "Can't connect to $sInst as $sUser, $DBI::errstr\n".  It
may not be necessary for you though, since the instance and username have
been added to the RaiseError message in recent versions of DBI.

> The Error is still the same . 
> install_driver(Oracle) failed: Can't load
> '/opt/perl5.6.1/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/Oracle/Oracle.sl'
> for module DBD::Oracle: No such file or dire
> ctory at /opt/perl5.6.1/lib/5.6.1/PA-RISC2.0/DynaLoader.pm line 206.
>  at (eval 1) line 3
> Compilation failed in require at (eval 1) line 3.
> Perhaps a required shared library or dll isn't installed where expected
> 
> Before Running the script I set up all the env valiables
> 
> export ORACLE_HOME=/archive/newdisk/oracle9i
> export SHLIB_PATH=/opt/perl5.6.1/lib:$ORACLE_HOME/lib:/usr/lib
> export
> LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/Apache/Apache/libexec
> export
> PERL5LIB=/opt/perl5.6.1/lib/site_perl/5.6.1:/opt/perl5.6.1/lib/5.6.1:
> /opt/perl5.6.1/lib/5.6.1/PA-RISC2.0:/opt/perl5.6.1/lib/site_perl/5.6.1/PA
> -RISC2.0

That all looks reasonable, but now I'm wondering what version of Oracle
DBD::Oracle was compiled against.  If it wasn't 9.0, you will need to get
it rebuild with 9.0 or use an Oracle Home of the appropriate version. 
Since Oracle OCI (used by DBD::Oracle) normally connects through SQL*Net,
you can connect to any database from 7 through 9 using a SQL*Net client
of the version you compiled DBD::Oracle against, if you try to use another
version it probably won't work.

> The File Oracle.sl is present in that directory
> boi307@/opt/perl5.6.1/lib/site_perl/5.6.1/PA-RISC2.0/auto/DBD/Oracle% ll
> total 12976
> -rwxr-xr-x   1 bin        bin              0 Feb  1  2002 Oracle.bs
> -rwxr-xr-x   1 bin        bin           2402 May  2  2000 Oracle.h
> -rwxr-xr-x   1 bin        bin        6602752 Feb  1  2002 Oracle.sl
> -rwxr-xr-x   1 bin        bin           9868 Aug 30  2001 dbdimp.h
> -rwxr-xr-x   1 bin        bin          15733 Feb  1  2002 mk.pm
> -rwxr-xr-x   1 bin        bin          11204 Aug 30  2001 ocitrace.h
> 
> Next went to ORACLE_HOME/lib and did  ll *oc* and got these results
> 
> boi307@/archive/newdisk/oracle9i/lib% ll *oc*
> lrwxrwxr-x   1 oracle     dba             14 Aug  6 12:50 libocci.sl ->
> libocci.sl.9.0
> -rwxr-xr-x   1 oracle     dba         953832 Apr 27 11:12 libocci.sl.9.0
> -rw-r--r--   1 oracle     dba        4549378 Apr 27 07:36 libocci9.a
> -rw-r--r--   1 oracle     dba         211302 Apr 26 04:01 libocijdbc9.a
> -rwxr-xr-x   1 oracle     dba         155248 Apr 27 12:50 libocijdbc9.sl
> -rwxr-xr-x   1 oracle     dba         188120 Apr 27 12:50
> libocijdbc9_g.sl
> -rw-r--r--   1 oracle     dba         211302 Apr 26 04:01 libocijdbcst9.a
> 
> So I am not sure how to find exactly which shared library it is looking
> for?

_IF_ DBD::Oracle was built with Oracle 9.0, it is probably wants
libocci.sl or libocci.sl.9.0 linked via libocci9.a.  If it was build with
another version of Oracle, it is probably looking for another shared
library which would exist in $ORACLE_HOME/lib in an Oracle instance of the
correct version.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to