Connecting to oracle from perl

A

Anne-Marte

Hei
I'm piping from procmail to perl where I want to connect to an oracle
DB. The problem is that this isn't working when I call the script from
my .procmailrc-file, but it is working nicely when I run the script
from xterm. The exeption I get looks like this:

install_driver(Oracle) failed: Can't load
'/local/perl/lib/site_perl/5.6.0/sun4-solaris/auto/DBD/Oracle/Oracle.so'
for module DBD::Oracle: ld.so.1: /local/perl/bin/perl: fatal:
libclntsh.so.1.0: open failed: No such file or directory at
/local/perl/lib/5.6.0/sun4-solaris/DynaLoader.pm line 200.
at (eval 29) line 3
Compilation failed in require at (eval 29) line 3.
Perhaps a required shared library or dll isn't installed where
expected
at /ssb/ursus/h1/amk/lib/OracleBase.pm line 49
procmail: Error while writing to "/perl/DBtest.pl"
procmail: Program failure (255) of "/perl/DBtest.pl"

Is anyone familiar with this problem??

Ann
 
U

Ulrich Herbst

Hei
I'm piping from procmail to perl where I want to connect to an oracle
DB. The problem is that this isn't working when I call the script from
my .procmailrc-file, but it is working nicely when I run the script
from xterm. The exeption I get looks like this:

install_driver(Oracle) failed: Can't load
'/local/perl/lib/site_perl/5.6.0/sun4-solaris/auto/DBD/Oracle/Oracle.so'
for module DBD::Oracle: ld.so.1: /local/perl/bin/perl: fatal:
libclntsh.so.1.0: open failed: No such file or directory at
/local/perl/lib/5.6.0/sun4-solaris/DynaLoader.pm line 200.
at (eval 29) line 3
Compilation failed in require at (eval 29) line 3.
Perhaps a required shared library or dll isn't installed where
expected
at /ssb/ursus/h1/amk/lib/OracleBase.pm line 49
procmail: Error while writing to "/perl/DBtest.pl"
procmail: Program failure (255) of "/perl/DBtest.pl"

Is anyone familiar with this problem??

Just a shot in the dark:

Is $ORACLE_HOME (and maybe $ORACLE_SID) set, when run from procmail ?

It is often a problem for cronjobs with oracle databases to not set
these variables.

Uli

--
'''
(0 0)
+------oOO----(_)--------------+
| |
| Ulrich Herbst |
| |
| (e-mail address removed) |
+-------------------oOO--------+
|__|__|
|| ||
ooO Ooo
 
J

Juha Laiho

(e-mail address removed) (Anne-Marte) said:
I'm piping from procmail to perl where I want to connect to an oracle
DB. The problem is that this isn't working when I call the script from
my .procmailrc-file, but it is working nicely when I run the script
from xterm. The exeption I get looks like this:

install_driver(Oracle) failed: Can't load
'/local/perl/lib/site_perl/5.6.0/sun4-solaris/auto/DBD/Oracle/Oracle.so'
for module DBD::Oracle: ld.so.1: /local/perl/bin/perl: fatal:
libclntsh.so.1.0: open failed: No such file or directory at
/local/perl/lib/5.6.0/sun4-solaris/DynaLoader.pm line 200.
at (eval 29) line 3
Compilation failed in require at (eval 29) line 3.
Perhaps a required shared library or dll isn't installed where
expected
at /ssb/ursus/h1/amk/lib/OracleBase.pm line 49
procmail: Error while writing to "/perl/DBtest.pl"
procmail: Program failure (255) of "/perl/DBtest.pl"

Is anyone familiar with this problem??

In your xterm session something is setting the LD_LIBRARY_PATH -variable
for you, which gives your DBD::Oracle driver the requisite information
to find the Oracle client library (libclntsh.so).

When executed through procmail, LD_LIBRARY_PATH is not set, and thus the
client library is not found. Getting LD_LIBRARY_PATH set for procmail
scripts can be tricky, as the scripts may be run setuid, in which case
LD_LIBRARY_PATH is ignored for security reasons.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top