Regards
Pete
export ORACLE_USERID=username/password
export TWO_TASK=//myoraclemachine.domain.com/sid
always works for me and you don't need to set up tnsnames.
I don't think you need ORACLE_HOME set with instant client, just LD_LIBRARY_PATH.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
setting the TWO_TASK environment variable did the trick, thanks for your advice. For some strange reason, the EZconnect format didn't work, so I had to specify the fully qualified connection string, but that got me through.
Carl Furst
-----Original Message-----
From: Alexander Saip [mailto:as...@msn.com]
Sent: Wednesday, February 02, 2011 9:45 AM
To: martin...@easysoft.com
Cc: dbi-...@perl.org
Subject: Re: DBD::Oracle 'make test' fails - ORA-24327: need explicit attach
before authenticating a user
> I am trying to install DBD::Oracle 1.27 on Red Hat Enterprise Linux Server release 5.5 (Tikanga), Linux 2.6.18-194.17.1.el5 x86_64 x86_64 x86_64 GNU/Linux.
> I have already deployed the latest Oracle InstantClient and can connect to the Oracle server (running on a different box) via sqlplus. Since I'm not allowed to log
> on as 'root', I am installing everything in my home directory. I set the ORACLE_HOME, TNS_ADMIN, ORACLE_SID, ORACLE_USERID, LD_LIBRARY_PATH,
> C_INCLUDE_PATH and PERL5LIB environment variables to include everything needed for the Perl module to be happy, as well as creating tnsnames.ora and
> sqlnet.ora files. I can 'make' DBD::Oracle okay, but "make test" fails with the following error
>
>t/10general.............DBI connect('','user/password',...) failed: ORA-24327: need explicit attach before authenticating a user (DBD ERROR: OCISessionBegin)...
I had the exact same problem but I ignored it because I could connect
successfully through a Perl DBI test script. Sure enough, TWO_TASK
fixed it for me too.
However I came across this thread because I'm getting the same error
when I attempt to connect while running under mod_perl. The same code
(simple test connection) runs fine from a standalone perl script, but
I get "ORA-24327: need explicit attach before authenticating a user
(DBD ERROR: OCISessionBegin)" when attempting to connect while running
under mod_perl.
Sorry to hijack this thread, but any suggestions appreciated.
Joe
> However I came across this thread because I'm getting the same error
> when I attempt to connect while running under mod_perl. The same code
> (simple test connection) runs fine from a standalone perl script, but
> I get "ORA-24327: need explicit attach before authenticating a user
> (DBD ERROR: OCISessionBegin)" when attempting to connect while running
> under mod_perl.
Replying to myself in case others run into this problem, I found the
solution. That error message is really a simple "can not connect"
error (same error if you shutdown the listener). If using
tnsnames.ora (I was), under mod_perl I had to explicitly add the
environment variables to the mod_perl startup.pl script where I
preload the modules (even though they were already set in shell).
Alternatively, I would also expect to be able to set them in the
httpd.conf using PerlSetEnv, but I had tried that earlier to no avail.