Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: PERL DBI connection to Remote Oracle Database

RE: PERL DBI connection to Remote Oracle Database

From: Cary Millsap <cary.millsap_at_hotsos.com>
Date: Tue, 28 Aug 2007 14:47:19 -0500
Message-ID: <C970F08BBE1E164AA8063E01502A71CFC73317@WIN02.hotsos.com>


But if sqlplus does work, it doesn't imply that DBI will. The way sqlplus resolves your connection id is different from the way Perl DBI does it.

When you use Perl DBI, make sure you have the environment variable ORACLE_HOME set to the right value (one that allows Perl DBI to find your tnsnames.ora file). Otherwise, you're going to spend days trying to figure out what's wrong.

Been there. Got the T-shirt.

Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com
Nullius in verba  

Hotsos Symposium 2008 / March 2-6 / Dallas Visit www.hotsos.com for curriculum and schedule details...

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Mike Bates Sent: Tuesday, August 28, 2007 1:51 PM
To: smishra_97_at_yahoo.com
Cc: oracle-l_at_freelists.org
Subject: Re: PERL DBI connection to Remote Oracle Database

Can you access this database via SQLPlus from the machine you are running Perl DBI on? SQLPlus does not work then Perl DBI will not work.

Mike

Sanjay Mishra wrote:
> Hi
>
> I am working on exsiting Perl program and found that it is usinf DBI
> to connect to Remote Database . The string used to connect the
> Remote database doesn't have PORT. Connection is going fine. Remote
> database is listening on PORT 1523 and not the Default 1521.
>
> I checked the Manual and it says the following but still not clear
> as if it only check on 1521 and 1526 or others. Any ideas as how it
> will work if Port is not specified like even shown below in the Doc
> statement
>
>
> Connecting without environment variables or tnsname.ora file
>
> If you use the |host=$host;sid=$sid| style syntax, for example:
> $dbh = DBI->connect("dbi:Oracle:host=myhost.com;sid=ORCL", $user,
$passwd);
> then DBD::Oracle will construct a full connection descriptor string
> for you and Oracle will not need to consult the tnsname.ora file.
> If a |port| number is not specified then the descriptor will try
> both 1526 and 1521 in that order (e.g., new then old). You can check
> which port(s) are in use by typing "$ORACLE_HOME/bin/lsnrctl stat"
> on the server.
>
> Sanjay
>
> ----------------------------------------------------------------------
> Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge
>

<http://us.rd.yahoo.com/evt=47093/*http://tv.yahoo.com/collections/222>t o
> see what's on, when.

--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l
Received on Tue Aug 28 2007 - 14:47:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US