Environment variable problem?

Environment variable problem?

am 18.12.2007 16:59:44 von shoover

------=_Part_15710_33170085.1197993584647
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I'm running Red Hat AS 4 on a Sunfire X4200 with 4 GB RAM,

2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 athlon i386 GNU/Linux
Perl 5.8.5 installed with DBI 1.601 and DBD::Oracle 1.19, and the Oracle
10.2.0.1 client at /usr/lib/oracle/10.2.0.1/client
ORACLE_HOME=/usr/lib/oracle/10.2.0.1/client
LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.1/client/lib

I have a lot of Perl scripts that connect to an Oracle DB that work fine
from the command line when run as root, and fail from crontab or with sudo
when not run as root directly.

I've tried including the ORACLE_HOME and LD_LIBRARY_PATH environment
variables in my crontab file, but they still fail. This fixed a problem that
I had seen previously with Java, that was fixed when I included JAVA_HOME in
my crontab, so I was surprised when it failed with Oracle DBD.

The error message that I get is

install_driver(Oracle) failed: Can't load
'/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/au to/DBD/Oracle/Oracle.so'
for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file:
No such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230. at
(eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected at
/usr/local/include/BbStatistics.pm line 73

This is false, the shared library does exist at the specified location, with
proper permissions.
-r-xr-xr-x 1 root root 183768 May 21 2007
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/aut o/DBD/Oracle/Oracle.so

All of my scripts worked in previous environment, Red Hat AS 3 on a Sunfire
X4200 with 8 GB of RAM,

2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 athlon i386
GNU/Linux
perl 5.8.5, with DBD::Oracle 1.19 and DBI 1.601 and Oracle 8.1.7
LD_LIBRARY_PATH=/usr/oracle/product/8.1.7/lib
ORACLE_HOME=/usr/oracle/product/8.1.7

I had to load the following RPMs with --nodeps option to get DBD::Oracle
installed on my new machines, but presumed that all was well when scripts
worked from command line. Perhaps this is part of the problem?

libsqlora8-2.3.3-2.el4.i386.rpm
php-squale-0.1.9-1.el4.i386.rpm
libsqlora8-debuginfo-2.3.3-2.el4.i386.rpm
php-squale-debuginfo-0.1.9-1.el4.i386.rpm
libsqlora8-devel-2.3.3-2.el4.i386.rpm
python-squale-0.1.10-0.2.el4.i386.rpm
perl-DBD-Oracle-1.19-1.el4.i386.rpm
squale-0.1.10-0.2.el4.i386.rpm
perl-DBD-Oracle-debuginfo-1.19-1.el4.i386.rpm
squale-debuginfo-0.1.10-0.2.el4.i386.rpm
php-modules-debuginfo-4.3.9-3.el4.i386.rpm
squale-devel-0.1.10-0.2.el4.i386.rpm
php-oci8-4.3.9-3.el4.i386.rpm

I'm in a time crunch to get these new servers online before Christmas, so
all help is GREATLY appreciated. :)
--
Sam Hoover
CSO, CCIT
Clemson University, Clemson, SC
samhoover@clemson.edu
Cell: 864.633.7499
Office: 864.656.3567

------=_Part_15710_33170085.1197993584647--

RE: Environment variable problem?

am 19.12.2007 17:14:11 von byterock

--_fa36c997-ee62-4fb3-9a34-3bb976189582_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Just a repost so other can learn from it
=20
Cheers


Date: Wed, 19 Dec 2007 10:05:58 -0500From: shoover@clemson.eduTo: byterock@=
hotmail.comSubject: Re: Environment variable problem?It wasn't permissions,=
I fixed it by adding my PATH to the crontab and now it works. Thanks for t=
he help and enjoy the Holiday season.Sam
On 12/18/07, John Scoles wrote:=20

Looks like a simple permissions error. 1) check to ensure you have libclnts=
h.so.10.1 on you computer (This is an oracle client) if not then you will m=
ost likely have to recomple your DBD::Oracle against whatever Oracle client=
you wnat to use. See the readme for this 2) is you have libclntsh.so.10.1=
make sure it is in the path and you have execute permissions hope this hel=
ps cheersJohn Scoles> Date: Tue, 18 Dec 2007 10:59:44 -0500> From: shoover@=
clemson.edu> To: dbi-users@perl.org> Subject: Environment variable problem?=
=20
> > I'm running Red Hat AS 4 on a Sunfire X4200 with 4 GB RAM,> > 2.6.9-67.=
ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 athlon i386 GNU/Linux> Perl 5=
..8.5 installed with DBI 1.601 and DBD::Oracle 1.19, and the Oracle> 10.2.0.=
1 client at /usr/lib/oracle/10.2.0.1/client> ORACLE_HOME=3D/usr/lib/oracle/=
10.2.0.1/client> LD_LIBRARY_PATH=3D/usr/lib/oracle/10.2.0.1/client/lib> > I=
have a lot of Perl scripts that connect to an Oracle DB that work fine > f=
rom the command line when run as root, and fail from crontab or with sudo> =
when not run as root directly.> > I've tried including the ORACLE_HOME and =
LD_LIBRARY_PATH environment> variables in my crontab file, but they still f=
ail. This fixed a problem that > I had seen previously with Java, that was =
fixed when I included JAVA_HOME in> my crontab, so I was surprised when it =
failed with Oracle DBD.> > The error message that I get is> > install_drive=
r(Oracle) failed: Can't load > '/usr/lib/perl5/vendor_perl/5.8.5/i386-linux=
-thread-multi/auto/DBD/Oracle/Oracle.so'> for module DBD::Oracle: libclntsh=
..so.10.1: cannot open shared object file:> No such file or directory at > /=
usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230. at> (ev=
al 3) line 3> Compilation failed in require at (eval 3) line 3.> Perhaps a =
required shared library or dll isn't installed where expected at > /usr/loc=
al/include/BbStatistics.pm line 73> > This is false, the shared library doe=
s exist at the specified location, with> proper permissions.> -r-xr-xr-x 1 =
root root 183768 May 21 2007 > /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-=
thread-multi/auto/DBD/Oracle/Oracle.so> > All of my scripts worked in previ=
ous environment, Red Hat AS 3 on a Sunfire> X4200 with 8 GB of RAM,> > 2.6.=
9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 athlon i386> GNU/Linux>=
perl 5.8.5, with DBD::Oracle 1.19 and DBI 1.601 and Oracle 8.1.7> LD_LIBRA=
RY_PATH=3D/usr/oracle/product/8.1.7/lib > ORACLE_HOME=3D/usr/oracle/product=
/8.1.7> > I had to load the following RPMs with --nodeps option to get DBD:=
:Oracle> installed on my new machines, but presumed that all was well when =
scripts> worked from command line. Perhaps this is part of the problem?> > =
libsqlora8-2.3.3-2.el4.i386.rpm> php-squale-0.1.9-1.el4.i386.rpm> libsqlora=
8-debuginfo-2.3.3-2.el4.i386.rpm> php-squale-debuginfo-0.1.9-1.el4.i386.rpm=
> libsqlora8-devel-2.3.3-2.el4.i386.rpm> python-squale-0.1.10-0.2.el4.i386=
..rpm> perl-DBD-Oracle-1.19-1.el4.i386.rpm> squale-0.1.10-0.2.el4.i386.rpm> =
perl-DBD-Oracle-debuginfo-1.19-1.el4.i386.rpm > squale-debuginfo-0.1.10-0.2=
..el4.i386.rpm> php-modules-debuginfo-4.3.9-3.el4.i386.rpm> squale-devel-0.1=
..10-0.2.el4.i386.rpm> php-oci8-4.3.9-3.el4.i386.rpm> > I'm in a time crunch=
to get these new servers online before Christmas, so > all help is GREATLY=
appreciated. :)> -- > Sam Hoover> CSO, CCIT> Clemson University, Clemson, =
SC> samhoover@clemson.edu> Cell: 864.633.7499> Office: 864.656.3567

Your chance to win great prizes with Telus and Windows Live Messenger for M=
obile. Click here for more information!-- Sam HooverCSO, CCITClemson Univer=
sity, Clemson, SCsamhoover@clemson.eduCell: 864.633.7499Office: 864.656.356=
7=20
____________________________________________________________ _____
Read what Santa`s been up to! For all the latest, visit asksantaclaus.space=
s.live.com!
http://asksantaclaus.spaces.live.com/=

--_fa36c997-ee62-4fb3-9a34-3bb976189582_--