title: Unabe to resolve cx_Oracle.DatabaseError: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
body: <p>I am trying to access an oracle database on another machine. I am using:</p>
  
  <ul>
  <li>Ubuntu Server 18.04</li>
  <li>oracle client 12.2</li>
  <li>python 3.6 and cx_oracle 6.4.1</li>
  </ul>
  
  <p>I constanly get this error:</p>
  
  <h3>Error</h3>
  
  <pre><code>File "basic_test.py", line 5, in &lt;module&gt;
      con =  cx_Oracle.connect('jalabe','jalabepass', cx_Oracle.makedsn('ipserver','port',None,'prod'))
  cx_Oracle.DatabaseError: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
  </code></pre>
  
  <h3>basic_tst.py</h3>
  
  <pre><code>import cx_Oracle
  # first attempt
  # con =  cx_Oracle.connect('jalabe/jalabepass@ipaddress/prod')
  
  # second attempt 
  con =  cx_Oracle.connect('jalabe','jalabepass', cx_Oracle.makedsn('ipaddress','port',None,'prod'))
  print(con.version)
  con.close()
  </code></pre>
  
  <h3>tnsnames.ora</h3>
  
  <pre><code>DATABASE.WORLD =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ipaddress)(PORT = port))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = prod)
      )
    )
  </code></pre>
  
  <h3>Other info</h3>
  
  <ul>
  <li><code>$ORACLE_HOME</code> as <code>/usr/lib/oracle/12.1/client64/lib/</code></li>
  <li>File <code>tnsnames.ora</code> is inside <code>/usr/lib/oracle/12.1/client64/network/admin</code></li>
  </ul>
  
  <p>I have read many post without any luck. From all of the post I have read these are the ones I think are more usefull although they haven't work </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/10786782/ora-12514-tnslistener-does-not-currently-know-of-service-requested-in-connect-d">ORA-12514 TNS:listener does not currently know of service requested in connect descriptor</a></li>
  <li><a href="https://dba.stackexchange.com/questions/122800/lsnrctl-is-not-working-on-ubuntu-14-04">https://stackoverflow.com/questions/46914943/can-not-connect-ora-12514-tnslistener-does-not-currently-know-of-service-reque</a></li>
  </ul>
  
  <p>I am sure it might be some character somewhere. </p>
  
  <p>I don't have sqlplus installed nor tnslistener. (Could it be the cause?) (I have read that  <code>tnslistener</code> should be in the oracle server which is why i haven't installed it)</p>