[cx-oracle-users] "Unable to acquire Oracle environment handle" with cx_Oracle 4.1.2 oracle 10g
Brought to you by:
atuining
From: Oliver-Mark C. <oc...@as...> - 2006-01-16 18:09:01
|
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 wanted connection to the database. The funny thing is that I get the error using the Oracle instant client or 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 error message. If I understand it correctly OCIEnvCreate has to be called before 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 = OCI_OBJECT; envhandle = NULL; printf( "%i\n", mode ); mode = !OCI_THREADED; status = 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 the 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/~ocordes/ 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 |