Hello monks,

I was able to install the Perl DBI and DBD::Oracle drivers from CPAN. But for some reason when I try to use DBD::Oracle I get the following error:

[db07-dc2:~] root% ./dbitest.pl install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@IN +C contains: /usr/perl5/5.8.4/lib/sun4-solaris-64int /usr/perl5/5.8.4/ +lib /usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_per +l/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4-solari +s-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at (ev +al 3) line 3. Perhaps the DBD::Oracle perl module hasn't been fully installed, or perhaps the capitalisation of 'Oracle' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge. at ./dbitest.pl line 19


This is the test script that I am trying to run:

#!/usr/bin/perl use warnings; use strict; use DBI; my $ORACLE_HOME = "/u01/app/oracle/product/10.2.0.4"; my $ORACLE_SID="qaecom1"; my $USER="user"; my $PASS="password"; $ENV{ORACLE_HOME}=$ORACLE_HOME; $ENV{ORACLE_SID}=$ORACLE_SID; $ENV{PATH}="$ORACLE_HOME/bin"; $ENV{LD_LIBRARY_PATH}="$ORACLE_HOME/lib"; use strict; use DBI; my $dbh = DBI->connect( 'dbi:Oracle:qaecom1', '$USER', '$PASS', ) || die "Database connection not made: $DBI::er +rstr"; $dbh->disconnect;


According to CPAN the DBD Oracle driver is up to date:
cpan> install DBD::Oracle CPAN: Storable loaded ok Going to read /homedir/.cpan/Metadata Database was generated on Thu, 31 May 2012 00:43:03 GMT DBD::Oracle is up to date.
It looks to me like the DBD is installed in this path:
[db07-dc2:~] root% ls -l /usr/perl5/site_perl/5.8.4/sun4-solaris-64int +/ | grep DBD drwxr-xr-x 4 root root 512 Dec 12 15:50 DBD


Although if I ls that directory I don't see anything pertaining to Oracle there:
[db07-dc2:~] root% ls -l /usr/perl5/site_perl/5.8.4/sun4-solaris-64int +/DBD total 396 -r--r--r-- 1 root root 52180 Dec 21 2010 DBM.pm -r--r--r-- 1 root root 12168 Aug 16 2010 ExampleP.pm drwxr-xr-x 2 root root 512 Dec 12 15:50 File -r--r--r-- 1 root root 44277 Dec 21 2010 File.pm drwxr-xr-x 4 root root 512 Dec 12 15:50 Gofer -r--r--r-- 1 root root 48753 Jul 26 2010 Gofer.pm -r--r--r-- 1 root root 4065 Dec 21 2010 NullP.pm -r--r--r-- 1 root root 29044 Jun 8 2010 Proxy.pm -r--r--r-- 1 root root 7983 Sep 26 2007 Sponge.pm


Thanks monks!

In reply to Can't locate DBD/Oracle.pm by bluethundr

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.