0

I am using cx_oracle to connect the Oracle DB using python.I need your assistance in connecting DB. I'm using following code till date it worked well

Code-1:

import cx_Oracle as cx
dsn_tns = cx.makedsn(HOST,PORT, service_name=SERVICE_NAME)
conn = cx.connect(user=USER, password=PW, dsn=dsn_tns)

Recently TCP port is disabled and we are using jdbc connection string to connect DB which has TCPS port number.can you help where I need to pass the protocol in above/ suggest any other method.

i tried following code

code-2:

dsn_tns='(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcps)(HOST =hostdetails)(PORT =port))) (CONNECT_DATA = (SERVICE_NAME = servicename)))'
conn = cx.connect(user=USER, password=PW, dsn=dsn_tns)
print(cx.version)

I got error: ORA-28759: failure to open file.

Any suggestion is appreciated. Thank you in advance.

1
  • can you any one idea on this cx_Oracle.SUBSCR_PROTO_OCI Commented Apr 28, 2020 at 13:47

1 Answer 1

1

Does your sqlnet.ora have a WALLET_LOCATION defined?

Source.

Sign up to request clarification or add additional context in comments.

3 Comments

I am able to connect the DB in SQl developer with connection string but not able to connect it using cx_oracle(python).
can you give me some inputs regarding WALLET_LOCATION?
See the documentation link I provided.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.