ITPub博客

首页 > Linux操作系统 > Linux操作系统 > How to build database connection among heterogeneous database

How to build database connection among heterogeneous database

原创 Linux操作系统 作者:licheng79 时间:2011-09-13 09:46:46 0 删除 编辑

How to build database connection among heterogeneous database

 

1 Build database connection from SQL SERVER by linked server

 

For the request to be access data from MYSQL from SQL server 2008, there is a solution by linked server from SQL server SSMS function.

 

Results:

 

Please reference following linkage for details:

http://dbperf.wordpress.com/2010/07/22/link-mysql-to-ms-sql-server2008/

 

2 Build database connection from Oracle by database link

Question:  How do I create a database link from Oracle to SQL Server?  I need to link to SQL Server as part of a band-aid before migrating everything to Oracle.

Answer:  Oracle heterogeneous services allow you to define a database link between Oracle and SQL Server, as well as links to DB2 and other inferior databases.

Here are complete notes in creating a database link between Oracle and SQL Server.

1. Install Oracle ODBC drivers on the server (your local Oracle database) that will access the remote SQL Server database using the database link.

2. Setup the ODBC connection on the local Oracle database using the Windows ODBC Data Source Administrator

3. Test the ODBC drivers to ensure that connectivity is made to the SQL Server database.

4. Ensure that your global_names parameter is set to False.

5. Configure the Oracle Heterogeneous services by creating an initodbc.ora file within the Oracle database.

7. Modify the Listener.ora file.

SID_NAME is the DSN for the remote database.
ORACLE_HOME is the actual Oracle home file path.
PROGRAM tells Oracle to use heterogeneous services.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME=Cas30C) -- Enter the DSN on this line
(ORACLE_HOME = c:\oracle10gdb) -- Enter your Oracle home on this line
(PROGRAM = hsodbc) ) )

 

8. Modify the Tnsnames.ora file. This is the Oracle database installation accessed by the users to connect to the ODBC drivers

(DESCRIPTION=
(ADDRESS_LIST=
(Address=(PROTOCOL=TCP)
(HOST=
-- (Server x)
(PORT=1521))) -- Enter the port on which the server x Oracle installation
-- is listening
(CONNECT_DATA=(SID=Cas30c)) - Enter the DSN name
(HS=OK) -- Enter this value. It tells Oracle to use hetergeneous services
)

9. Reload the listener on local Oracle database

10. Create a database link on the local Oracle installation that accesses the heterogeneous connection, which, in turn, connect to SQL Server.

11. Run a SQL Server Select statement from the Oracle installation using the database link.

Please reference following linkage for details:

http://www.dba-oracle.com/t_database_link_sql_server_oracle.htm

http://download.oracle.com/docs/cd/B28359_01/gateways.111/b31042/configodbc.htm#CIHFEGDA

 

SQL Server access MYSQL.JPG

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26136400/viewspace-707234/,如需转载,请注明出处,否则将追究法律责任。

下一篇: Oracle trace event
请登录后发表评论 登录
全部评论

注册时间:2011-09-07

  • 博文量
    54
  • 访问量
    69786