On Wed, 29 Mar 2000, Jerome MOUREAUX wrote:
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
The ORACLE_HOME ___environment___ variable is set where? I see no indication
of it being set in any of your examples or config.
I do see PerlSetVar setting it-- don't confuse that with the environment!
PerlSetVar is a specific way to set variables so mod_perl can read them via
the dir_config()
Thanks Jeffrey but:
- the tnsname.ora is OK as tnsping works fine as well as the same script run
from the command line.
- the case is only important for Oracle in the string dbi:Oracle:SID
(the line in startup.pl in commented it was just a previous try)
I'm really running out of idea about
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)
My mistake, Jerome.
PerlSetVar != PerlSetEnv
I read that as PerlSetVar. Sorry to confuse the issue.
I hope it's a simple permissions problem.
Good luck!
David S . Kenzik said...
Jerome MOUREAUX said...
David,
The ORACLE_HOME is set in the httpd.conf with a PerlSetEnv
On Wed, 29 Mar 2000, Jerome MOUREAUX wrote:
Alias /indicators2/perl "/disc1/sherpa_a/indicators2/perl"
[...]
PerlSetEnv ORACLE_HOME /disc1/sherpa/oracle
Do you really have a /disc1/sherpa directory and a /disc1/sherpa_a
directory?
- Perrin
A final effort... From the command line it works. Perhaps your ORACLE_USERID,
etc. is already set?
Within your Registry script, that's probably not the case unless you've
explicitly told it otherwise.
So let's change your DSN around a bit:
my $dbh = DBI-connect('dbi:Oracle:',
Write a small registry script to print %ENV and confirm ORACLE_HOME is set to
/disc1/sherpa/oracle.
In your shell,
# cat eof/tmp/test.sh
\$ORACLE_HOME/bin/tnsping YourTNSAlias
eof
# su - nobody -c 'env ORACLE_HOME=/path/to/oracle sh /tmp/test.sh'
John
[EMAIL PROTECTED]
On Wed, 29 Mar 2000, Jerome MOUREAUX wrote:
My scripts run well if I launch it from the command line.
Have you tried running them from the command line as the user who the
webserver runs as? There may be something in your user environment that
allows them to work which is not set up for this
Jerome MOUREAUX [EMAIL PROTECTED] 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
10 matches
Mail list logo