lightdb oracle_fdw报ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment han

2022/7/2 2:20:19

本文主要是介绍lightdb oracle_fdw报ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment han,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

create server oradb foreign data wrapper oracle_fdw options (dbserver '//10.20.30.199:1521/test');
create user mapping for USER server oradb options (user 'scott', password 'scott');
GRANT USAGE ON FOREIGN DATA WRAPPER oracle_fdw TO CURRENT_USER;
GRANT USAGE ON FOREIGN SERVER oradb TO CURRENT_USER;

create foreign table haha
( id int)
SERVER oradb OPTIONS (schema 'scott', table 'haha


[lightdb@hs-10-20-30-199 ~]$ ltsql -p 5435 -U scott -d scott
ltsql (13.3-22.2)
Type "help" for help.

scott@scott=# select * from haha;
ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle
DETAIL:
scott@scott=#
scott@scott=#
scott@scott=#
scott@scott=#
scott@scott=#
scott@scott=#
scott@scott=# select * from haha;
ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle
DETAIL:   解决方法: 安装oracle轻量客户端。oracle客户端可从https://www.oracle.com/database/technologies/instant-client/downloads.html下载。 export ORACLE_HOME=/home/lightdb/instantclient_21_6
export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin   重启lightdb,问题解决。

这篇关于lightdb oracle_fdw报ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment han的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程