I use Oracle remotely from Windows all of the time. I don't use ODBC anymore and just connect directly using the Oracle client libraries.

  1. Install and configure Oracle client on Windows
  2. Install ActivePerl
  3. Install DBI module
  4. Install DBD::Oracle module

If you are having trouble connecting, you might have to rename the oci.dll that is installed when installing DBD::Oracle in the Perl bin directory. I have had conflicts with previously installed clients before and having this oci.dll and the Oracle client both installed caused an issue.

Use the following connection string syntax in the DBI connection:

my $dsn = 'dbi:Oracle:host=10.1.1.100;sid=XX;port=1521';

I also use an eval to trap any errors when trying to connect to the database

my $dbh; eval { $dbh = DBI->connect( $dsn, $username, $password) || die "Cannot connect to database - [$dsn]: $DBI::errstr"; }; if ($@) { log("[Error] COULD NOT CONNECT TO DATABASE: [$@]\n"); }

In reply to Re: Remote Oracle database access from windows by tokpela
in thread Remote Oracle database access from windows by my600080

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.