Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Perl DBI connect failed
I want connect to a oracle database with a connect string in the form:
dbi:Oracle:host=my_host;sid=my_sid;port=1521
This failes with a the real hostname, but it works with IP-address of
the
host.
Curious enough, a nslookup for this machine works too!
There is a entry in /etc/hosts for this machine.
I can also connect to this database from another host with exact the
same
kind of connect string. In this case the connect works with both,
the real name and IP address.
I think it is a DNS problem, but why the nslookup work?
I attach a debug session:
Name "main::ORACLE_HOME" used only once: possible typo at test_dbi.pl
line 4.
main::(test_dbi.pl:4): $ORACLE_HOME='/opt/oracle/product/8.1.7';
DB<1> n
main::(test_dbi.pl:7): my $dbh =
DBI->connect('dbi:Oracle:host=my_host;sid=my_sid;port=1521',"nutzer","pw")
DB<1> n
DBI->connect(host=my_host;sid=my_sid;port=1521) failed: ORA-12541:
TNS:no listener (DBD ERROR: OCIServerAttach) at test_dbi.pl line 7
Carp::carp('DBI->connect(host=my_host;sid=my_sid;port=1521) failed: ORA-12541: T...') called at /opt/perl5/lib/site_perl/DBI.pm line 412
DBI::connect('DBI',
'dbi:Oracle:host=my_host;sid=my_sid;port=1521', 'nutzer', 'pw') called
at test_dbi.pl line 7
Can't connect to 1st Oracle database: ORA-12541: TNS:no listener (DBD
ERROR: OCIServerAttach)
every help appreciate
thomas
Received on Fri Jan 04 2002 - 02:29:19 CST