加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

liunx Ubuntu安装cx_Oracle模块

发布时间:2020-12-13 17:55:02 所属栏目:Linux 来源:网络整理
导读:liunx Ubuntu安装cx_Oracle模块步骤方法: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html下载oracle的精简版客户端 oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_6

liunx Ubuntu安装cx_Oracle模块步骤方法:

  1. http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html下载oracle的精简版客户端

    oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm

    oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm

    oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm

  2. 把下载的两个文件上传到liunx上,并解压到同一个目录,我的目录叫做cx-oracle,执行下面的命令

    alien?-i?oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
    alien?-i?oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
    alien?-i?oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm

    注意:

  3. ????????如果alien,请执行语句:sudo apt-get install alien

  4. 测试连接

    sqlplus?username/password@//dbhost:1521/SID????????????#?32位liunx操作系统
    sqlplus64?username/password@//dbhost:1521/SID??????????#?64为liunx操作系统

    连接成功如图所示:

    2.png


    注意:

    ? ? ? 如果提示错误为:

    ? ? ? sqlplus: command not found

    ??????sqlplus64: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

    sudo?apt-get?install?libaio1?????????????#?
    sudo?apt-get?install?libaio1:i386????????#?如果您在64位上安装32位客户端

    如果按照还是不可以,建议你从第一步开始重新安装一次就可以。


  5. 这个时候可以pip install cx_Oracle

    本教程只支持cx-Oracle==5.2.1版本,其他版本没有错尝试,可能会报错

  6. import cx_Oracle成功


参考文章:

https://help.ubuntu.com/community/Oracle%20Instant%20Client

http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读