problem connecting to oracle database
wes weston
wweston at att.net
Fri Mar 5 12:46:29 EST 2004
markusjais at yahoo.de wrote:
> 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
More information about the Python-list
mailing list