I know this has been covered many times before but...

If I try to connect to a local DB using

  $dbh = DBI->connect( "dbi:Oracle:sidname",
                        $user, $pass
                     ) ;

I get the following error

  DBI->connect(sidname) failed: ORA-12541: TNS:no listener (DBD ERROR:
OCIServerAttach)

However, if I use 
  $dbh = DBI->connect( "dbi:Oracle:",
                       $user, $pass
                     ) ;
or 
  $dbh = DBI->connect( "dbi:Oracle:host=host;sid=sidname;port=port",
                       $user, $pass
                     ) ;

the connection works OK.

This is using perl 5.6.0, DBI 1.14 and DBD 1.06 on a solaris box.

A previous post suggests that the tnsnames.ora file has an error in it but
what's confusing me is if I run the same script using older versions of
perl/DBI and DBD ( 5.004_04 / 0.93 / 0.47 ) the first method works as well.

So now I'm not sure if it is a tnsnames problem, a perl/DBI/DBD
installation problem or me!

Any suggestions.

Reply via email to