如何将MySQL DB链接到Oracle DB [英] How to link MySQL DB to Oracle DB

查看:94
本文介绍了如何将MySQL DB链接到Oracle DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以执行将MySQL DB表和Oracle DB表联接在一起的查询?

Is it possible to execute queries joining a MySQL DB table and an Oracle DB table?

我以前在MS SQL Server上工作,并且在SQL Server实例内部链接了外部DB服务器,以创建集成了不同DB表的过程和视图.

I previously worked on MS SQL Server and I linked external DB servers inside SQL Server instance to create procedures and views integrating different DB tables.

MySQL或Oracle DBMS上是否有类似的东西?

Is something similar available on MySQL or Oracle DBMSs?

推荐答案

是的,可以. 为此,可以将dg4odbc(假设oracle> = v11)与unixODBC一起用作odbc驱动程序管理器,将freeTDS用作SQLServer的odbc驱动程序.

Yes, you can. For that you use the dg4odbc (assuming oracle >= v11) in combination with unixODBC as odbc driver manager and freeTDS as odbc driver for SQLServer.

您要做的是在listener.ora中创建一个类似于

What you do is create a listener entry in your listener.ora similar to

   (SID_DESC =
       (SID_NAME=yourdb)
       (ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1 )
       (PROGRAM = dg4odbc)
       (ENVS = "LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0.3/dbhome_1/lib:/usr/local/freetds/lib")
   )

创建一个指向该特殊SID的tns别名-yourdb,它将用作SQLServer的网关.

create a tns alias that points to this special SID - yourdb - that is going to act as the gateway to SQLServer.

your_tns_alias =

your_tns_alias =

        (DESCRIPTION =
        (ADDRESS_LIST=
        (ADDRESS =(COMMUNITY = tcp.world)(PROTOCOL = TCP)(Host = your.db.server)
        (Port = 1521)
        )
        )
        (CONNECT_DATA =
        (SID = yourdb)
        )
        (HS=ok)
)

注意hs = ok条目,这表明我们与网关有关.

mind the hs=ok entry, this tells we have to do with a gateway.

在$ ORACLE_HOME/hs/admin中,创建一个名为inityourdb.ora的文件,该文件用于配置网关.

In $ORACLE_HOME/hs/admin create a file named inityourdb.ora where the configuration of the gateway comes.

HS_FDS_CONNECT_INFO = yourdsn
HS_DB_NAME = yourdsn
HS_FDS_SUPPORT_STATISTICS = FALSE
HS_FDS_SHAREABLE_NAME=/usr/local/unixODBC/lib/libodbc.so
#HS_FDS_TRACE_LEVEL=debug
HS_FDS_TRACE_LEVEL=off
HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P15

这是Oracle rdbms环境和ODBC之间的接口.指定的是驱动程序管理器DSN,这里也可以是一些调整参数. DSN就像常规ODBC管理一样完成.一些驱动程序需要自己的特殊参数,例如Oracle的ORACLE_HOME才能找到自己的管理程序,例如错误消息....这是包含那些指针的文件.

This is the interface between the Oracle rdbms environment and ODBC. Specified are the driver manager, the DSN, here also can be some tuning parameters. The DSN is as done like regular ODBC administration. Some drivers need their own special parameters, similar like ORACLE_HOME for Oracle in order to find their own administration, like error messages .... This is the file to include those pointers.

玩得开心!

这篇关于如何将MySQL DB链接到Oracle DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆