title: cx_Oracle & Connecting to Oracle DB Remotely
body: <p>How do you connect to a remote server via IP address in the manner that TOAD, SqlDeveloper, are able to connect to databases with just the ip address, username, SID and password?</p>
  
  <p>Whenever I try to specify and IP address, it seems to be taking it locally.</p>
  
  <p>In other words, how should the string for cx_Oracle.connect() be formatted to a non local database?</p>
  
  <p>There was a previous post which listed as an answer connecting to Oracle via cx_Oracle module with the following code:</p>
  
  <pre><code>#!/usr/bin/python
  
  import cx_Oracle
  connstr='scott/tiger'
  conn = cx_Oracle.connect(connstr)
  curs = conn.cursor()
  
  curs.execute('select * from emp')
  print curs.description
  for row in curs:
      print row
  conn.close()
  </code></pre>