oracle_fdw扩展使用中异常问题
Oracle_fdw 的使用介绍已经在之前的文章中介绍过了,具体见:https://www.cnblogs.com/kingbase/p/14846479.html。
本篇文章介绍一下可能碰到的问题处理:
1.OCIEnvCreate错误
错误信息:error:error connecting to Oracle: OCIEnvCreate failed to create environment handle
这个是由于用户环境变量中没有指定oracle相关lib目录导致的。具体检查一下用户home目录下的 .bash_profile 文件,确认LD_LIBRARY_PATH是否包含oracle_home的路径。
export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
2.client host name is not set 错误
错误信息:ORA-24454: client host name is not set
原因是本机的hosts文件配置问题。
需要在/etc/hosts中增加一条本机的信息。
如: 127.0.0.1 singlekbdb
Singlekbdb 为本机的主机名,操作系统上通过hostname查询。
3.查询时提示错误:ORA-12154
错误信息:ERROR: connection for foreign table "test" cannot be established
DETAIL: ORA-12154: TNS:could not resolve the connect identifier specified
这个也是环境变量没有配置正确导致。
- 确认环境变量是否包含oracle_home目录
- 确认oracle的客户端目录,数据库用户(如kingbase)是否有访问权限
KINGBASE研究院