search

Home  >  Q&A  >  body text

Python connects to Oracle and reports an error TNS. The listener is currently unable to recognize the service requested in the connection descriptor.

import cx_Oracle
conn = cx_Oracle.connect('gxb2b/OpG�cP@10.182.22.34:2700/gx36')
print (conn.version)

The cx_Oracle module has been installed, but an error occurs when running sublime. Any ideas or solutions

世界只因有你世界只因有你2777 days ago853

reply all(3)I'll reply

  • 阿神

    阿神2017-05-18 10:53:16

    Can Oracle be connected through other clients? If a TNS monitoring error occurs, it is most likely a problem with the Oracle server. Also, is the Oracle Sid written correctly in your connection? Both of these are possible

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-18 10:53:16

    It can be connected. The reason is that the library name used to connect to the library is the name used for plsql connection when I connect, which is obviously wrong. . .
    Thank you for your answer

    reply
    0
  • 阿神

    阿神2017-05-18 10:53:16

    There are two possibilities. The first is that the TNS file is not configured on the server side. The second possibility is that the port the server is listening to is not 2700.

    reply
    0
  • Cancelreply