How do I access an Oracle db without installing Oracle's client and cx_Oracle?

前端 未结 3 1573
离开以前
离开以前 2021-02-19 06:19

I have two RHEL servers running Python 2.4 and 2.6 separately. There is an Oracle database on the other server I need to access.

I was trying to install cx_oracle on my

相关标签:
3条回答
  • 2021-02-19 06:55

    Usually, all you need are the libraries, which don't necessarily require sudo rights. Extract them to a place the software will be able to read from and set the following environment variables accordingly:

    ORACLE_HOME=path/to/where/you/extracted/libs
    TNS_ADMIN=path/to/tnsnames.ora
    

    I have had best luck skipping tnsnames, and just specifying the host, port, etc in the connection, but it's quite possible you'll need it for cx_oracle...I don't remember from when I used it ages ago.

    0 讨论(0)
  • 2021-02-19 06:59

    An excerpt from https://forum.omz-software.com/topic/184/oracle-database:

    There's no pure python client for Oracle and likely never will be. Even wonderful third-party toolsets like SQLalchemy still rely on cx_Oracle underneath to do the actual communication to the Oracle database servers.

    —also, deciding by Google, the answer is no: there do not seem to be any pure Python Oracle clients in existence as of today.

    0 讨论(0)
  • 2021-02-19 07:06

    if you don't want use cx_Oracle you should use expect scripting. ( for python pexpect). But you need to be carefully for handle all expectations.

    0 讨论(0)
提交回复
热议问题