如何设置从 Linux RedHat 64 位上的 Oracle 10gR2 到 Linux RedHat 64 位上的 Postgresql 8.3 的 dblink?
我尝试从 Oracle 执行此查询:
select * from "a_table"@Postgres;
这是我收到的错误消息:
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
Here is tnsnames.ora
Postgres =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = RECORD)
)
(HS=OK)
)
Here is listener.ora
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)
)
)
注意启动侦听器后,这是输出
$ 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
Here initPostgres.ora
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
Linux 红帽 64 位
Postgresql 8.3
Linux RedHat 64 位
编辑: 当我尝试手动检查 ODBC 驱动程序是否已启动并运行时,我得到的是:
$ 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
I try this query from Oracle :
select * from "a_table"@Postgres;
Here is the error message I get :
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
Here is tnsnames.ora
Postgres =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = RECORD)
)
(HS=OK)
)
Here is listener.ora
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)
)
)
Note after starting the listener, here is the output
$ 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
Here initPostgres.ora
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
is empty.
What am I missing ?
Oracle 10gR2
Linux RedHat 64bit
Postgresql 8.3
Linux RedHat 64bit
EDIT:
When I try to check manually that the ODBC driver is up and running, this is what I get :
$ 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 Oracle 论坛上提出了同样的问题,并得到了答复。
简单地说,我无法在 Linux 64 位上使用
hsodbc
,因为 Linux 32 位没有端口。相反,我必须使用与 Oracle 10.2.0.3 不兼容的
DG4ODBC
。那么我的选择是:
详细响应是 这里。
I have asked the same question on Oracle forum and I get a response.
Simply, I can't use
hsodbc
on Linux 64bit there is no port from Linux 32bit.Instead, I must use
DG4ODBC
incompatibe with my Oracle 10.2.0.3.Then my alternatives are either :
Detailed reponse is here.