Hi All, I am trying to use the DBI module. I am trying to connect to a remote oracle serverand get info from the database. This is my script:
#!/usr/bin/env perl use warnings; use strict; use DBI; my $dbuser = 'bla'; my $pass = 'bla'; my $table = 'v$log,v$logfile'; my $columns = 'v$logfile.member'; my $statment="SELECT v\$logfile.member FROM v\$log, v\$logfile WHERE v +\$log.group# = v\$logfile.group#;"; # connect to the database my $dbh = DBI->connect("dbi:Oracle:host=some_hostname;sid=MCDB", $dbus +er, $pass) or die "Cant connect to : $DBI::errstr\n"; # select entries in the database my $sth = $dbh->prepare('SELECT v$logfile.member FROM v\$log, v$logfil +e WHERE v$log.group# = v$logfile.group#;'); # execute the select statement $sth->execute; my @data = $sth->fetchrow_array(); foreach my $x (@data) { print "$x \n"; } # end the reading of results #$sth->finish; # disconnect from the database $dbh->disconnect;

When running the script I get the following error:

user@hostname /export/home% ./getRawDevices.pl install_driver(Oracle) failed: Can't load '/export/home/user/local/lib/perl/gen/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl-static: fatal: libclntsh.so.9.0: open failed: No such file or directory at /export/home/user/perl/lib/5.8.6/sun4-solaris-thread-multi/DynaLoader.pm line 230. at (eval 1) line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required shared library or dll isn't installed where expected at ./getRawDevices.pl line 14 >/p>

Any idea??? What am I doing wrong? Of course I have googled it and found alot of info about local vars that need to be configured, but nothing was helpful.

Thanks!!

In reply to Getting error while using dbi:oracle by tprizler

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.