【问题标题】:Connecting from Oracle to Postgres using DB LINK gives NativeErr 202使用 DB LINK 从 Oracle 连接到 Postgres 会产生 NativeErr 202
【发布时间】:2017-01-27 22:35:38
【问题描述】:

我按照说明 here 从 Oracle DB 客户端内部连接到 PostgreSQL 服务器并在 Postgres 表上执行查询。

Oracle 版本: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit

Postgres 版本: PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu,由 gcc (Debian 4.7.2-5) 4.7.2 编译,64 位

当我运行这样的查询时遇到的错误

select * from "myschema.mytable"@PG_LINK

来自 Oracle 客户端的是:

ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
connction string lacks some options {08001,NativeErr = 202}
ORA-02063: preceding 2 lines from PG_LINK

(如果构建它的开发人员能够根据常识说出缺少哪些选项以及连接字符串在哪里,而不是说“一些选项”,那就太好了!)

我可以使用 psql 命令从 Oracle DB 服务器连接到 Postgres 服务器,因此连接不是问题。

我什至更新了 Postgres 服务器上的 pg_hba.conf 以提供对 Oracle 服务器的显式访问权限,如下所示:

# added to test Oracle's PG LINK
host    all     all     10.XX.XXX.XXX/32       md5
# added to test Oracle's PG LINK
host    all     all     192.XXX.XX.X/32        md5

并重新启动 Postgres 服务器。 (10.开头的地址是内部服务器IP,192.是Oracle服务器的公网IP)

我将身份验证从 md5 更改为 trust,重新启动 Postgres,重新启动 Oracle 侦听器,再次删除并重新创建 DB LINK,但发生了同样的错误。

【问题讨论】:

    标签: oracle postgresql dblink


    【解决方案1】:

    您可以尝试使用 unixODBC 驱动程序和 odbcinst_64 -jisql_64 工具。

    检查“驱动程序”和“用户数据源”文件。

    odbcinst_64 -j

    驱动程序............:/.../odbcinst.ini

    用户数据源..:/.../.odbc.ini

    然后isql_64 -v DNS UID PWD

    请注意,对于 dg4odbc,您应该使用 64 位驱动程序。

    最好的问候,

    S.

    【讨论】:

      猜你喜欢
      • 2020-08-03
      • 1970-01-01
      • 2019-12-26
      • 2016-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-04
      • 2020-12-01
      相关资源
      最近更新 更多