From: "Stephen Turner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 27, 2002 10:02
Subject: Oracle Local Connect Failing
> We've had DBI/DBD::Oracle scripts working for many years
> now doing a local connect like this:
>
> my $db_handle = DBI->connect( $ENV{'ORACLE_SID'}, $username, $password,
> "Oracle");
>
> Now, after an Oracle upgrade (7.3.4->8.1.6), this statement fails
> with the message:
>
> ORA-12154 TNS: Could not resolve service name (DBD ERROR: OCIServerAttach)
>
> The program now seems to think that the ORACLE_SID string is a remote
> database identifier in tnsnames.ora rather than a SID for a local
database.
>
> We find that these solutions work:
>
> my $db_handle = DBI->connect( "", $username, $password, "Oracle");
> my $db_handle = DBI->connect( "dbi:Oracle:", $username, $password);
>
> Question is - did the ability to supply an Oracle SID for a local
> connection become obsolete in DBI/DBD::Oracle? Or is there some setting
> or configuration that will still allow this feature?
The method you have been using for passing the instance to connect() has
been deprecated for several years now. I've always used
....connect("dbi:Oracle:$sid", $uid, $pwd), does that work for you?
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.