RE: problem with DBD::Oracle



Thanks to everyone who tried to help. In the end I solved the problem
by searching on google and finding the answer. The problem is specific
to mod_perl2 which is what we are running. I'm not sure I really
understood the explanation but it has to do with the fact that you can't
set environment variables in the script but it should be done at startup
time in the startup.pl script which is what we did and now things are
working properly.

Malka Cymbalista
Webmaster, Weizmann Institute of Science
malki.cymbalista@xxxxxxxxxxxxxx
08-934-3036

>>> "Reidy, Ron" <Ron.Reidy@xxxxxxxxxxxxxxxxxx> 31/05/2005 17:49 >>>
This error message looks hinkey. Are you printing the value of
DBI::errstr? If so, there is definitely something wrong with your
environment.

In any case, if you are making a connection to a remote server, your
connection string is wrong. AFAIK, it should read
"DBI->connect("dbi:Oracle:<your_oracle_sid>" ...".

-----------------
Ron Reidy
Lead DBA
Array BioPharma, Inc.


-----Original Message-----
From: Malka Cymbalista [mailto:Malki.Cymbalista@xxxxxxxxxxxxxx]
Sent: Tuesday, May 31, 2005 1:45 AM
To: Reidy, Ron
Subject: RE: problem with DBD::Oracle


Thanks for your reply. Unfortunately, I still cannot find the problem.

The error message I get back is ERROR OCIEnvNlsCreate (check
ORACLE_HOME
and NLS settings etc.). However, ORACLE_HOME is printed properly from
the script the NLS setrtings also look OK.
All the files in ORACLE_HOME/lib are readable by the world so I don't
think there's a problem with permissions. What's strange is that when
I
run it from the command line using the same user that runs the web
serve, everything works fine. Anyway, thanks again for your response
and for trying to help.



Malka Cymbalista
Webmaster, Weizmann Institute of Science
malki.cymbalista@xxxxxxxxxxxxxx
08-934-3036

>>> "Reidy, Ron" <Ron.Reidy@xxxxxxxxxxxxxxxxxx> 25/05/2005 17:21 >>>
Well, to start, you should **always** print the Oracle error message
($DBI->errstr). This will tell you more than we on this list could
even
hope to guess.

Next, if it runs from the command line, then you most likely have a
permissions issue with either the Perl script itself, or the Oracle.so
library.

-----------------
Ron Reidy
Lead DBA
Array BioPharma, Inc.


-----Original Message-----
From: Malka Cymbalista [mailto:Malki.Cymbalista@xxxxxxxxxxxxxx]
Sent: Wednesday, May 25, 2005 5:47 AM
To: dbi-users@xxxxxxxx
Subject: problem with DBD::Oracle


Our web server is running Apache 2.0.48 with mod_perl 1.99_12 on a
Sun
machine running Solaris 9. We are running perl 5.8.1, DBI 1.39 and
DBD-Oracle 1.16. We are trying to connect from our web server to an
Oracle database that is on a different machine. The script that we
wrote to do this runs perfectly well when we run it from the command
line as a plain user. However, when we try running it from the web,
we
cannot connect to the database.
When running from the web, the following environment variables are
printed properly:
TWO_TASK
ORACLE_SID
LIBPATH
LD_LIBRARY_PATH
ORACLE_HOME
SHLIB_PATH

I use the following code to connect to the database:
if ( ! ($dbh = DBI->connect("dbi:Oracle:", $dbuser, '', { PrintError
=>
0, AutoCommit => 0 }))) {
print "Error: cannot connect to DB<br>\n";
exit(0);
}
$dbuser is defined as
$dbuser = 'userid/password';

After all the environment variables are printed out, I get the message

Error: cannot connect to DB

As I said at the start, the script works perfectly well from the
command line even when it is run from the same userid that the web
runs
under.

Any suggestions to get this working from the web will be greatly
appreciated. Thanks in advance.




Malka Cymbalista
Webmaster, Weizmann Institute of Science
malki.cymbalista@xxxxxxxxxxxxxx
08-934-3036

This electronic message transmission is a PRIVATE communication which
contains
information which may be confidential or privileged. The information
is
intended
to be for the use of the individual or entity named above. If you are
not the
intended recipient, please be aware that any disclosure, copying,
distribution
or use of the contents of this information is prohibited. Please
notify
the
sender of the delivery error by replying to this message, or notify
us
by
telephone (877-633-2436, ext. 0), and then delete it from your system.

This electronic message transmission is a PRIVATE communication which
contains
information which may be confidential or privileged. The information is
intended
to be for the use of the individual or entity named above. If you are
not the
intended recipient, please be aware that any disclosure, copying,
distribution
or use of the contents of this information is prohibited. Please notify
the
sender of the delivery error by replying to this message, or notify us
by
telephone (877-633-2436, ext. 0), and then delete it from your system.
.



Relevant Pages

  • RE: problem with DBD::Oracle
    ... Next, if it runs from the command line, then you most likely have a permissions issue with either the Perl script itself, or the Oracle.so library. ... Oracle database that is on a different machine. ... sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • when lid is closed
    ... This script use a command called "vidcontrol", and I don't know and also didn't found any command with this name, more over, I also don't know what is the relation between close-the-lid and the "notify 5" inside the file ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: NLS issues if using DBD::Oracle from mod_perl2
    ... As I said, this works from the command line, (if I don't go through ... > This electronic message transmission is a PRIVATE communication which contains ... > intended recipient, please be aware that any disclosure, copying, distribution ... > sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • RE: Perl script
    ... Perl Cookbook - http://www.oreilly.com/catalog/perlckbk2/ ... Subject: Perl script ... intended recipient, please be aware that any disclosure, copying, distribution ... sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • Summary - Move Data between disks command.
    ... then withdraw the old disk and the data will migrate automatically ... Move Data between disks command. ... intended recipient please delete the message and notify the sender. ...
    (Tru64-UNIX-Managers)