Thread: [cx-oracle-users] InterfaceError: Unable to acquire Oracle environment handle
Brought to you by:
atuining
From: David W. <dav...@gm...> - 2008-08-14 02:49:57
|
Hi. I'm hoping for some install help, but I have to start by admitting that I'm completely new to Oracle and could very well not have the Oracle client set up correctly. I have Oracle's SQL Developer loaded and can access the database tables I am interested in. I have searched extensively with Google and can't come up with the next trouble shooting step. I can't tell if it is an Oracle client problem or a cx_Oracle problem or both. Here's a bunch of info. Thanks in advance, Dave ===================================== import cx_Oracle dsn_tns = cx_Oracle.makedsn('ISTRND', 1521, 'ISTRND') db2 = cx_Oracle.connect('laqlu', 'pwd', dsn_tns) print dsn_tns print db2 db2.close() ====================================== (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ISTRND)(PORT=1521)))(CONNECT_DATA=(SID=ISTRND))) Traceback (most recent call last): File "C:\Local\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\Local\Python25\Lib\site-packages\SummitTrend\oracle.py", line 6, in <module> db2 = cx_Oracle.connect('laqlu', 'pwd', dsn_tns) InterfaceError: Unable to acquire Oracle environment handle ====C:\oracle\ora9\network\ADMIN\TNSNames.ora================ ISTRND = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = ISTRND) (Port = 1521))) (CONNECT_DATA = (SID = ISTRND)(SERVER=DEDICATED))) ===================================================== >>> Running tests for cx_Oracle version 4.4 Running tests in Connection.py connection to database with user, password, TNS separate ... ERROR connection to database with bad connect string ... ERROR connection to database with bad password ... ERROR confirm an exception is raised after closing a connection ... ERROR test making a data source name from host, port and sid ... ok connection rolls back before close ... ERROR connection rolls back before destruction ... ERROR connection to database with user, password, TNS together ... ERROR connection to database with multiple threads ... Exception in thread Thread-11: Traceback (most recent call last): File "C:\Local\Python25\lib\threading.py", line 460, in __bootstrap self.run() File "C:\Local\Python25\lib\threading.py", line 440, in run self.__target(*self.__args, **self.__kwargs) File "Connection.py", line 10, in __ConnectAndDrop self.tnsentry, threaded = True) InterfaceError: Unable to acquire Oracle environment handle |
From: Jason B. <jb...@ze...> - 2010-03-18 14:30:24
|
My continuous integration server is getting a weird error that I haven't seen before: Traceback (most recent call last): File "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/multiprocessing-2.6.2.1-py2.6-linux-i686.egg/multiprocessing/process.py", line 237, in _bootstrap self.run() File "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/jiva_interface/process/__init__.py", line 150, in run self.main() File "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/jiva_interface/interface_core/row_loader.py", line 239, in main store = create_store(self.cfg, name=self.name) File "build/bdist.linux-i686/egg/dbkit/connect.py", line 127, in create_store return _make_store(db_cfg, name, zstore_util) File "build/bdist.linux-i686/egg/dbkit/connect.py", line 168, in _make_store store = zstore_util.create(name, uri) File "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/storm-0.16.0-py2.6-linux-i686.egg/storm/zope/zstorm.py", line 133, in create store = Store(database) File "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/storm-0.16.0-py2.6-linux-i686.egg/storm/store.py", line 72, in __init__ self._connection = database.connect(self._event) File "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/storm-0.16.0-py2.6-linux-i686.egg/storm/database.py", line 381, in connect return self.connection_factory(self, event) File "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/storm-0.16.0-py2.6-linux-i686.egg/storm/database.py", line 182, in __init__ self._raw_connection = self._database.raw_connect() File "build/bdist.linux-i686/egg/storm_oracle/oracle.py", line 578, in raw_connect self._password, self._dsn) InterfaceError: Unable to acquire Oracle environment handle I've done a basic google search, and found that this is usually a mismatch of some kind between the ORACLE_HOME and LD_LIBRARY_PATH. That doesn't seem to be the case right now. The variables that I have set are coming from $ORACLE_HOME/bin/oracle_env.sh. I've tried it with both 5.0.2 and 5.0.3, and I still get the same thing. Here are the environment variables I'm using (with all the sensitive ones taken out): BUILD_URL=http://192.168.2.27:8080/job/jiva_interface_trunk/62/ HOSTNAME=inftest01 SHELL=/bin/bash TERM=xterm HISTSIZE=1000 NLS_LANG=AMERICAN_AMERICA.AL32UTF8 KDE_NO_IPV6=1 BUILD_TAG=hudson-jiva_interface_trunk-62 JIVA_DB_PLATFORM=oracle WORKSPACE=/var/lib/hudson/jobs/jiva_interface_trunk/workspace JOB_URL=http://192.168.2.27:8080/job/jiva_interface_trunk/ USER=hudson ORACLE_DSN_NAME=oradev LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35: LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib: NO_BULK=True KDEDIR=/usr NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin:/var/lib/hudson/usr/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin TNS_ADMIN=/var/lib/hudson MAIL=/var/spool/mail/hudson INPUTRC=/etc/inputrc PWD=/var/lib/hudson/jobs/jiva_interface_trunk/workspace HUDSON_URL=http://192.168.2.27:8080/ LANG=en_US.UTF-8 KDE_IS_PRELINKED=1 JOB_NAME=jiva_interface_trunk XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt BUILD_ID=2010-03-18_08-48-40 SQLPATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/sqlplus SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass HOME=/var/lib/hudson SHLVL=2 SRV_ROOT=/srv/www/lighttpd/ EXECUTOR_NUMBER=0 LOGNAME=hudson HUDSON_HOME=/var/lib/hudson LESSOPEN=|/usr/bin/lesspipe.sh %s BUILD_NUMBER=62 HUDSON_COOKIE=25e5918c-dd84-4f59-b1f2-97104c386a0d ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client G_BROKEN_FILENAMES=1 _=/bin/env Is there anything here that might cause a problem? |
From: juhui <ph...@gm...> - 2010-03-18 16:10:45
|
try add -------------- import os os.environ["ORACLE_HOME"] = "/home/oracle/product/10.2.0" -------------- to setting.py header. 2010/3/18 Jason Baker <jb...@ze...> > My continuous integration server is getting a weird error that I haven't > seen before: > > Traceback (most recent call last): > File > "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/multiprocessing-2.6.2.1-py2.6-linux-i686.egg/multiprocessing/process.py", > line 237, in _bootstrap > self.run() > File > "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/jiva_interface/process/__init__.py", > line 150, in run > self.main() > File > "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/jiva_interface/interface_core/row_loader.py", > line 239, in main > store = create_store(self.cfg, name=self.name) > File "build/bdist.linux-i686/egg/dbkit/connect.py", line 127, in > create_store > return _make_store(db_cfg, name, zstore_util) > File "build/bdist.linux-i686/egg/dbkit/connect.py", line 168, in > _make_store > store = zstore_util.create(name, uri) > File > "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/storm-0.16.0-py2.6-linux-i686.egg/storm/zope/zstorm.py", > line 133, in create > store = Store(database) > File > "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/storm-0.16.0-py2.6-linux-i686.egg/storm/store.py", > line 72, in __init__ > self._connection = database.connect(self._event) > File > "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/storm-0.16.0-py2.6-linux-i686.egg/storm/database.py", > line 381, in connect > return self.connection_factory(self, event) > File > "/var/lib/hudson/jobs/jiva_interface_trunk/workspace/lib/python2.6/site-packages/storm-0.16.0-py2.6-linux-i686.egg/storm/database.py", > line 182, in __init__ > self._raw_connection = self._database.raw_connect() > File "build/bdist.linux-i686/egg/storm_oracle/oracle.py", line 578, in > raw_connect > self._password, self._dsn) > InterfaceError: Unable to acquire Oracle environment handle > > I've done a basic google search, and found that this is usually a mismatch > of some kind between the ORACLE_HOME and LD_LIBRARY_PATH. That doesn't seem > to be the case right now. The variables that I have set are coming from > $ORACLE_HOME/bin/oracle_env.sh. I've tried it with both 5.0.2 and 5.0.3, > and I still get the same thing. Here are the environment variables I'm > using (with all the sensitive ones taken out): > > BUILD_URL=http://192.168.2.27:8080/job/jiva_interface_trunk/62/ > HOSTNAME=inftest01 > SHELL=/bin/bash > TERM=xterm > HISTSIZE=1000 > > NLS_LANG=AMERICAN_AMERICA.AL32UTF8 > KDE_NO_IPV6=1 > BUILD_TAG=hudson-jiva_interface_trunk-62 > JIVA_DB_PLATFORM=oracle > WORKSPACE=/var/lib/hudson/jobs/jiva_interface_trunk/workspace > JOB_URL=http://192.168.2.27:8080/job/jiva_interface_trunk/ > > USER=hudson > ORACLE_DSN_NAME=oradev > LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35: > > LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib: > > NO_BULK=True > KDEDIR=/usr > NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat > PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin:/var/lib/hudson/usr/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin > > TNS_ADMIN=/var/lib/hudson > MAIL=/var/spool/mail/hudson > INPUTRC=/etc/inputrc > PWD=/var/lib/hudson/jobs/jiva_interface_trunk/workspace > HUDSON_URL=http://192.168.2.27:8080/ > > LANG=en_US.UTF-8 > KDE_IS_PRELINKED=1 > JOB_NAME=jiva_interface_trunk > XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt > BUILD_ID=2010-03-18_08-48-40 > SQLPATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/sqlplus > > SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass > HOME=/var/lib/hudson > SHLVL=2 > SRV_ROOT=/srv/www/lighttpd/ > EXECUTOR_NUMBER=0 > LOGNAME=hudson > HUDSON_HOME=/var/lib/hudson > LESSOPEN=|/usr/bin/lesspipe.sh %s > > BUILD_NUMBER=62 > HUDSON_COOKIE=25e5918c-dd84-4f59-b1f2-97104c386a0d > ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client > G_BROKEN_FILENAMES=1 > _=/bin/env > > Is there anything here that might cause a problem? > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > -- LB can FlY |
From: Jason B. <jb...@ze...> - 2010-03-18 17:45:27
|
On Thu, Mar 18, 2010 at 11:10 AM, juhui <ph...@gm...> wrote: > try add > -------------- > import os > os.environ["ORACLE_HOME"] = "/home/oracle/product/10.2.0" > -------------- > to setting.py header. > I'm not sure I understand. First, that directory doesn't exist. Second, which setting.py header are we talking about? |
From: juhui <ph...@gm...> - 2010-03-19 04:52:08
|
sorry, I said in django prjects. I have encounter this Traceback several dasys before . may be the Python script can't get the environment var ORACLE_HOME add the two lines to your scripts ,the value depends on you environment . 2010/3/19 Jason Baker <jb...@ze...> > On Thu, Mar 18, 2010 at 11:10 AM, juhui <ph...@gm...> wrote: > >> try add >> -------------- >> import os >> os.environ["ORACLE_HOME"] = "/home/oracle/product/10.2.0" >> -------------- >> to setting.py header. >> > > I'm not sure I understand. First, that directory doesn't exist. Second, > which setting.py header are we talking about? > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > -- LB can FlY |
From: Jason B. <jb...@ze...> - 2010-03-19 14:23:16
|
On Thu, Mar 18, 2010 at 11:52 PM, juhui <ph...@gm...> wrote: > sorry, I said in django prjects. > I have encounter this Traceback several dasys before . > may be the Python script can't get the environment var ORACLE_HOME > add the two lines to your scripts ,the value depends on you environment . > I believe the ORACLE_HOME variable is set properly. I'm unable to reproduce the issue when I log in to the server under the same user. So I think it's some kind of environment variable issue. However, I don't seem to be able to figure out what it is. For reference, here are the environment variables when I log in to the server myself: HOSTNAME=inftest01 TERM=xterm SHELL=/bin/bash HISTSIZE=1000 KDE_NO_IPV6=1 NLS_LANG=AMERICAN_AMERICA.AL32UTF8 USER=hudson LS_COLORS=no=00:fi=00:di=00 LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib: KDEDIR=/usr PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin:/var/lib/hudson/usr/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin MAIL=/var/spool/mail/hudson TNS_ADMIN=/var/lib/hudson PWD=/var/lib/hudson INPUTRC=/etc/inputrc KDE_IS_PRELINKED=1 LANG=en_US.UTF-8 PS1=\W SQLPATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/sqlplus SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass HOME=/var/lib/hudson SHLVL=3 LOGNAME=hudson LESSOPEN=|/usr/bin/lesspipe.sh %s ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client G_BROKEN_FILENAMES=1 _=/bin/env ...I don't see anything there that should cause a problem. |
From: Anthony T. <ant...@gm...> - 2010-03-19 14:56:15
|
>From your list of environment variables, these are the ones that are relevant and should be the same when running within the web server. Check to see if they are there and what values they have carefully! - This one sets the encoding used by Oracle; without it it will guess one on its own NLS_LANG=AMERICAN_AMERICA.AL32UTF8 - This one defines where to search for libraries; as stated elsewhere you can also set this in /etc/ld.so.conf which will make it unnecessary to set this variable and is probably preferable LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib: - This one sets the location where Oracle searches for configuration files like sqlnet.ora and tnsnames.ora; if you don't set this it looks in its own location defined differently for each platform but often it is $ORACLE_HOME/network/admin TNS_ADMIN=/var/lib/hudson - This one is required and tells Oracle where to find message files and everything else ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client Hopefully this helps. Anthony On Fri, Mar 19, 2010 at 8:23 AM, Jason Baker <jb...@ze...> wrote: > On Thu, Mar 18, 2010 at 11:52 PM, juhui <ph...@gm...> wrote: >> >> sorry, I said in django prjects. >> I have encounter this Traceback several dasys before . >> may be the Python script can't get the environment var ORACLE_HOME >> add the two lines to your scripts ,the value depends on you environment . > > I believe the ORACLE_HOME variable is set properly. I'm unable to reproduce > the issue when I log in to the server under the same user. So I think it's > some kind of environment variable issue. However, I don't seem to be able > to figure out what it is. For reference, here are the environment variables > when I log in to the server myself: > > HOSTNAME=inftest01 > TERM=xterm > SHELL=/bin/bash > HISTSIZE=1000 > KDE_NO_IPV6=1 > NLS_LANG=AMERICAN_AMERICA.AL32UTF8 > USER=hudson > LS_COLORS=no=00:fi=00:di=00 > LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib: > KDEDIR=/usr > PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin:/var/lib/hudson/usr/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin > MAIL=/var/spool/mail/hudson > TNS_ADMIN=/var/lib/hudson > PWD=/var/lib/hudson > INPUTRC=/etc/inputrc > KDE_IS_PRELINKED=1 > LANG=en_US.UTF-8 > PS1=\W > SQLPATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/sqlplus > SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass > HOME=/var/lib/hudson > SHLVL=3 > LOGNAME=hudson > LESSOPEN=|/usr/bin/lesspipe.sh %s > ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client > G_BROKEN_FILENAMES=1 > _=/bin/env > > ...I don't see anything there that should cause a problem. > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Anthony T. <ant...@gm...> - 2008-08-14 13:27:26
|
Hi, This would be due to a mismatch between the Oracle client you have installed and the Oracle client that cx_Oracle is expecting. Could you let us know what version of the Oracle client you have installed and what version of cx_Oracle you downloaded and installed? You need to make sure that the Oracle versions match. Please note that Oracle 10g means Oracle 10g Release 2 and that you can always use a lower level version -- Oracle 9i version of cx_Oracle with Oracle 10g client, for example. Anthony On Wed, Aug 13, 2008 at 8:49 PM, David Wilson <dav...@gm...> wrote: > Hi. > > I'm hoping for some install help, but I have to start by admitting that I'm > completely new to Oracle and could very well not have the Oracle client set > up correctly. > > I have Oracle's SQL Developer loaded and can access the database tables I am > interested in. > > I have searched extensively with Google and can't come up with the next > trouble shooting step. I can't tell if it is an Oracle client problem or a > cx_Oracle problem or both. > > Here's a bunch of info. > > Thanks in advance, > Dave > > ===================================== > import cx_Oracle > > dsn_tns = cx_Oracle.makedsn('ISTRND', 1521, 'ISTRND') > db2 = cx_Oracle.connect('laqlu', 'pwd', dsn_tns) > print dsn_tns > print db2 > db2.close() > > ====================================== > > (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ISTRND)(PORT=1521)))(CONNECT_DATA=(SID=ISTRND))) > Traceback (most recent call last): > File > "C:\Local\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", > line 310, in RunScript > exec codeObject in __main__.__dict__ > File "C:\Local\Python25\Lib\site-packages\SummitTrend\oracle.py", line 6, > in <module> > db2 = cx_Oracle.connect('laqlu', 'pwd', dsn_tns) > InterfaceError: Unable to acquire Oracle environment handle > > ====C:\oracle\ora9\network\ADMIN\TNSNames.ora================ > > > > ISTRND = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) > (HOST = ISTRND) (Port = 1521))) > (CONNECT_DATA = (SID = ISTRND)(SERVER=DEDICATED))) > > ===================================================== > >>>> Running tests for cx_Oracle version 4.4 > > Running tests in Connection.py > connection to database with user, password, TNS separate ... ERROR > connection to database with bad connect string ... ERROR > connection to database with bad password ... ERROR > confirm an exception is raised after closing a connection ... ERROR > test making a data source name from host, port and sid ... ok > connection rolls back before close ... ERROR > connection rolls back before destruction ... ERROR > connection to database with user, password, TNS together ... ERROR > connection to database with multiple threads ... Exception in thread > Thread-11: > Traceback (most recent call last): > File "C:\Local\Python25\lib\threading.py", line 460, in __bootstrap > self.run() > File "C:\Local\Python25\lib\threading.py", line 440, in run > self.__target(*self.__args, **self.__kwargs) > File "Connection.py", line 10, in __ConnectAndDrop > self.tnsentry, threaded = True) > InterfaceError: Unable to acquire Oracle environment handle > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: David W. <dav...@gm...> - 2008-08-16 15:57:51
|
Hi all, I still get the error. I did find I had two OCI.DLL's. I renamed the one in the 8 to TEMP. I took the Oracle 8 out of my path. I restarted my computer. I removed and reinstalled cx_Oracle. I changed my clothes and gave the dog a bath. Thanks to Anthony for a first shot, any other ideas? Dave Here's the remaining file and it's details. C:\oracle\ora9\bin\oci.dll (that dir is also my ORACLE_HOME) Modified: Wednesday, May 01, 2002, 7:40:34 PM 112 KB (114,688 bytes) > > Python 2.5.1 > cx_Oracle-4.4-9i.win32-py2.5.msi > Here's my path: C:\oracle\ora9\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\Program Files\Oracle\jre\1.1.7\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\PROGRA~1\CA\SHARED~1\SCANEN~1;C:\Program Files\CA\SharedComponents\ScanEngine;C:\Program Files\CA\SharedComponents\CAUpdate\;C:\Program Files\CA\SharedComponents\ThirdParty\;C:\Program Files\CA\SharedComponents\SubscriptionLicense\;C:\PROGRA~1\CA\ETRUST~2;c:\program files\borland\StarTeam SDK 2005 R2\Lib;c:\program files\borland\StarTeam SDK 2005 R2\Bin;C:\Program Files\Common Files\Trane Shared\Registration;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Local\Program Files\Bazaar;C:\Program Files\Borland\CaliberRM SDK 2005 R2\lib;C:\Local\Python25;C:\Local\Python25\Scripts; ---------- Forwarded message ---------- From: Anthony Tuininga <ant...@gm...> Date: Aug 14, 2008 2:15 PM Subject: Re: [cx-oracle-users] InterfaceError: Unable to acquire Oracle environment handle To: David Wilson <dav...@gm...> Hi Dave, Do you know how to run SQL*Plus? It should tell you what version of Oracle client you have installed. The other possibility is that you have more than one Oracle client installed. Do a search for oci.dll on your machine and note where it is installed. If you have more than one location, remove from your PATH the one you don't want. Anthony On Thu, Aug 14, 2008 at 12:52 PM, David Wilson <dav...@gm...> wrote: > Hi Anthony, > > Thanks for responding. I'm replying off list since I'm not sure how to > identify for sure my Oracle client rev. I use Oracle SQL Developer so I'm > abstracted from the client. There is a lot of "stuff" in C:\oracle\ora9, so > I assume it's 9, but I'm not sure. > > Dave > > Python 2.5.1 > cx_Oracle-4.4-9i.win32-py2.5.msi > > > On 8/14/08, Anthony Tuininga <ant...@gm...> wrote: >> >> Hi, >> >> This would be due to a mismatch between the Oracle client you have >> installed and the Oracle client that cx_Oracle is expecting. Could you >> let us know what version of the Oracle client you have installed and >> what version of cx_Oracle you downloaded and installed? You need to >> make sure that the Oracle versions match. Please note that Oracle 10g >> means Oracle 10g Release 2 and that you can always use a lower level >> version -- Oracle 9i version of cx_Oracle with Oracle 10g client, for >> example. >> >> Anthony >> >> On Wed, Aug 13, 2008 at 8:49 PM, David Wilson >> <dav...@gm...> wrote: >> > Hi. >> > >> > I'm hoping for some install help, but I have to start by admitting that >> > I'm >> > completely new to Oracle and could very well not have the Oracle client >> > set >> > up correctly. >> > >> > I have Oracle's SQL Developer loaded and can access the database tables >> > I am >> > interested in. >> > >> > I have searched extensively with Google and can't come up with the next >> > trouble shooting step. I can't tell if it is an Oracle client problem >> > or a >> > cx_Oracle problem or both. >> > >> > Here's a bunch of info. >> > >> > Thanks in advance, >> > Dave >> > >> > ===================================== >> > import cx_Oracle >> > >> > dsn_tns = cx_Oracle.makedsn('ISTRND', 1521, 'ISTRND') >> > db2 = cx_Oracle.connect('laqlu', 'pwd', dsn_tns) >> > print dsn_tns >> > print db2 >> > db2.close() >> > >> > ====================================== >> > >> > >> > (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ISTRND)(PORT=1521)))(CONNECT_DATA=(SID=ISTRND))) >> > Traceback (most recent call last): >> > File >> > >> > "C:\Local\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", >> > line 310, in RunScript >> > exec codeObject in __main__.__dict__ >> > File "C:\Local\Python25\Lib\site-packages\SummitTrend\oracle.py", line >> > 6, >> > in <module> >> > db2 = cx_Oracle.connect('laqlu', 'pwd', dsn_tns) >> > InterfaceError: Unable to acquire Oracle environment handle >> > >> > ====C:\oracle\ora9\network\ADMIN\TNSNames.ora================ >> > >> > >> > >> > ISTRND = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) >> > (HOST = ISTRND) (Port = 1521))) >> > (CONNECT_DATA = (SID = ISTRND)(SERVER=DEDICATED))) >> > >> > ===================================================== >> > >> >>>> Running tests for cx_Oracle version 4.4 >> > >> > Running tests in Connection.py >> > connection to database with user, password, TNS separate ... ERROR >> > connection to database with bad connect string ... ERROR >> > connection to database with bad password ... ERROR >> > confirm an exception is raised after closing a connection ... ERROR >> > test making a data source name from host, port and sid ... ok >> > connection rolls back before close ... ERROR >> > connection rolls back before destruction ... ERROR >> > connection to database with user, password, TNS together ... ERROR >> > connection to database with multiple threads ... Exception in thread >> > Thread-11: >> > Traceback (most recent call last): >> > File "C:\Local\Python25\lib\threading.py", line 460, in __bootstrap >> > self.run() >> > File "C:\Local\Python25\lib\threading.py", line 440, in run >> > self.__target(*self.__args, **self.__kwargs) >> > File "Connection.py", line 10, in __ConnectAndDrop >> > self.tnsentry, threaded = True) >> > InterfaceError: Unable to acquire Oracle environment handle >> > >> > >> > >> > >> > ------------------------------------------------------------------------- >> > This SF.Net email is sponsored by the Moblin Your Move Developer's >> > challenge >> > Build the coolest Linux based applications with Moblin SDK & win great >> > prizes >> > Grand prize is a trip for two to an Open Source event anywhere in the >> > world >> > http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> > _______________________________________________ >> > cx-oracle-users mailing list >> > cx-...@li... >> > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> > >> > >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: David W. <dav...@gm...> - 2008-08-16 20:41:35
|
I fixed it. I needed to set ORACLE_HOME and ORACLE_BASE to C:\oracle\ora9 and C:\oracle respectively. Dave On 8/13/08, David Wilson <dav...@gm...> wrote: > > Hi. > > I'm hoping for some install help, but I have to start by admitting that I'm > completely new to Oracle and could very well not have the Oracle client set > up correctly. > > I have Oracle's SQL Developer loaded and can access the database tables I > am interested in. > > I have searched extensively with Google and can't come up with the next > trouble shooting step. I can't tell if it is an Oracle client problem or a > cx_Oracle problem or both. > > Here's a bunch of info. > > Thanks in advance, > Dave > > ===================================== > import cx_Oracle > > dsn_tns = cx_Oracle.makedsn('ISTRND', 1521, 'ISTRND') > db2 = cx_Oracle.connect('laqlu', 'pwd', dsn_tns) > print dsn_tns > print db2 > db2.close() > > ====================================== > > > (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ISTRND)(PORT=1521)))(CONNECT_DATA=(SID=ISTRND))) > Traceback (most recent call last): > File > "C:\Local\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", > line 310, in RunScript > exec codeObject in __main__.__dict__ > File "C:\Local\Python25\Lib\site-packages\SummitTrend\oracle.py", line 6, > in <module> > db2 = cx_Oracle.connect('laqlu', 'pwd', dsn_tns) > InterfaceError: Unable to acquire Oracle environment handle > > ====C:\oracle\ora9\network\ADMIN\TNSNames.ora================ > > > > ISTRND = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) > (HOST = ISTRND) (Port = 1521))) > (CONNECT_DATA = (SID = ISTRND)(SERVER=DEDICATED))) > > ===================================================== > > >>> Running tests for cx_Oracle version 4.4 > > Running tests in Connection.py > connection to database with user, password, TNS separate ... ERROR > connection to database with bad connect string ... ERROR > connection to database with bad password ... ERROR > confirm an exception is raised after closing a connection ... ERROR > test making a data source name from host, port and sid ... ok > connection rolls back before close ... ERROR > connection rolls back before destruction ... ERROR > connection to database with user, password, TNS together ... ERROR > connection to database with multiple threads ... Exception in thread > Thread-11: > Traceback (most recent call last): > File "C:\Local\Python25\lib\threading.py", line 460, in __bootstrap > self.run() > File "C:\Local\Python25\lib\threading.py", line 440, in run > self.__target(*self.__args, **self.__kwargs) > File "Connection.py", line 10, in __ConnectAndDrop > self.tnsentry, threaded = True) > InterfaceError: Unable to acquire Oracle environment handle > > > |