Oracle 11gr2使用dg4msql连接Sql Server问题
它可以回应谁, 我们在 Redhat Enterprise Linux 5.4 上安装了 Oracle 11g r2。我们正在尝试连接到 Sql Server 2005,在应用一些注释后,以下错误是我们得到的结果: “异构远程代理中出现 ORA-28513 内部错误”。
Listener.ora 如下:
[oracle@oracledb admin]$ less listener.ora
)
(SID_DESC =
(SID_NAME = dg4msql)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(PROGRAM = dg4msql)
(ENVS=LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/dg4msql/lib:/u01/app/oracle/product/11.2.0/db_1/lib)
)
)
LOGGING_LISTENER = on
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracledb)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
TRACE_LEVEL_LISTENER = on
tnsnames.ora 如下:
[oracle@oracledb admin]$ less tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
fasdat =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracledb)(PORT = 1521))
)
(CONNECT_DATA =
(SID = fasdat)
)
)
dg4msql =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL= TCP)
(HOST = oracledb)
(PORT = 1521)
)
(CONNECT_DATA=
(SID=dg4msql) )
(HS=OK))
init4msql.ora 如下:
[oracle@oracledb admin]$ less initdg4msql.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server
#
# HS init parameters
#
HS_FDS_CONNECT_INFO=192.168.1.48:1433//NAVISION
# alternate connect format is hostname/serverinstance/databasename
#HS_FDS_TRACE_LEVEL=0
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
#HS_LANGUAGE=turkish_turkey.WE8ISO8859P9
HS_NLS_NCHAR=WE8ISO8859P9
#HS_FDS_TRACE_LEVEL=DEBUG
我们在 Sql Server 2005 上设置了一个名为“dg4msql”的系统 dsn,选择驱动程序为“Sql Server”,服务器为“local”
我们很高兴听到任何解决此问题的想法,
To whom it may respond to,
We have installed Oracle 11g r2 on a Redhat Enterprise Linux 5.4 . We are trying to connect to a Sql Server 2005, after applying some notes the error below is the result we got :
"ORA-28513 internal error in heterogenous remote agent".
listener.ora is as below :
[oracle@oracledb admin]$ less listener.ora
)
(SID_DESC =
(SID_NAME = dg4msql)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(PROGRAM = dg4msql)
(ENVS=LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/dg4msql/lib:/u01/app/oracle/product/11.2.0/db_1/lib)
)
)
LOGGING_LISTENER = on
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracledb)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
TRACE_LEVEL_LISTENER = on
tnsnames.ora is as below :
[oracle@oracledb admin]$ less tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
fasdat =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracledb)(PORT = 1521))
)
(CONNECT_DATA =
(SID = fasdat)
)
)
dg4msql =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL= TCP)
(HOST = oracledb)
(PORT = 1521)
)
(CONNECT_DATA=
(SID=dg4msql) )
(HS=OK))
init4msql.ora is as below :
[oracle@oracledb admin]$ less initdg4msql.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server
#
# HS init parameters
#
HS_FDS_CONNECT_INFO=192.168.1.48:1433//NAVISION
# alternate connect format is hostname/serverinstance/databasename
#HS_FDS_TRACE_LEVEL=0
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
#HS_LANGUAGE=turkish_turkey.WE8ISO8859P9
HS_NLS_NCHAR=WE8ISO8859P9
#HS_FDS_TRACE_LEVEL=DEBUG
We have setup a system dsn at Sql Server 2005 named 'dg4msql' , chose the driver as 'Sql Server' and server as 'local'
We would be glad to hear any ideas to resolve this problem,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎正在使用 MySQL 设置网关而不是异构网关(用于 ODBC 连接)。 的过程概述
以下是在 SQL Server 上创建数据库用户并授予其对要通过 Oracle 数据库链接读取的数据库/表的读取权限
。在网关主页中,您要访问的每个 SQL Server 数据库都应该有一个 init.ora
位于 $OH/dg4msql/admin 中,格式为 initsid.ora,其中 sid 是
要在链接中使用的数据库(例如 initbob.ora),因此创建一个
您现在必须使用现有 SID_LIST 内的附加 SID_DESC 部分将新 sid 添加到网关主目录中的listener.ora,例如
您现在应该停止并重新启动网关侦听器,使新的 sid 变为
积极的。请注意,重新加载是不够的。
现在,您必须在 tnsnames.ora 文件中为每个监听器添加新的 sid
您将在其中创建链接的数据库。您不需要在网关主目录中执行此操作,除非它也是您将在其中创建数据库链接的数据库主目录。
注意:主机和端口用于网关,而不是 SQL Server 数据库。
在每个需要链接到 MS-SQL 数据库的数据库中,您应该创建一个到新网关 sid 的数据库链接。
其中 ms-user 和 ms-password 是您在开始时创建的 SQL Server 用户。
现在您可以测试新的数据库链接
一旦您完成此操作,您可以更改 initsid.ora 文件以添加参数以适合您的连接。如果您这样做,您可以通过网关轻松添加和管理许多不同的数据库。
You seem to be using the Gateway for MySQL set-up rather than the Heterogeneous Gateway (for ODBC connections). Here is an overview of the process
On SQL Server create a database user and give it read access to the database/tables you want to read via the Oracle database link.
In the gateway home each SQL Server database you want to access should have an init.ora
located in $OH/dg4msql/admin in the form initsid.ora where sid is the name of
the database to be used in the link (e.g. initbob.ora), so create one
You must now add the new sid to the listener.ora in the gateway home using an additional SID_DESC section inside the existing SID_LIST, for example
You should now stop and restart the gateway listener so that the new sid becomes
active. NB a reload is not enough.
You must now add the new sid in the tnsnames.ora file for the listener of each
database in which you will create a link. You don't need to do this in the gateway home unless it is also a database home in which you will create a database link.
NB: The host and port are for the gateway not for the SQL Server database
In each database that requires a link to the MS-SQL database you should create a database link to your new gateway sid.
where ms-user and ms-password are the SQL Server user you created right at the start.
Now you can test the new database link
Once you have this working you can alter the initsid.ora file to add parameters to suit your connection. If you do it this way you can easily add and manage many different databases via the gateway.