Does 'tnsping Mycad4prod' work from host(A)? I created a service
called test.xyz.com. 'tnsping test' fails (TNS-03505: Failed to resolve
name), but 'tnsping test.xyz.com' works. This doesn't sound like a DBI
issue at this point.
On Mar 23, Kairam, Raj scribed:
> 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
>
>
>