Re: [cx-oracle-users] "Unable to acquire Oracle environment handle" with cx_Oracle 4.1.2 oracle 10g
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2006-01-16 18:33:39
|
This error occurs when the Oracle client that cx_Oracle was compiled with does not match the client that is currently in use. You have to make sure that these match. So perhaps you can give a little more information. What Oracle client are you using. Are you building your own cx_Oracle or using a precompiled one -- if so, which one. What are the values for ORACLE_HOME and LD_LIBRARY_PATH and where is your Oracle client installed. If you run "ldd cx_Oracle.so" what is the result? Specifically which libclntsh.so is it linked against? Hope this helps track it down. On 1/16/06, Oliver-Mark Cordes <oc...@as...> wrote: > Hi! > > I got the error message "Unable to acquire Oracle environment handle" and > I'm a little bit puzzled that it is not functioning. > > The problem is NOT: > - ORACLE_HOME > - LD_LIBRARY_PATH > - Debian Linux > - TNS_ADMIN > > All necessary variables are set and working. With sqlplus I get the wante= d > connection to the database. > > The funny thing is that I get the error using the Oracle instant client o= r > other client installation but not with an export of the full database > installation I'm using on a different machine. The next thing I tried is > to use the module compiled on a working environment which also fails > (oracle library and linking were OK). > > Looking into the source code I found that "OCIEnvCreate" creates the erro= r > message. If I understand it correctly OCIEnvCreate has to be called befor= e > other Oracle function can be called right? So questions about a correct > server,password etc as I found in the net are stupid ;-) I wrote a small > C-Program and used the same compile options: > > /* small program */ > #include <stdlib.h> > > #include <stdio.h> > > #include "oratypes.h" > > #include "ociap.h" > > int main( int argc, char *argv[] ) > { > OCIEnv *envhandle; > > sword status; > ub4 mode; > > mode =3D OCI_OBJECT; > envhandle =3D NULL; > > printf( "%i\n", mode ); > > mode =3D !OCI_THREADED; > > status =3D OCIEnvCreate( &envhandle, mode, NULL, NULL, NULL, NULL, 0, = NULL > ); > > printf( "%i\n", status ); > > if (!envhandle ) > printf( "Unable to acquire Oracle environment handle!\n" ); > else > printf( "Success!\n" ); > > return 0; > } > > > /* end of small program */ > > This program works fine with my installation of the client! Btw, it is th= e > recent client of the Oracle 10g distribution. > > > Any suggestions? > > > Thanks for help, > > Oliver > > > PS: Sorry for my tone, but Oracle is driving me crazy. We have to use > Oracle and cx_Oracle for an important project and my boss is pressing ... > > > > -- > (O> (0- _o) -O) > //\ //\ /\\ /\\ > V_/_ V_/_ _\_V _\_V > > Dr. Oliver-M. Cordes E-Mail: oc...@as... > Sternwarte der WWW-URL: http://www.astro.uni-bonn.de/~ocor= des/ > Universitaet Bonn Phone: (49) 228 / 73-5656 > Auf dem Huegel 71 Fax: (49) 228 / 73-3672 > D - 53121 Bonn Germany > > Private address: Witterschlickerstr. 22 , D - 53123 Bonn > Private phone: (49) 228 / 7482582 > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |