problem connecting to oracle database

Discussion in 'Python' started by markusjais@yahoo.de, Mar 5, 2004.

  1. Guest

    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
     
    , Mar 5, 2004
    #1
    1. Advertising

  2. wes weston Guest

    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
     
    wes weston, Mar 5, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Juha Laiho
    Replies:
    0
    Views:
    563
    Juha Laiho
    Jul 30, 2003
  2. David Rudder
    Replies:
    0
    Views:
    421
    David Rudder
    Jul 30, 2003
  3. akki
    Replies:
    0
    Views:
    537
  4. Jaime Stuardo

    Problem connecting to Oracle database

    Jaime Stuardo, Oct 19, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    205
    Jaime Stuardo
    Oct 19, 2005
  5. Feyruz
    Replies:
    4
    Views:
    2,332
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page