zoukankan      html  css  js  c++  java
  • (cx_Oracle.DatabaseError) DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so: cannot open shared object file: No such file or directory"

    打开https://oracle.github.io/odpi/doc/installation.html

    官方相关如下

    Oracle Instant Client RPM

    To run ODPI-C applications with Oracle Instant Client RPMs:

    1. Download an Oracle 11.2, 12.1 or 12.2 “Basic” or “Basic Light” RPM: 64-bit or 32-bit, matching your application architecture.

    2. Install the downloaded RPM with sudo or as the root user. For example:

      sudo yum install oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
      

      Yum will automatically install required dependencies, such as libaio.

    3. If there is no other Oracle software on the machine that will be impacted, permanently add Instant Client to the runtime link path. For example, with sudo or as the root user:

      sudo sh -c "echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf"
      sudo ldconfig
      

      Alternatively, set the environment variable LD_LIBRARY_PATH to the appropriate directory for the Instant Client version. For example:

      export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib:$LD_LIBRARY_PATH
      
    4. If you intend to co-locate optional Oracle configuration files such as tnsnames.orasqlnet.ora or oraaccess.xml with Instant Client, then create a network/admin subdirectory under lib/. For example:

      sudo mkdir -p /usr/lib/oracle/12.2/client64/lib/network/admin
      

      This is the default Oracle configuration directory for applications linked with this Instant Client.

      Alternatively, Oracle configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMIN to that directory name.

    下载64位的rpm包(basic,sqlplus,devel)

    http://download.oracle.com/otn/linux/instantclient/183000/oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm

    http://download.oracle.com/otn/linux/instantclient/183000/oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.x86_64.rpm

    http://download.oracle.com/otn/linux/instantclient/183000/oracle-instantclient18.3-devel-18.3.0.0.0-1.x86_64.rpm

    安装

    [root@VM_176_134_centos ~]# rpm -ivh oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm
    Preparing... ################################# [100%]
    Updating / installing...
    1:oracle-instantclient18.3-basic-18################################# [100%]
    [root@VM_176_134_centos ~]# rpm -ivh oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.x86_64.rpm
    Preparing... ################################# [100%]
    Updating / installing...
    1:oracle-instantclient18.3-sqlplus-################################# [100%]
    [root@VM_176_134_centos ~]# rpm -ivh oracle-instantclient18.3-devel-18.3.0.0.0-1.x86_64.rpm
    Preparing... ################################# [100%]
    Updating / installing...
    1:oracle-instantclient18.3-devel-18################################# [100%]

    建立连接

    [root@VM_176_134_centos ~]# sudo sh -c "echo /usr/lib/oracle/18.3/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf"
    [root@VM_176_134_centos ~]# sudo ldconfig
    [root@VM_176_134_centos ~]# export LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client64/lib:$LD_LIBRARY_PATH

  • 相关阅读:
    关于报错”已有打开的于此Command相关联的DataReader,必须首先将它关闭。“的问题
    Dockerjenkins环境搭建跟配置
    Python+selenium 【第十章】封装config类,读取配置文件,封装驱动类,适配windows/mac
    —— “欢迎来到我的小屋”
    Python+selenium 【第九章】封装excel类,封装test_data类 读取测试元素信息
    Linux搭建docker
    Python+selenium 【第十二章】封装日志类优化其他方法并添加日志(异常处理)
    【selenium】Python自动化面试题
    Dockerjenkins容器安装python并配置环境变量
    【优化框架】新增期望结果,断言为mysql情况下动态化参数替换
  • 原文地址:https://www.cnblogs.com/lurenjia1994/p/9640752.html
Copyright © 2011-2022 走看看