Hi all,

I have simple perl script which sets the env variables for oracle and then tries a dbi->connect. From bash it connects without problems but through apache2 and mod_perl2 it fails with ora-12154. All simple solutions failed :(

The user running the scripts in both cases is the same, env variables should all be set.

Any suggestions please?

DBI 1.3 / 1.32
DBD oracle 1.12
mod_perl 1.99_07
apache 2.0.43

Trace when run by Perl::Registry
---------------------------------
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 when run by perl directly
-------------------------------
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

Thank you for your time.

Reply via email to