Connecting to oracle from perl

Discussion in 'Perl Misc' started by Anne-Marte, Jul 22, 2005.

  1. Anne-Marte

    Anne-Marte Guest

    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
     
    Anne-Marte, Jul 22, 2005
    #1
    1. Advertising

  2. (Anne-Marte) writes:

    > 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 |
    | |
    | |
    +-------------------oOO--------+
    |__|__|
    || ||
    ooO Ooo
     
    Ulrich Herbst, Jul 23, 2005
    #2
    1. Advertising

  3. Anne-Marte

    Juha Laiho Guest

    (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.
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
     
    Juha Laiho, Jul 24, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Juha Laiho
    Replies:
    0
    Views:
    569
    Juha Laiho
    Jul 30, 2003
  2. David Rudder
    Replies:
    0
    Views:
    422
    David Rudder
    Jul 30, 2003
  3. J R Longwill
    Replies:
    5
    Views:
    294
    Joel Garry
    Nov 6, 2003
  4. Vincent Le-Texier
    Replies:
    1
    Views:
    173
    Paul Lalli
    Dec 3, 2004
  5. Feyruz
    Replies:
    4
    Views:
    2,353
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page