ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-dbi-dev
perl-dbi-dev
proposal for DBD::Oracle documentation
by Gerhard Lausser other posts by this author
May 17 2008 2:43AM messages near this date
RE: Bug in DBD::Oracle handling LOB columns and synonyms? | Re: Sort hash keys in C...
Hi,

i wrote a script which uses the connection method you describe like this:

To connect to a local database with a user which has been set-up to
authenticate via the OS ("ALTER USER username IDENTIFIED EXTERNALLY"):
$dbh = DBI-> connect('dbi:Oracle:','/','');
Note the lack of a connection name (use the ORACLE_SID environment
variable). 

My tnsnames.ora looks like:
BBA =
  (DESCRIPTION =
   (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dhcp-144.int.consol.de)(PORT = 1521))
  .....

"tnsping bba" worked fine, but my perl-script (where is set $ENV{ORACLE_SID}
= "bba") always said:

CRITICAL - cannot connect to . ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory (DBD ERROR: OCISessionBegin)

What i didn't know, tnsping seems to try also the upper case, that's why i
blindly set ORACLE_SID also to "bba".

Now, 13 hours later (reading half of the internet, reading process and
network traces), i accidentially typed the ORACLE_SID in upper case and it
worked. 

In order to save other people from spending hours in desperation, i propose
to add a warning message on the cpan webpage:

The ORACLE_SID is case sensitive, use the exact copy of the value from
tnsnames.ora!

Greetings from Munich,
Gerhard

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved