perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ader...@n2h2.com (Alan E. Derhaag)
Subject Re: ORA-12154: TNS:could not resolve service name with DBI under Apache
Date Wed, 29 Mar 2000 23:55:22 GMT
Jerome MOUREAUX <moureaux@montrouge.rms.slb.com> writes:

> David,
> 
> The ORACLE_HOME is set in the httpd.conf with a PerlSetEnv directive.
> (it appears in the extract I sent). (I've checked that is OK in the scripts by
> printing out $ENV{ORACLE_HOME} )
> The SID is not case sensitive (I tried some combination when I was trying to
> figure out what happen) otherwise it would mean that SID are insensitive when
> running the script from command line and sensitive when running from Apache !

[...]

> >  > Here is the error :
> >  >
> >  > DBI->connect failed: ORA-12154: TNS:could not resolve service name (DBD:
> >  > login f
> >  > ailed) at /disc1/sherpa_a/indicators2/perl/activity/toto.pl line 5
> >  > [Wed Mar 29 20:11:32 2000] [error] ORA-12154: TNS:could not resolve 
> > service
> >  > name
> >  >   (DBD: login failed) at 
> > /disc1/sherpa_a/indicators2/perl/activity/toto.pl
> >  > line 5
> >  >

[...]

> >  > #$Apache::DBI::DEBUG=2;
> >  > #Apache::DBI->connect_on_init("dbi:Oracle:indicators", "indic", "xxxx",
> >  >   { AutoCommit => 0, RaiseError => 1, PrintError => 0 } )
> >  >   or die $DBI::errstr;
> >  >
> >  > 1;

Have you tried something like:

Apache::DBI->connect_on_init("dbi:Oracle:server=indicators;database=XXX",
      "indic", "xxxx", { AutoCommit => 0, RaiseError => 1, PrintError => 0 } )
	   or die $DBI::errstr;

explicitly supplying the server and avoiding the `use XXX' on the
first connect?  Works with Sybase, anyway.

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Alan E. Derhaag    Consultant from Interactive Business Systems
phone: 206-336-2972                          Consultant to N2H2
email: aderhaa@n2h2.com                   aderhaag@wolfenet.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Mime
View raw message