Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have installed Activeperl from on my PC(Win98). I able to connect to Access database. But I unable to connect to oracle. I am trying to connect to personal oracle8 installed on my computer. Here is the code I have used to connect to oracle:

use DBI; $dbh = DBI->connect("dbi:Oracle:", "scott","tiger") || die "Unale to c +onnect to oracle. $DBI::errstr\n";
When I run the script the following error I am getting:
C:\ActivePerl\examples>perl conn_oracle.pl install_driver(Oracle) failed: Can't load 'C:/ActivePerl/site/lib/auto +/DBD/Oracl e/Oracle.dll' for module DBD::Oracle: load_file:One of the library fil +es needed to run this application cannot be found at C:/ActivePerl/lib/DynaLoade +r.pm line 200. 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 expecte +d at conn_oracle.pl line 2
Can someone pl. help me?

Thanks

Ashok

Replies are listed 'Best First'.
Re: connecting to oracle
by t0mas (Priest) on Nov 16, 2000 at 12:03 UTC
    Oracle.dll will fail to load if Oracle's bin directory is not in your path. So if you've installed DBD::Oracle and can use sqlplus, check that C:\ORAWIN95\BIN (or whatever) is in your path.

    /brother t0mas
      Yes, great. It works. I did not set the path to Oracle bin directory. Thanks.
Re: connecting to oracle
by btrott (Parson) on Nov 16, 2000 at 10:08 UTC
    Did you install DBD::Oracle?

    Obviously I'm assuming that you've installed Oracle on the machine. Right? So can you connect using sqlplus? This might indicate whether Oracle was installed properly. Whether DBD::Oracle was installed (which is what the above error message seems to discuss) is another matter.

Re: connecting to oracle
by farnsaw (Initiate) on Nov 16, 2000 at 20:37 UTC
    The Oracle DBD driver uses the Oracle client libraries. If you do not have the client software installed and configured on the computer you are running the code on, it will not work. Like /brother t0mas said, you also have to have the Oracle bin directory in your path and you should have a couple of Environment Variables set (like ORA_HOME, ORA_SID, etc). See your Oracle client software installation instructions to see. Also be sure to test the connection using Oracle software 'sqlplus' before assuming the problem is in DBD or DBI (or Perl ;-) You can contact Oracle to get the client software for your platform (and all platforms) sent to you, just call their customer care line.

    Good luck and MAIH...

(jcwren) Re: connecting to oracle
by jcwren (Prior) on Nov 16, 2000 at 09:51 UTC
    The error message seems to be fairly indicative of the problem.

    Have you verified that the Oracle.dll file is installed? If not, you may need to install DBD::Oracle, or use what ActiveState supplies. Use Start->Find->Files or Folders, and search for Oracle.dll, see if it's anywhere on the disk drive.

    You should also verify that you can connect to the Oracle server with an interactive utility. mySQL has the command line utility called 'mysql'. I imagine there is something similiar for Oracle.

    --Chris

    e-mail jcwren