Forum Stats

  • 3,770,464 Users
  • 2,253,118 Discussions


cx_Oracle.DatabaseError: ORA-12560: TNS:protocol adapter error

edited Mar 28, 2017 6:45AM in Python

Recently there was change in the Database connection as they changed the connection type over SSL.

The connection protocol has been changed from TCP to TCPS and the port no has been updated as well.

have made the required changes in TNSNAMES.ora file my local machine.



(ADDRESS = (PROTOCOL = TCPS)(HOST = hostname)(PORT = port)





After the change i can connect to database from SQLPLUS command line and Developer app without any issues.

But my cx_Oracle module has issues connecting to the database, did check in many forums and blogs and stack overflow, but there is no answer for the same.

Hoping that the issue can be sorted here.

Connection logs:

$ sqlplus username/[email protected]_LSNR

SQL*Plus: Release Production on Tue Mar 28 16:07:13 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Tue Mar 28 2017 15:45:01 +05:30

Connected to:

Oracle Database 12c Enterprise Edition Release - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics, Real Application Testing and Unified Auditing options


>>> cx.connect('username','password','TNS_LSNR')

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

cx_Oracle.DatabaseError: ORA-12560: TNS:protocol adapter error

System information:

Oracle 12c

Protocol: TCPS

Instant client Version: 12_1

Local system type: MAC

cx_Oracle Version : 5.3

This discussion has been closed.