DBD::Oracle question

From: Bart Kersteter (Bart.Kersteter_at_assurant.com)
Date: 03/16/04


Date: Tue, 16 Mar 2004 15:55:17 -0600
To: <dbi-users@perl.org>

Hello All,

I am trying to use DBI and DBD::Oracle to write a script that queries
all of the database instances on a given server to collect
initialization parameters and other statistical info.

The server I am working on has multiple releases of Oracle on it,
specifically 8.1.7.4 and 9.2.0.4. I noticed today while doing some
testing that my DBI call to open a database query will fail depending on
which environmental variables I have set in my shell.

Here's the DBI call.. pretty basic stuff.

my $dbh = DBI->connect( 'dbi:Oracle:<SID>', 'system', <password>',
{RaiseError => 1, AutoCommit => 0}) || die DBI->errstr;

The database in question is an 8.1.7.4 database. When I have the
8.1.7.4 ORACLE_HOME and other environmental variables set in my shell,
the query works without issue. When I have the 9.2.0.4 variables set, I
get the following error:

DBI connect('<SID>','system',...) failed: (no error string) at
./test.pl line 40

This is a Sun server, so I keep master copies of the TNSNAMES.ORA file
in /var/opt/oracle with symlinks in both ORACLE_HOME/network/admin
directories. Regardless of which set of variables I'm using, I can
tnsping and connect to databases of ether release.

Can anyone think of a quick reason why I would be seeing this?

I am using Perl 5.6.1 and the copy of DBI that was released this week.

Thanks,

Bart

Bart Kersteter

Senior DBA - Corporate Database
Assurant
576 Bielenberg Drive
Woodbury, MN 55125
bart.kersteter@assurant.com
(651) 361-5796

**************************************************************************************
This e-mail message and all attachments transmitted with it may contain legally privileged and/or confidential information intended solely for the use of the addressee(s). If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, forwarding or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message and all copies and backups thereof.

Thank you.
**************************************************************************************



Relevant Pages

  • RE: :Oracle question
    ... your environment. ... > I am trying to use DBI and DBD::Oracle to write a script that queries ... > testing that my DBI call to open a database query will fail ... > 8.1.7.4 ORACLE_HOME and other environmental variables set in my shell, ...
    (perl.dbi.users)
  • RE: fetchrow_array performance
    ... I agree - set RasieError. ... it is impossible to tell what is going on in the database without a 10046 trace. ... You aren't error checking your dbi statements - do you have RaiseError ... sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • Re: Evaluated "require $database" not found.
    ... DBI Error 1046: No database selected ... What I have found is that if the spaceare removed as per the correct syntax, then the DBI_errorhandler will trap and report a connection failure if a non-existent database is specified, as per this example: ... This requires that you first have an installation of mysql setup on a host ...
    (perl.dbi.users)
  • Re: Cant call method "prepare" on an undefined value
    ... Somehow you managed to have an undefined value instead of a DBI database handle in front of ->prepare, which is burried deep inside Oraperl.pm. ... Oracle HTTP Server at Server B. Both server are Solaris server. ... I have installed DBI and DBD into Server B and setup the oraperl in my perl script. ...
    (perl.dbi.users)
  • Balasan: RE: Balasan: RE: Balasan: RE: Balasan: RE: cant execute "use $database"
    ... dictionary of the each database of my MSSQL. ... to load it -- DBI will load it for you. ... Subject: Balasan: RE: Balasan: RE: Balasan: RE: ...
    (perl.dbi.users)