首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Linux RedHat 64位上建立从Oracle10gR2到Linux RedHat 64位的PostgreSQL8.3的dblink?

如何在Linux RedHat 64位上建立从Oracle10gR2到Linux RedHat 64位的PostgreSQL8.3的dblink?
EN

Stack Overflow用户
提问于 2012-02-22 13:00:34
回答 1查看 3.4K关注 0票数 2

我尝试使用Oracle的以下查询:

代码语言:javascript
复制
select * from "a_table"@Postgres;

下面是我得到的错误消息:

代码语言:javascript
复制
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: précédant 2 lines de RECORD
28545. 0000 -  "error diagnosed by Net8 when connecting to an agent"
*Cause:    An attempt to call an external procedure or to issue SQL
       to a non-Oracle system on a Heterogeneous Services database link
       failed at connection initialization.  The error diagnosed
       by Net8 NCR software is reported separately.
*Action:   Refer to the Net8 NCRO error message.  If this isn't clear,
       check connection administrative setup in tnsnames.ora
       and listener.ora for the service associated with the
       Heterogeneous Services database link being used, or with
       'extproc_connection_data' for an external procedure call.
Erreur à la ligne 1, colonne 25

这里是tnsnames.ora

代码语言:javascript
复制
Postgres =
   (DESCRIPTION =
     (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
   )
   (CONNECT_DATA =
     (SID = RECORD)
   )
   (HS=OK)
  )

这里是listener.ora

代码语言:javascript
复制
LISTENER_HS =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1525))
        (ADDRESS = (PROTOCOL = IPC)(KEY = PNPKEY))
      )
    )
  )

SID_LIST_LISTENER_HS =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = RECORD)
      (ORACLE_HOME = /oracle/product/10.2.0)
      (PROGRAM = hsodbc)
      (ENVS = "LD_LIBRARY_PATH=/oracle/product/10.2.0/lib32:/oracle/product/10.2.0/hs/lib32:/user/lib")
    )
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/product/10.2.0)
      (PROGRAM = extproc)
    )
  )

注意在启动监听器之后,下面是输出

代码语言:javascript
复制
$ lsnrctl status LISTENER_HS

LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 22-FEB-2012 13:45:09

Copyright (c) 1991, 2006, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1525)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_HS
Version                   TNSLSNR for Linux: Version 10.2.0.3.0 - Production
Start Date                22-FEB-2012 13:45:05
Uptime                    0 days 0 hr. 0 min. 3 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      ON
Listener Parameter File   /oracle/product/10.2.0/network/admin/listener.ora
Listener Log File         /oracle/product/10.2.0/network/log/listener_hs.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1525)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "RECORD" has 1 instance(s).
  Instance "RECORD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

在这里initPostgres.ora

代码语言:javascript
复制
HS_FDS_CONNECT_INFO = Postgres
HS_FDS_TRACE_LEVEL = DEBUG
HS_FDS_TRACE_FILE_NAME = /oracle/product/10.2.0/hs/log/postgres.trc
HS_FDS_SHAREABLE_NAME = /usr/lib/psqlodbc.so

set ODBCINI= /etc/odbc.ini

/oracle/product/10.2.0/hs/log/record.trc是空的。

我错过了什么?

Oracle 10gR2

Linux64位RedHat

Postgresql 8.3

Linux64位RedHat

编辑:当我尝试手动检查ODBC驱动程序是否已经启动并运行时,我得到的是:

代码语言:javascript
复制
$ isql postgres USER PASS -v
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib/psqlodbc.so' : /usr/lib/psqlodbc.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou répertoire de ce type
[ISQL]ERROR: Could not SQLConnect
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-02-22 17:27:50

我在甲骨文论坛上也问过同样的问题,我得到了回应。

简单地说,我不能在Linux64位上使用hsodbc --没有来自Linux32bit的端口。相反,我必须使用与Oracle10.2.0.3不兼容的DG4ODBC。那么我的选择要么是:

  • 安装ODBC 11.2.0.3数据库网关
  • 从Oracle 10.2.0.3迁移到Oracle 10.2.0.4或更高版本
  • 或应用修补程序5965763。

详细的回答是这里

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9395256

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档