Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

connect to Oracle with DBI

by fionbarr (Friar)
on Aug 29, 2014 at 19:09 UTC ( #1099035=perlquestion: print w/replies, xml ) Need Help??
fionbarr has asked for the wisdom of the Perl Monks concerning the following question:

use strict; use warnings; apologies if this is duplicate
use DBI; my $host = ""; my $user = "user"; my $password = "password"; my $dbh = DBI->connect("dbi:Oracle:host=$host;sid=orcl;port=7010", $user, $password, { RaiseError => 1, AutoCommit => 0 }) +;
I am getting the error:
TNS:listener does not currently know of SID in connect descriptor

Replies are listed 'Best First'.
Re: connect to Oracle with DBI
by Corion (Pope) on Aug 29, 2014 at 19:25 UTC

    Have you consulted with your database administrator whether the sid=orcl is the correct SID to use?

    Most likely, you want to inspect your TNSNAMES.ORA to find out whether that SID is listed there.

    Have you looked at the ::Troubleshooting files in DBD::Oracle for your operating system(s)?

      do I have to install DBD::Oracle (windows 7)
        No, you don't have to install it, it's already installed. But yes, DBD::Oracle must be installed.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1099035]
Front-paged by toolic
[vedagiri89]: hi all! i need your help
[vedagiri89]: i'm facing this issue: Attempt to reload aborted.\ nCompilation failed in require at /usr/lib64/perl5/ vendor_perl//APR. pm line 19.\nBEGIN failed--compilatio n aborted at /usr/lib64/perl5/ vendor_perl//APR. pm line 19.
[vedagiri89]: how do fix this issue
[choroba]: This usually happens when you have more than one version of Perl, and you mix the libraries
[hippo]: Which O/S?
[vedagiri89]: i have searched many forum...not getting resolutions
[vedagiri89]: centos
[Corion]: vedagiri89: Either what choroba said, or maybe you misspelled some module name (on Windows), like use Strict; or something like that.
[vedagiri89]: @choroba, what to do for that

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2018-06-19 11:17 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (113 votes). Check out past polls.