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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cannot connect using Perl::DBI (aix)

Re: Cannot connect using Perl::DBI (aix)

From: Peter Levine <Peter.Levine_at_mckesson.com>
Date: 4 Jan 2002 09:30:51 -0800
Message-ID: <f6d9921d.0201040930.16066cee@posting.google.com>


Ron Reidy <rereidy_at_indra.com> wrote in message news:<3C33A73C.78EDB3E0_at_indra.com>...
> Peter Levine wrote:
> >
> > Using AIX 4.3 I can connect to a remote server's AIX database using
> > sqlplus and can verify the connection via tnsping, but I cannot
> > connect remotely using Perl::DBI::connect(). I can connect via perl if
> > I am actually logged on to the remote server.
> >
> > tnsping output from local server to remote server:
> > Attempting to contact
> > (ADDRESS=(COMMUNITY=mckcommunity1.world)(PROTOCOL=TCP)(Host=eh04)(Port=1521))
> > OK (10 msec)
> >
> > perl output from
> > $dbh=DBI->connect("DBI:Oracle:$database",$user,$password)
> > where
> > $database="myDB" and $user="user_at_myDB"
> >
> > connecting: ORA-12154: TNS:could not resolve service name (DBD: login
> > failed)
> >
> > My DBA has the listner.ora and tnsnames.ora file beneath /etc NOT
> > beneath $ORACLE_HOME/network/admin so I have defined environmental
> > param TNS_ADMIN as /etc.
> >
> > I do not see an sqlnet.ora file defined anywhere. Do I need it?
> >
> > Can anyone tell me why I can't connect via perl.
> >
> > TIA
> You need to read the DBD::Oracle docs (perldoc DBD::Oracle). All the
> connection infor is there.

Found the problem: There was a typo (wrong host) in tnsnames.ora. The DBA has corrected and all's well. Received on Fri Jan 04 2002 - 11:30:51 CST

Original text of this message

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