Vaish has asked for the wisdom of the Perl Monks concerning the following question:

I am new to perl . I have a job working fine when I manually run it. But I get problems when I put that perl script inside the cron. I see the following error message. Install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-l inux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.s o.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 4) line 3 Compilation failed in require at (eval 4) line 3. Perhaps a required shared library or dll isn't installed where expected at /applic/current/rrrLogin.pm line 34 Compilation failed in require at /applic/current/datqw.pm line 20. BEGIN failed--compilation aborted at /applic/current/datqw.pm line 20. Compilation failed in require at /applic/current/vv_fetch.pl line 5. BEGIN failed--compilation aborted at /applic/current/vv_fetch.pl line 5. Thanks in Advance Vaish
  • Comment on Install_driver(Oracle) failed: Can't load ? Please help

Replies are listed 'Best First'.
Re: Install_driver(Oracle) failed: Can't load ? Please help
by Corion (Patriarch) on Jul 01, 2008 at 06:54 UTC

    Your environment in your cron job is not the same as it is in your shell session. You need to set the Oracle-specific environment variables in your cron job as well. A common way is to use a wrapper shell script that also loads your .profile before launching Perl:

    #!/usr/bin/ksh . ~/.profile exec /opt/perl/bin/perl -w /home/vaish/bin/myscript.pl ...
      Thanks Corion. It is working fine now.
      Even I am facing the same issue.NOt sure how to take it forward..I cant modify my PERL script since it is there in the production..Any other way through which I can stop getting this erro.

        How did your script get into production if it doesn't work?

        But if you cannot modify your Perl script, modify the program calling your Perl script. See my above code.