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

Hi, I just started learning perl. Its been a bumpy ride since now (but its been fun). Now my question. To make perl programs that talk to the Oracle database, why is it necessary to have the Oracle client installed in the computer? Thanks, Vijay.

Replies are listed 'Best First'.
Re: Oracle client for Perl??
by marto (Cardinal) on Aug 01, 2009 at 18:21 UTC

    You will need DBI and DBD::Oracle. DBD::Oracle has README files (some OS specific) with help and advice for installing the module and the required Oracle client.

    Installing Modules from the tutorials section should be of interest if you need help installing modules.

    Martin

Re: Oracle client for Perl??
by FloydATC (Deacon) on Aug 01, 2009 at 20:13 UTC
    why is it necessary to have the Oracle client installed in the computer?
    This is not exclusive to DBD::Oracle, in fact most well-written Perl modules re-use existing libraries instead of trying to re-invent wheels. In some cases the exact protocol specs etc. may not even be available to the public, or they may be subject to change.

    You'll be very happy the day you decide to upgrade your Oracle server or client, and all your perl scripts keep working like nothing had happened.

    -- Time flies when you don't know what you're doing
      Thanks FloydATC. Oracle does provide its own perl modules. I guess they are re-used and as you said, not re-invent the wheel. It makes sense but why install this huge Oracle client when the oracle specific perl modules can be packaged in some other form. Such a perl module won't be more than a few megs.

      I come from the Java world and very new to perl, so its very likely that the question above makes no sense. Just that my curiosity prevails.
        why install this huge Oracle client

        What is so "huge" about Oracle's instant client (http://www.oracle.com/technology/tech/oci/instantclient/index.html) which you can use with DBD::Oracle. You'll need instant client basic, sdk and sqlplus (as DBD::Oracle's Makefile.PL uses sqlplus to detect Oracle version). All that adds up to 46Mb.

        I have no idea how DBD::Oracle is glued together with the Oracle client, maybe it actually uses the Oracle PL*SQL stuff. The important thing is that as long as the client is installed and you're using DBI, you don't really need to know how it actually works because you're using a standard API separating your from all those ugly details.

        Still curious? Excellent :-D

        -- Time flies when you don't know what you're doing