I don't think service name resolution is performed with the connect string
you're using (i.e. you are supplying the host and sid).

Instead try:

$service_name = "something in your nameserver";
$dbh =  DBI->connect ("dbi:Oracle:$service_name", $user, $passwd,{
RaiseError => 1, AutoCommit => 0 } ) ;

Jay

----- Original Message -----
From: "Stevenson, Jonathan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 6:11 AM
Subject: Oracle database SID alias not resolving


Hi,

I've just got DBD::Oracle working on HP-UX 11, Oracle 8.1.6, but I'm having
a minor connection problem.
I'm using DBI 1.20 & DBD::Oracle 1.12

The only method I can get to work is e.g.
#$dbh =  DBI->connect ('dbi:Oracle:host=uk204;sid=$dsn', $user, $passwd,{
RaiseError => 1, AutoCommit => 0 } ) ;

This works fine when $dsn is set to the database name, but when it is set to
a database alias that it should resolve via the nameserver, it doesn't - I
get this message:

DBI->connect(host=uk204;sid=s200) failed: ORA-12505: TNS:listener could not
resolve SID given in connect descriptor (DBD ERROR: OCIServerAttach) at
dbtest.pl line 10

As our database names change from time to time, and the old ones are
converted to aliases in the nameserver, it is fairly important that we can
get the aliases to resolve, so we don't need to keep altering older scripts.

Any ideas what I am doing wrong here? I've tried the other methods, but I
just get other methods.

Regards,
Jon Stevenson




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to