Oracle Access via cx_Oracle

G

Greg Lindstrom

Hello
-
I am trying to connect to an Oracle database on an HP-9000 via Python 2.3
and cx_Oracle. I have set the following in my python routine:

os.putenv('ORACLE_HOME', '/u01/app/oracle')
os.putenv('ORA_NLS',
'/u01/app/oracle/product/9.2.0/ocommon/nls/admin/data')
os.putenv('ORACLE_TERM', 'xterm')
os.putenv('ORACLE_SID', 'test1')
os.putenv('ORACLE_DOC', '/u01/app/oracle/product/9.2.0/doc')

and then
myIP = "ww.xx.yy.zzz"
myPort = nnnn
myDsn = cx_Oracle.makedsn(myIP, myPort, 'test1')
print partition
oracle = cx_Oracle.connect(myUid, myPwd, myDsn)

but am told

File "g.py", line 16, in ?
oracle = cx_Oracle.connect(myIP, myPwd, 'test1')
RuntimeError: Unable to acquire Oracle environment handle

can you see what I've done wrong?

Thanks for your help,
--greg



Greg Lindstrom (501) 975-4859
NovaSys Health (e-mail address removed)

"We are the music makers, and we are the dreamers of dreams" W.W.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
This email and any attachments to it are privileged and confidential and are
intended solely for use of the individual or entity to which they are
addressed. If the reader of this message is not the intended recipient, any
use, distribution, or copying of this communication, or disclosure of all or
any part of its content to any other person, is strictly prohibited. If you
have received this communication in error, please notify the sender by
replying to this message and destroy this message and delete any copies held
in your electronic files. Thank you.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
 
P

Paul Moore

Greg Lindstrom said:
Hello
-
I am trying to connect to an Oracle database on an HP-9000 via Python 2.3
and cx_Oracle. I have set the following in my python routine:

os.putenv('ORACLE_HOME', '/u01/app/oracle')

Shouldn't this be '/u01/app/oracle/product/9.2.0' ? Based on the
following values, that's what I'd expect.

But anyway, I'd normally have these set in my environment rather than
using putenv. Does SQL*Plus work to get at the database?

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Oracle Access via cx_Oracle 1
Oracle Access via cx_Oracle 1
Oracle Access via cx_Oracle 0
Access to Oracle 4
Building Very Large Records 2
using re.finditer() 0
db access and base classes 0
EDI Tools 0

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top