Oracle connection issue with perl DBI

Oracle connection issue with perl DBI

am 19.12.2007 16:00:04 von gossner92

------=_Part_8074_10636298.1198076404383
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Folks,

I am facing a funny but troubling issue with Perl DBI & Oracle.
When my shell environment does not have ORACLE_HOME path set, my script
works fine. I am connecting
to Oracle DB like this:

#!/usr/bin/perl -w
use strict;
use DBI;
my $dbh = DBI->connect("dbi:Oracle:host=xx.gold.com;port=1522;sid=sid" ,
$eusr, $epas,{RaiseError => 1, AutoCommit => 1})
die "Can not connect : $DBI->errstr ";

Now,
set the ORACLE_PATH to /opt/bin/oracle/9.2.0.8
and I do try to connect but it complains that it can not connect.
-Kumar R

------=_Part_8074_10636298.1198076404383--

Re: Oracle connection issue with perl DBI

am 19.12.2007 20:02:02 von jdg117

In message , "Kumar
Ranjan" writes:
>I am facing a funny but troubling issue with Perl DBI & Oracle.
>When my shell environment does not have ORACLE_HOME path set, my script
>works fine. I am connecting
>to Oracle DB like this:
>
>#!/usr/bin/perl -w
>use strict;
>use DBI;
>my $dbh = DBI->connect("dbi:Oracle:host=xx.gold.com;port=1522;sid=sid" ,
>$eusr, $epas,{RaiseError => 1, AutoCommit => 1})
> die "Can not connect : $DBI->errstr ";
>
>Now,
>set the ORACLE_PATH to /opt/bin/oracle/9.2.0.8
>and I do try to connect but it complains that it can not connect.

Is /opt/bin/oracle/9.2.0.8 the same ORACLE_HOME you used to build
DBD::Oracle?

It must be.


Do these commands work from the shell?
$ env ORACLE_HOME=/opt/bin/oracle/9.2.0.8 /opt/bin/oracle/9.2.0.8/bin/tnsping
'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xx.gold.com)(PORT =1522))(CONNECT_DATA=(SID=sid)))'
$ env ORACLE_HOME=/opt/bin/oracle/9.2.0.8 /opt/bin/oracle/9.2.0.8/bin/sqlplus euser/epas@'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xx.gol d.com)(PORT=1522))(CONNECT_DATA=(SID=sid)))'

If not, contact your DBA.

John
groenveld@acm.org