Monks,

I am confused (my usual state) but right now I have reason!

I am trying to get a perl script to talk to an Oracle database. Oracle DBD seems to be installed correctly.But I get this strange error (see below).

My perl script sits on a linux box and my Oracle dB on a sun server. However, I am confident that Oracle is set up correctly as I can access it via sqlplus from my linux box.

A search of the site revealed a few related links 28533 but all seem to indicate that the Oracle library(LD_LIBRARY_PATH) isn't installed correctly. But I think it is.

Any ideas?

Thanks

A.A.

#!/usr/bin/perl -w BEGIN { $ENV{ORACLE_BASE} = '/usr/local/share/oracle'; $ENV{ORACLE_HOME} = "$ENV{ORACLE_BASE}/815client"; $ENV{LD_LIBRARY_PATH} = "$ENV{ORACLE_HOME}/lib"; $ENV{TNS_ADMIN} = "$ENV{ORACLE_HOME}/network/admin"; } use strict; use CGI; use CGI::Carp 'fatalsToBrowser'; use DBI; use DBD::Oracle; use Data::Dumper; . . . print "path = $ENV{LD_LIBRARY_PATH} \n"; my $dbh = DBI->connect("dbi:Oracle:database=XYZDEV01", 'user', 'pass') + || die $DBI::errstr; . . .
generates the error message:
perl: relocation error: /usr/lib/perl/5.6.1/auto/DBD/Oracle/Oracle.so: + undefined symbol: OCIInitialize
Commenting out the my $dbh line.. reveals that
path = /usr/local/share/oracle/815client/lib
as it should be!

In reply to Oracle DBI by aging acolyte

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.