Hi, Jerome.

I know you said that your tnsnames.ora is okay because tnsping works. 
However, the ORACLE error in the subject line indicates that ORACLE is
choking on whatever database name it's receiving from perl.  Try
tnsping'ing or connecting to a database that you know doesn't exist in
your tnsnames.ora.  You'll see the same error.

Find out exactly what database name is being passed to Oracle and I
think you'll be able to resolve your problem.

Tom

> >   Jerome MOUREAUX said...
> >
> >  > Hi All,
> >  >
> >  > I experience a trouble with Perl script using DBI running under Mod_perl
> >  > and Registry
> >  > If you have an idea from where the problem may come....
> >  >
> >  > 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
> >  >
> >  > The ORACLE_HOME is well set ! I first tried to use Apache::DBI but i get
> >  > this error
> >  > so I go back to DBI only but it's exactly the same error.
> >  > My scripts run well if I launch it from the command line.
> >  >
> >  > Here is extracts of my httpd.conf
> >  >
> >  >      # Additionnal directory (for indicators)
> >  >      Alias /indicators2/perl "/disc1/sherpa_a/indicators2/perl"
> >  >      <Location /indicators2/perl>
> >  >          SetHandler      perl-script
> >  >          PerlHandler     Apache::Registry
> >  >          PerlSendHeader  On
> >  >          Options         +ExecCGI
> >  >      </Location>
> >  >
> >  > at the end:
> >  >
> >  > PerlSetEnv      ORACLE_HOME     /disc1/sherpa/oracle
> >  > PerlRequire             conf/startup.pl
> >  > PerlFreshRestart        On
> >  >
> >  > Here is the startup.pl
> >  >
> >  > #!/usr/bin/perl
> >  >
> >  > # Commonly used modules
> >  > use Apache::Registry ();
> >  > use Apache::Constants ();
> >  > use CGI ();
> >  > #use Apache::DBI ();
> >  >
> >  > #$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;
> >  >
> >  > And finally my test file:
> >  >
> >  > #!/usr/bin/perl
> >  >
> >  > use DBI;
> >  >
> >  > my $dbh = DBI->connect( 'DBI:Oracle:INDICATORS', 'indic', xxxx',
> >  >      { AutoCommit => 0, RaiseError => 0, PrintError => 1 } )
> >  >      or die $DBI::errstr;
> >  >
> >  > $dbh->disconnect;
> >  >
> >  > Thanks in advance
> >  > Jerome

Reply via email to