You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Fabian Kreitner <fa...@ainea-ag.de> on 2002/12/05 14:02:45 UTC
apache2 + mod_perl2 + dbd::oracle
Hello all,
I have problems connecting to an oracle db using mod_perl but cant figure
out where the problem is. The script works fine from the bash but not
through perl::registry. The script only sets the environment variables and
then tries a connect.
Any suggestions please? If you need further information please tell.
Thank you for your time.
Trace with mod_perl:
--------------------
DBI 1.30-nothread dispatch trace level set to 2
-> DBI->connect(DBI:Oracle:PERG, pid_10023, ****)
-> DBI->install_driver(Oracle) for linux perl=5.008 pid=87 ruid=40019
euid=40019
install_driver: DBD::Oracle version 1.12 loaded from
/opt/ainea/perl/lib/site_perl/5.8.0/i686-linux/DBD/Oracle.p
<- install_driver= DBI::dr=HASH(0x82f1c6c)
-> connect for DBD::Oracle::dr (DBI::dr=HASH(0x82f1c6c)~0x834e818
'PERG' 'pid_10023' **** HASH(0x82cef60))
-> DESTROY for DBD::Oracle::db (DBI::db=HASH(0x82c70d4)~INNER)
DESTROY for DBI::db=HASH(0x82c70d4) ignored - handle not initialised
<- DESTROY= undef at DBI.pm line 503
!! ERROR: 12154 'Error while trying to retrieve text for error
ORA-12154 (DBD ERROR: OCIServerAttach)'
<- connect= undef at DBI.pm line 503
-> errstr in DBD::_::common for DBD::Oracle::dr
(DBI::dr=HASH(0x82f1c6c)~0x834e818)
<- errstr= 'Error while trying to retrieve text for error ORA-12154
(DBD ERROR: OCIServerAttach)' at DBI.pm line 50
DBI->connect(PERG) failed: Error while trying to retrieve text for
error ORA-12154 (DBD ERROR: OCIServerAttach)
Trace from bash:
----------------
DBI 1.30-nothread dispatch trace level set to 2
Note: perl is running without the recommended perl -w option
-> DBI->connect(DBI:Oracle:PERG, pid_10023, ****)
-> DBI->install_driver(Oracle) for linux perl=5.008 pid=388 ruid=40019
euid=40019
install_driver: DBD::Oracle version 1.12 loaded from
/opt/ainea/perl/lib/site_perl/5.8.0/i686-linux/DBD/Oracle.p
<- install_driver= DBI::dr=HASH(0x81e9e14)
-> connect for DBD::Oracle::dr (DBI::dr=HASH(0x81e9e14)~0x824afc4
'PERG' 'pid_10023' **** HASH(0x81c56c4))
<- connect= DBI::db=HASH(0x8246cf0) at DBI.pm line 503
-> STORE for DBD::Oracle::db (DBI::db=HASH(0x812b604)~INNER
'PrintError' 1)
<- STORE= 1 at DBI.pm line 545
-> STORE for DBD::Oracle::db (DBI::db=HASH(0x812b604)~INNER
'AutoCommit' 1)
<- STORE= 1 at DBI.pm line 545
<- connect= DBI::db=HASH(0x8246cf0)
-> DESTROY for DBD::Oracle::db (DBI::db=HASH(0x812b604)~INNER)
<- DESTROY= undef
-- DBI::END
-> disconnect_all for DBD::Oracle::dr (DBI::dr=HASH(0x81e9e14)~0x824afc4)
<- disconnect_all= '' at DBI.pm line 565
-> DESTROY in DBD::_::common for DBD::Oracle::dr
(DBI::dr=HASH(0x824afc4)~INNER)
<- DESTROY= undef during global destruction
Versions:
---------
mod_perl-1.99_07
apache-2.0.43
perl 5.8.0
Re: apache2 + mod_perl2 + dbd::oracle
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> $ENV{'ORACLE_HOME'} is set correctly right before the connection attempt
> (it missing would result in an additional warning in the trace).
that's not necessarily true.
> Also,
> the same script run from bash does successfully connect (same users, all
> envs set in script).
>
> I did an additional installation with apache-1.3.27 & mod_perl-1 and in
> this combination the test script does work =/
please check out this thread:
http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=102995105701603&w=2
try setting ORACLE_HOME in a BEGIN block and see if that solves your
problem.
HTH
--Geoff
Re: apache2 + mod_perl2 + dbd::oracle
Posted by Stas Bekman <st...@stason.org>.
Fabian Kreitner wrote:
[...]
> $ENV{'ORACLE_HOME'} is set correctly right before the connection attempt
> (it missing would result in an additional warning in the trace). Also,
> the same script run from bash does successfully connect (same users, all
> envs set in script).
read the info at the link I've posted in the prev reply. it doesn't work
this way anymore. explanations are there.
> I did an additional installation with apache-1.3.27 & mod_perl-1 and in
> this combination the test script does work =/
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: apache2 + mod_perl2 + dbd::oracle
Posted by Fabian Kreitner <fa...@ainea-ag.de>.
At 23:17 05.12.2002 +0100, you wrote:
>Fabian Kreitner <fa...@ainea-ag.de> writes:
>
> > Hello all,
> >
> > I have problems connecting to an oracle db using mod_perl but cant
> > figure out where the problem is. The script works fine from the bash
> > but not through perl::registry. The script only sets the environment
> > variables and then tries a connect.
> >
> > (...)
> > !! ERROR: 12154 'Error while trying to retrieve text for error
> > ORA-12154 (DBD ERROR: OCIServerAttach)'
>
>Either you removed message files from your Oracle installation (not
>very likely) or you failed to set ORACLE_HOME so that OCI libraries
>below DBD::Oracle notice this variable.
>
>Double check the way you set your environment.
$ENV{'ORACLE_HOME'} is set correctly right before the connection attempt
(it missing would result in an additional warning in the trace). Also, the
same script run from bash does successfully connect (same users, all envs
set in script).
I did an additional installation with apache-1.3.27 & mod_perl-1 and in
this combination the test script does work =/
Re: apache2 + mod_perl2 + dbd::oracle
Posted by Fabian Kreitner <fa...@ainea-ag.de>.
At 09:45 06.12.2002 +0800, you wrote:
>Marcin Kasperski wrote:
>>Fabian Kreitner <fa...@ainea-ag.de> writes:
>>
>>>Hello all,
>>>
>>>I have problems connecting to an oracle db using mod_perl but cant
>>>figure out where the problem is. The script works fine from the bash
>>>but not through perl::registry. The script only sets the environment
>>>variables and then tries a connect.
>>>
>>>(...)
>>> !! ERROR: 12154 'Error while trying to retrieve text for error
>>> ORA-12154 (DBD ERROR: OCIServerAttach)'
>>
>>Either you removed message files from your Oracle installation (not
>>very likely) or you failed to set ORACLE_HOME so that OCI libraries
>>below DBD::Oracle notice this variable.
>>Double check the way you set your environment.
>
>And if that's the case, watch the new culprit under 2.0:
>http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#C_Libraries_Don_t_See_C__ENV__Entries_Set_by_Perl_Code
Now I understand where the problem might be ... yes that looks promising.
Thanks both of you :)
Unfortunately I need to find a new spare server first before I cant test it.
cheers
Fabian
Re: apache2 + mod_perl2 + dbd::oracle
Posted by Stas Bekman <st...@stason.org>.
Marcin Kasperski wrote:
> Fabian Kreitner <fa...@ainea-ag.de> writes:
>
>
>>Hello all,
>>
>>I have problems connecting to an oracle db using mod_perl but cant
>>figure out where the problem is. The script works fine from the bash
>>but not through perl::registry. The script only sets the environment
>>variables and then tries a connect.
>>
>>(...)
>> !! ERROR: 12154 'Error while trying to retrieve text for error
>> ORA-12154 (DBD ERROR: OCIServerAttach)'
>
>
> Either you removed message files from your Oracle installation (not
> very likely) or you failed to set ORACLE_HOME so that OCI libraries
> below DBD::Oracle notice this variable.
>
> Double check the way you set your environment.
And if that's the case, watch the new culprit under 2.0:
http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#C_Libraries_Don_t_See_C__ENV__Entries_Set_by_Perl_Code
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: apache2 + mod_perl2 + dbd::oracle
Posted by Marcin Kasperski <Ma...@acn.waw.pl>.
Fabian Kreitner <fa...@ainea-ag.de> writes:
> Hello all,
>
> I have problems connecting to an oracle db using mod_perl but cant
> figure out where the problem is. The script works fine from the bash
> but not through perl::registry. The script only sets the environment
> variables and then tries a connect.
>
> (...)
> !! ERROR: 12154 'Error while trying to retrieve text for error
> ORA-12154 (DBD ERROR: OCIServerAttach)'
Either you removed message files from your Oracle installation (not
very likely) or you failed to set ORACLE_HOME so that OCI libraries
below DBD::Oracle notice this variable.
Double check the way you set your environment.