注册

dm8通过DBLINK访问oracle数据库失败

King_harry 2024/09/12 665 8

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:DMV8
【操作系统】:kylinV10
【CPU】:intel
【问题描述】:dm8通过dblink访问oracle11.2.0.4 失败,提示DBLINK加载库文件失败。

详细过程:
oracle client版本:Instant Client instantclient_19_24

--上传安装包到服务器,然后创建目录并解压
[root@localhost ~]# mkdir -p /oracle
[root@localhost ~]# unzip instantclient-basic-linux.x64-19.24.0.0.0dbru.zip -d /oracle
[root@localhost ~]# unzip instantclient-odbc-linux.x64-19.24.0.0.0dbru.zip -d /oracle
[root@localhost oracle]# cd instantclient_19_24/
[root@localhost instantclient_19_24]# pwd
/oracle/instantclient_19_24

--配置环境变量
-添加到/etc/ld.so.conf.d目录下
[root@localhost ~]# echo /oracle/instantclient_19_24 > /etc/ld.so.conf.d/oracle-instantclient.conf
[root@localhost ~]# cat /etc/ld.so.conf.d/oracle-instantclient.conf
/oracle/instantclient_19_13
[root@localhost ~]# ldconfig

---配置LD_LIBRARY_PATH环境变量

修改dmdba用户下的.bash_profile文件,添加如下内容:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/oracle/instantclient_19_24"
生效:

[dmdba@localhost ~]$ source .bash_profile

--重启dmserver
[dmdba@dmtest ~]$ DmServiceDMSERVER restart
Stopping DmServiceDMSERVER: [ OK ]
Starting DmServiceDMSERVER: [ OK ]

--通过ORACLE OCI接口的方式访问
DBLINK创建语句:
[dmdba@dmtest ~]$ disql sysdba/Dameng123:5236

服务器[LOCALHOST:5236]:处于普通打开状态
登录使用时间 : 8.061(ms)
disql V8
SQL> create public link "LINKORA" connect 'oracle' with hr identified by hr using '192.168.98.106:1521/testdb';

--测试:
SQL> select * from jobs@LINKORA;
select * from jobs@LINKORA;
第1 行附近出现错误[-2245]:DBLINK加载库文件失败.
已用时间: 2.355(毫秒). 执行号:0.

回答 0
暂无回答
扫一扫
联系客服