Forum Stats

  • 3,770,464 Users
  • 2,253,118 Discussions
  • 7,875,466 Comments

Discussions

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

d802bc6e-891d-4baf-9dca-52cd82c128a2
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.

TNS_LSNR =

(DESCRIPTION =

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

  )

(CONNECT_DATA =

  (SERVICE_NAME= SRVC_NAME)

  )

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 12.1.0.2.0 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 12.1.0.2.0 - 64bit Production

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

Advanced Analytics, Real Application Testing and Unified Auditing options

SQL>

>>> 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

Tagged:
This discussion has been closed.