remote connection with Perl DBI failed!
516809Jun 6 2006 — edited Jun 6 2006Hi,
I have installed oracle8.1.7 on an Unix server, and it works well enough if we use ssh to connect the database.
but it is not enough for me. when i try to connect the database via Perl DBI:Oracle, a problem appears-- DBI connect(...) failed:ORA-12537:TNS connection closed(DBD ERROR: OCIServerAttach).... I use an ActivePerl v5.8.8 on an client side with windows xp operating system.
the perl dbi syntax i used as follows:
my $dbh=DBI->connect("DBI:Oracle:host=$host;sid=$sid;port=$port",$user,$password);
the listener.ora looks like:
LISTENER=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))
)
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=host_name)(PORT=1526))
)
)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=PLSExtPROC)
(ORACLE_HOME=/Oracle/product/8.1.7)
(PROGRAM=extproc)
)
(SID_DESC=
(GLOBAL_DBNAME=global_dbname)
(ORACLE_HOME=/Oracle/product/8.1.7)
(SID_NAME=sid_name)
)
)
the tnsnames.ora looks like:
service=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=host_name)(PORT=1526))
)
(CONNECT_DATA=
(SERVICE_NAME=glob_dbname)
)
)
I have read the cpan documentation about DBD-Oracle, it seems that there is nothing to do with tnsnames.ora.
thanks
alex
alex_tzang@hotmail.com
Message was edited by:
user513806