Unable to connect to Oracle on another Unix host in a perl programming using DBI

From: Raj Kairam (KairamR_at_coned.com)
Date: 03/23/05


Date: Wed, 23 Mar 2005 14:25:10 -0500
To: <dbi-users@perl.org>

To those who could help me with a problem connecting to an Oracle database on HP-UX from within a perl script that uses DBI
 
I have a perl program on a unix (HP-UX) host(A) running Oracle 8.1.6
In the program I am trying to connect to another unix (HP-UX) host(B) running Oracle 8.1.7 holding a table c1dwg.
 
The perl script that runs on host A contains these lines.
 
$ENV{'ORACLE_HOME'} = '/u01/app/oracle/product/8.1.6';
$ENV{'ORACLE_SID'} = 'CAD';
 
use DBI;
$dbh = DBI->connect('dbi:Oracle:Mycad4prod', '<user>', ''<password') || die "Could not connect: $DBI::errstr";
 
$stmt = "SELECT count(*) from c1dwg";
$sth = $dbh->prepare("stmt") || die "Could not Select: $DBI::errstr";
$sth->execute || die "Could not execute: $DBI::errstr";
 
$sth->finish;
 
The tnsnames.ora file on host A specifies 'Mycad4prod', specified in the above perl script, as below
 
MYCAD4PROD.coned.com =
 (DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP) (HOST = m020cad4) (PORT=1521)) )
    (CONNECT_DATA =
      (SERVICE_NAME = meta817.world) ) )
 
In the above, m020cad4 is the name of host B that I am trying to connect to from A
 
ORA-12541: TNS: no listener (DBD ERROR:OCIServerAttach) at < the line number in the program that ran in to the problem
Could not connect: ORA-12541: TNS: no listener .. the same thing as above ..
 
I stopped and started the listener again but did not help
 
Could any one help, Please.
 
Thanks
 
 



Relevant Pages

  • Re: Problem with fetching LONGs and LONG RAWs (ORA-01062)
    ... This perl script illustrates a strange problem while fetching ... LONGs and LONG RAWs. ... What is the full version of Oracle? ... What is the version of the DBI? ...
    (comp.databases.oracle.misc)
  • Re: DBI with ORACLE encryption
    ... perl script to pull data out of the interface and dump the same to the ... All we do with oracle is to take an database connection ... other ways of connecting to database using dbi. ...
    (perl.dbi.users)
  • Problem using Perl DBI-DBD against Oracle
    ... I'm trying to run this Perl script against a remote Oracle 10g R1 ... I'm using WinXP and i already have the oracle client software ( ... DBI version is: 1.50 ...
    (perl.dbi.users)
  • (Fwd) RE: DBI with ORACLE encryption
    ... Subject: DBI with ORACLE encryption ... perl script to pull data out of the interface and dump the same to the ... All we do with oracle is to take an database connection ...
    (perl.dbi.users)
  • RE: Unable to connect to Oracle on another Unix host in a perl programming using DBI
    ... This is not a DBI issue. ... To those who could help me with a problem connecting to an Oracle database on HP-UX from within a perl script that uses DBI ... In the program I am trying to connect to another unix hostrunning Oracle 8.1.7 holding a table c1dwg. ... The perl script that runs on host A contains these lines. ...
    (perl.dbi.users)