problem connecting to oracle database

M

markusjais

hello

I hava a small Perl and a small Python CGI Skript.

I have Python 2.3.3 and the newest cx_Oracle module.

this is the error in my httpd_error.log

RuntimeError: Unable to acquire Oracle environment handle

at the start of the skript I set
os.environ["ORACLE_HOME"] = "/opt/oracle/OraHome1/"

this is the same as in the Perl skript and there it works.


this is the code how I connect:
try:
connection = cx_Oracle.connect(user, passwd, "host.of.db.server")
cursor = connection.cursor()
except cx_Oracle.Error, e:
print "Error %s" % e
sys.exit (1)



the host of the db server is correct and a test skript on another machine
with another db worked, too.

any ideas what is wrong here ?


markus
 
W

wes weston

hello

I hava a small Perl and a small Python CGI Skript.

I have Python 2.3.3 and the newest cx_Oracle module.

this is the error in my httpd_error.log

RuntimeError: Unable to acquire Oracle environment handle

at the start of the skript I set
os.environ["ORACLE_HOME"] = "/opt/oracle/OraHome1/"

this is the same as in the Perl skript and there it works.


this is the code how I connect:
try:
connection = cx_Oracle.connect(user, passwd, "host.of.db.server")
cursor = connection.cursor()
except cx_Oracle.Error, e:
print "Error %s" % e
sys.exit (1)



the host of the db server is correct and a test skript on another machine
with another db worked, too.

any ideas what is wrong here ?


markus
markus,
Does it work if you set and export in linux
prior to running the script?
Do you need the trailing "/" on the path?
wes
 

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

Members online

No members online now.

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top