Oracle beginner problem: can't connect to Oracle using cx_Oracle

Discussion in 'Python' started by Benson, John, Jan 28, 2004.

  1. Benson, John

    Benson, John Guest

    Hi, I'm a non-Oracle guy just starting to use Python to explore Oracle.
    I enclose the Python command prompt log for the usage example further
    down with only the user, password and host names changed to keep me out
    of trouble. But first, I'd like to point out that I'm able to logon to
    myhost, and get into the following via SQL*Plus using myuser/mypassword

    Oracle8i Enterprise Edition Release 8.1.7.3.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.3.0 - Production

    (end quote of Unix box SQL*Plus stuff)

    so I know that myuser/mypassword works for SQL*Plus on the myhost Unix
    box.

    I downloaded the cx_Oracle Python interface to Oracle(r) Version: 4.0
    Date: December 17, 2003 Win32 binary for Oracle 8i, Python 2.) and
    proceeded to exercise the usage example:

    PythonWin 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)]
    on win32.
    Portions Copyright 1994-2001 Mark Hammond () -
    see 'Help/About PythonWin' for further copyright information.
    >>> import cx_Oracle
    >>> connection = cx_Oracle.connect("myuser/mypassword@myhost")

    Traceback (most recent call last):
    File "<interactive input>", line 1, in ?
    DatabaseError: ORA-12514: TNS:listener could not resolve SERVICE_NAME
    given in connect descriptor

    >>>


    (end usage example quote)

    Any ideas as to what the problem is?

    Thanks in advance for the usual valuable and pertinent advice I have
    come to expect from this forum.

    John Benson
     
    Benson, John, Jan 28, 2004
    #1
    1. Advertising

  2. Benson, John wrote:
    > Hi, I'm a non-Oracle guy just starting to use Python to explore Oracle.
    > I enclose the Python command prompt log for the usage example further
    > down with only the user, password and host names changed to keep me out
    > of trouble. But first, I'd like to point out that I'm able to logon to
    > myhost, and get into the following via SQL*Plus using myuser/mypassword
    >
    > Oracle8i Enterprise Edition Release 8.1.7.3.0 - Production
    > With the Partitioning option
    > JServer Release 8.1.7.3.0 - Production
    >
    > (end quote of Unix box SQL*Plus stuff)
    >
    > so I know that myuser/mypassword works for SQL*Plus on the myhost Unix
    > box.
    >
    > I downloaded the cx_Oracle Python interface to Oracle(r) Version: 4.0
    > Date: December 17, 2003 Win32 binary for Oracle 8i, Python 2.) and
    > proceeded to exercise the usage example:
    >
    > PythonWin 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)]
    > on win32.
    > Portions Copyright 1994-2001 Mark Hammond () -
    > see 'Help/About PythonWin' for further copyright information.
    >
    >>>>import cx_Oracle
    >>>>connection = cx_Oracle.connect("myuser/mypassword@myhost")

    >
    > Traceback (most recent call last):
    > File "<interactive input>", line 1, in ?
    > DatabaseError: ORA-12514: TNS:listener could not resolve SERVICE_NAME
    > given in connect descriptor
    >


    I think it's a problem with the connection data in your Windows PC.
    You have tested a local connection ( user/password ) on the Unix host
    with SQL*Plus.
    Have you tried a remote connection ( user/password@host ) from your
    Windows PC with SQL*Plus ?
    I think you will find the same problem if you try it with SQL*Plus.

    Probably the connection data in your TNSNAMES.ORA file is not correct.

    Hope this helps

    Aurelio
     
    Aurelio Martin, Jan 28, 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. Otis Mukinfus
    Replies:
    3
    Views:
    937
    Juan T. Llibre
    Jul 8, 2005
  2. Pieter Claerhout
    Replies:
    0
    Views:
    617
    Pieter Claerhout
    Jan 28, 2004
  3. Greg Lindstrom

    Oracle Access via cx_Oracle

    Greg Lindstrom, Sep 28, 2004, in forum: Python
    Replies:
    1
    Views:
    548
    Paul Moore
    Sep 28, 2004
  4. Greg Lindstrom

    Oracle Access via cx_Oracle

    Greg Lindstrom, Sep 28, 2004, in forum: Python
    Replies:
    1
    Views:
    302
    Mathias Waack
    Sep 28, 2004
  5. Feyruz
    Replies:
    4
    Views:
    2,252
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page