Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Having trouble trying to use DBD::Oracle with ActivePerl 5.8.8...

by willjones (Sexton)
on Aug 26, 2008 at 23:19 UTC ( #707010=perlquestion: print w/ replies, xml ) Need Help??
willjones has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to use DBD::Oracle with ActivePerl version 5.8.8.822. I am able to run my code fine on a Linux OS, but when I run on Windows using ActivePerl I am getting the following error message...

install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified module could not be found at C:/Perl/lib/DynaLoader.pm line 229. at (eval 34) line 3
Compilation failed in require at (eval 34) line 3.
Perhaps a required shared library or dll isn't installed where expected...

I found this page here that said DBD::Oracle wasn't compatible with ActivePerl v5.8.3, and it reccommends reverting back to version 5.6.1. The latest version at the time that was written was 5.8.3. Any ideas if this is still true now or what I should do to get DBD::Oracle working with ActivePerl 5.8.8 ?

This error is happening on the connect line in my code...
use DBI;

my $db = DBI->connect("dbi:Oracle:$DB_TNS","$DB_USER_ID","$DB_PASSWORD",  { AutoCommit => 0 });
Thanks...

Comment on Having trouble trying to use DBD::Oracle with ActivePerl 5.8.8...
Re: Having trouble trying to use DBD::Oracle with ActivePerl 5.8.8...
by mr_mischief (Monsignor) on Aug 26, 2008 at 23:37 UTC
    Are you sure DBD::Oracle is installed? You might want to try using PPM to install it. The CPAN test matrix for it doesn't look so hot: no recent perl on any platform seems to like it.

    You might want to set Oracle up with ODBC and use DBD::ODBC instead.

      no recent perl on any platform seems to like it.

      You're reading too much into automated testing. DBD-Oracle, like many distributions, requires a live monkey to read the README and push some buttons :)

      Yeah, it's installed. I opened up PPM and typed DBD-Oracle in the search box. It came up and was showing as installed. I marked it for uninstall and ran the action. Then I marked it for install again after this and re-installed it. It is getting the pre-compiled module for Windows from the ActiveState site... http://ppm4.activestate.com/MSWin32-x86/5.8/822/package.xml

      The version number I have installed is DBD-Oracle 1.19.
      I went to C:\Perl\site\lib\auto\DBD\Oracle and saw 10 files listed there one of which was Oracle.dll which is the file the error message complains about.
      I suppose I could try to get DBD::ODBC working although I'd like to use DBD-Oracle if it's at all possible.
      Thanks...
        In general, if there's a package from ActiveState for it, then it should just work. I've never used DBD::Oracle myself so I couldn't say if there's anything special in the way of configuration.

        This dbi-announce message leads me to believe the page you mentioned earlier about the module needing 5.6.1 or earlier is outdated or incorrect. The message is a recount of a successful test with 5.8.7 by someone who develops the module.

        I do know that ActiveState has a support site. This page states that PPM versions no longer exist due to licensing issues, but that page is copyright 2004 so things may have changed yet again by now. Indeed, this PPM info page from 2006 says there is now a DBD::Oracle based around the Oracle Instant Client Library available for ActiveState Perl on Windows. Both of those pages suggest DBD::ODBC might be the way to go. This 2008 support exchange states that the only way to get DBD::Oracle to work for ActiveState Perl 5.8 and 5.10 is to build from CPAN source because ActiveState doesn't have the InstantClient version done yet. This one says that 5.10.0.1003 has DBD::Oracle included.

        I've read good things just now about DBD::Oracle 1.19 from the trouchelle.com PPM repository. It seems some people have better luck using that PPM than the one from ActiveState.

        YMMV, of course. I'm not a user of the module.

        one of which was Oracle.dll which is the file the error message complains about

        That's probably not the file that's causing the grief. I think the error message is telling you that dll can't be loaded because another dll can't be found.

        Without knowing anything about Oracle itself, I would expect that it ships with its own dll(s), and your problem could be that the Oracle dll(s) can't be found. Make sure the location of the Oracle dll(s) is in your path.

        Cheers,
        Rob
Re: Having trouble trying to use DBD::Oracle with ActivePerl 5.8.8...
by Zenshai (Sexton) on Aug 27, 2008 at 03:28 UTC
    I have Oracle working with the same version of Perl you're using.

    I have a gut feeling that your ORA_HOME environment variable is not pointing to the right direction. Do you have an Oracle client installed? When you type SET in cmd, what is ORA_HOME set to?
      Well, I don't have an ORA_HOME environment variable set at all, but I do have an ORACLE_HOME environment variable. It is set to C:\oracle\product\10.1.0\Client_1 Then in my System variables "Path" the very first thing in the path is %ORACLE_HOME%\bin; ... Then in my User Variables (when I right-click on My Computer->Properties->Advanced->Environment Variables) at the top it shows the value of "PATH" beginning with C:\oracle\product\10.1.0\Client_1\bin; (Again as the very first thing in the path.) I took a look at the files in that directory and there are 81 dlls most starting with "ora.." so it seems like it should be the right place. I have Oracle - OraClient10g_home1 installed. If I open a command prompt and type set the Path var shows "C:\oracle\product\10.1.0\Client_1\bin" as the first thing in it. I also have Toad installed by the way and it pulls datasource options from my tnsnames.ora file to get datasource defs. I am able to submit queries with no problem on Toad. I think Toad requires an Oracle client to be installed correctly in order to work.

      I noticed when I open PPM and type DBI it looks like I have two installed. First it shows DBI site 1.601 and then it shows DBI perl 1.58 (where site and perl are under the Area column). There are also 3 other versions available two for 1.602 and one for 1.604. Not sure if this is related to things, but I was thinking DBD-Oracle was dependent on DBI. I tried uninstalling both DBIs but it would only let me uninstall the 1.601 one. After this I clicked on the 1.58 one to be upgraded and it made a new DBI this time 1.602. (The 1.58 one was still showing as installed also.) I uninstalled and re-installed with trouchelle's DBD-Oracle. Still no luck... (Thanks so much to everyone for the pointers so far. Let me know if you have any more ideas.)
        Ok, so i guess its not an oracle client problem.

        Have you tried to look at your PPM areas (>ppm area list)? If there is more than 1, doing '>ppm area sync' might solve the problem. This will make some copies of installed modules so they (theoretically) can be run from any of the install areas.

        If that's not it, I'm out of ideas sorry. :(

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://707010]
Approved by mr_mischief
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-08-28 05:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (256 votes), past polls