Oracle beginner problem: can't connect to Oracle using cx_Ora cle

Pieter Claerhout Pieter.Claerhout at
Wed Jan 28 14:13:11 CET 2004

This google search will give you lot's of clues.



pieter claerhout | product support prinergy | tel: +32 2 352 2511 |
pieter.claerhout at |


-----Original Message-----
From: Aurelio Martin [mailto:amartin at] 
Sent: 28 January 2004 13:55
To: python-list at
Subject: Re: Oracle beginner problem: can't connect to Oracle using

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 - Production 
> With the Partitioning option                               
> JServer Release - 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 (mhammond at -
> see 'Help/About PythonWin' for further copyright information.
>>>>import cx_Oracle
>>>>connection = cx_Oracle.connect("myuser/mypassword at 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 at 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



More information about the Python-list mailing list