Link to home
Start Free TrialLog in
Avatar of xoxomos
xoxomos

asked on

Python Connection To Oracle

Trying to follow one of those OBE's that demonstrates Oracle database and Python.
http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/217539.htm
I get to step 13:
13 .
Next, synchronize the database:
cd $HOME/mysite
python manage.py syncdb

The base.py module should return a database connection but returns an ORA-12170 TNS:connect timeout occured.
There is another OBE demonstrating similar from OOW:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/oow10/python_db/python_db.htm
that connects and completes the return as expected.
Python 2.7 is running on OSX machine and Oracle 11.2.2 is running on windows 7 machine.
Any ideas about what the difference in between the two demos such that one is successful and the other is not?
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>ORA-12170 TNS:connect timeout occured.

99.999% of the time this is a firewall/network blocking the connection to the database.

I know nothing about Python but I have an educated guess why one works and the other doesn't.

The one that fails seems to be doing a TNS connection using entries in the tnsnames.ora file.  The one that works bypasses that and in the text states "Oracle's Easy Connect connection string".

If this code is running on the database server, it might be doing a direct/bequeth connection and will bypass the firewall.
Avatar of xoxomos

ASKER

It is not running on the database server, but i suspect such a case was assumed  for purposes of this particular example.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What was the solution?

I'm curious and it might help others in the future.
Avatar of xoxomos

ASKER

Those points were basically for the 'educated guess' on why one demo worked and the other did not. Thankfully you responded to what was in the question as originally stated before i edited that part out.  I'm going to try isolating the parts of Python code i believe most related to the connection and google around a bit and possibly post and aske another question.   Will posting here once i get the non-working example working.
Thanks again.