Return-Path: Mailing-List: contact modperl-help@apache.org; run by ezmlm Delivered-To: mailing list modperl@apache.org Received: (qmail 44235 invoked from network); 29 Mar 2000 23:57:28 -0000 Received: from noctis.bess.net (HELO localhost.localdomain) (206.129.0.147) by locus.apache.org with SMTP; 29 Mar 2000 23:57:28 -0000 Received: (from aderhaa@localhost) by localhost.localdomain (8.9.3/8.9.3) id PAA06602; Wed, 29 Mar 2000 15:55:22 -0800 Sender: aderhaa@noctis.bess.net To: Jerome MOUREAUX Cc: modperl@apache.org Subject: Re: ORA-12154: TNS:could not resolve service name with DBI under Apache References: <4.2.2.20000329200631.02669ad0@montrouge.rms.slb.com> <4.2.2.20000329200631.02669ad0@montrouge.rms.slb.com> <4.2.2.20000329224520.00d21e40@montrouge.rms.slb.com> From: aderhaa@n2h2.com (Alan E. Derhaag) In-Reply-To: Jerome MOUREAUX's message of "Wed, 29 Mar 2000 22:52:45 +0200" Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII Date: 29 Mar 2000 15:55:22 -0800 Message-ID: Lines: 50 X-Mailer: Gnus v5.6.9/Emacs 20.4 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Jerome MOUREAUX 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 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-