- datahub 命令行采集oracle 报错如下:
- datahub ingest -c oracle.yml
sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) DPI-1047:
Cannot locate a 64-bit Oracle Client library: "libclntsh.so:
cannot open shared object file: No such file or directory".
- 根据报错信息可以看出缺少oracle客户端
- 解决方法
- 安装oracle 客户端
-
Oracle客户RPM文件下载地址
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html https://www.oracle.com/database/technologies/instant-client/linux-x86-32-downloads.html oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
-
将下载好的rpm包上传到centos 服务器上
-
安装和配置步骤如下:
rpm -ivh oracle-instantclient11.2- basic-11.2.0.4.0-1.x86_64.rpm rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm vi ~/.bash_profile #新增如下配置 export ORACLE_VERSION=11.2 export ORACLE_HOME=/usr/lib/oracle/$ORACLE_VERSION/client64 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export TNS_ADMIN=$ORACLE_HOME/network/admin export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 export PATH=$PATH:$ORACLE_HOME/bin # 配置生效 source ~/.bash_profile
-
- 配置 ld.so.conf
修改/etc/ld.so.conf
vi /etc/ld.so.conf;
--------------------------------------
# 末尾追加 设置为你安装oracle版本的驱动路径
/usr/lib/oracle/11.2/client64
# 配置生效
ldconfig;
- 如果oracle客户端已安装,可以直接进行第3步的配置即可解决问题。