RE: Errors, Connecting to Oracle
- From: Ron.Reidy@xxxxxxxxxxxxxxxxxx (Ron Reidy)
- Date: Thu, 29 Jun 2006 11:49:17 -0600
From oerr:
$ oerr ora 12541
12541, 00000, "TNS:no listener"
// *Cause: The connection request could not be completed because the
listener
// is not running.
// *Action: Ensure that the supplied destination address matches one of
// the addresses used by the listener - compare the TNSNAMES.ORA entry
with
// the appropriate LISTENER.ORA file (or TNSNAV.ORA if the connection is
to
// go by way of an Interchange). Start the listener on the remote
machine.
You have no listener installed or running.
--
Ron Reidy
Lead DBA
Array BioPharma, Inc.
-----Original Message-----
From: LLC [mailto:kevin@xxxxxxxxxxxxxxxxxxx]
Sent: Thursday, June 29, 2006 11:45 AM
To: dbi-users@xxxxxxxx
Subject: Errors, Connecting to Oracle
Hi List.
I've installed Oracle on my linux box (SuSE 10) and I've installed
DBD::Oracle.
I can run sqlplus as the oracle user however when I try and connect via
DBD::Oracle in a perl script I always get errors as follows:
connect string =
my $dbh = DBI->connect("dbi:Oracle:ORCL", 'oracle', 'oracle' );
error =
DBI connect('ORCL','oracle',...) failed: ORA-12541: TNS:no listener (DBD
ERROR: OCIServerAttach) at ora1.pl line 7
Connection Failed...
connect string =
my $dbh = DBI->connect("dbi:Oracle:HOST=linux.site;SID=ORCL;PORT=1522",
'oracle', 'oracle' );
error =
DBI connect('HOST=linux.site;SID=ORCL;PORT=1522','oracle',...) failed:
ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach) at ora1.pl line
7
Connection Failed...
Maybe I have the connect string wrong?
Below is a listing of my code, and my tnsnames.ora:
Thanks in advance for your help.
############ code listing ################ #!/usr/bin/perl
use DBI;
print "Started\n";
my $dbh = DBI->connect("dbi:Oracle:HOST=linux.site;SID=ORCL;PORT=1522",
'oracle', 'oracle' );
if ($dbh) {
print "Connected...\n";
}
else {
print "Connection Failed...\n";
exit;
}
my $qry = $dbh->prepare("select count(*) from dba_tables");
$qry->execute();
my @data = $qry->fetchrow_array();
print "[$data[0]] [$data[1]] [$data[2]]\n";
exit;
######### tnsnames.ora listing #####################
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = linux.site)(PORT = 1522))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = linux.site)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is intended
to be for the use of the individual or entity named above. If you are not the
intended recipient, please be aware that any disclosure, copying, distribution
or use of the contents of this information is prohibited. Please notify the
sender of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.
.
- Prev by Date: Errors, Connecting to Oracle
- Next by Date: Re: memory leak in DBI XS bootstrap code
- Previous by thread: Errors, Connecting to Oracle
- Next by thread: DBD::Sybase with MS SQL insert problem
- Index(es):
Relevant Pages
|