Oracle and SQL Server interoperate

Source: Internet
Author: User
Tags format dsn connect odbc sql table name oracle database
Oracle|server|sqlserver
One: SQL Server connects Oracle
1. Configure Windows ODBC Data source:
Start Menu-"Settings-" admin tool-"data source (ODBC)-" Enter configuration User DSN or System DSN can:
Add-"Select Microsoft ODBC for oracle-" Custom data source name (preferably with the same name as the connection string in TNS!) )-"Server name"
(Must fill in!) Fill in the name of the connection string in the TNS file)-"complete."

2. Configure the connection server in sqlserver2000:
Enterprise Manager-"Security-" Connection server-"right" New connection server-"define the connection name;"
Select a different data source; Specify the program name: Microsoft OLE DB Provider for Oracle; Product name is not filled;
The data source specifies the name of the data source that is defined in ODBC just now; the provider string is filled in the following format: User id=username; password=userpasswd
(or in the following format: Uid=username; PWD=USERPASSWD),
Here the username and password correspond to the username and password in the Oracle database to which you want to connect-security tab:
Set in this security context and enter Oracle's database username and password-the Server Option tab page can be determined by default-"."

3. Finished. How to use
In SQL Server Enterprise Manager-"Security-" Connect server open just built connection server-"Click on the table,
You can see all of the table names that the Oracle database user has in the right window, but you won't be able to view the table's records here, which needs to be implemented in the Sqserver Query Analyzer with a specific SQL!
When accessing a table, use the format: [Connect server name]. [Oracle users]. [Table name]. Must be uppercase. More detailed and specific use here no longer repeat.
------------------------------------------------------------------------------------------
Two: Oracle connects SQL Server
1, Security switch Transparent gateway
Within the custom turn
D:\oracle\ora92\tg4msql\admin\inittg4msql.ora Tg4msql
2. Add in D:\oracle\ora92\network\admin\listener.ora
(Sid_desc =
(Global_dbname = tg4msql)
(program = tg4msql)
(Oracle_home = D:\oracle\ora92)
(Sid_name = tg4msql)
)
3. Configure TNS
Tnsnames.ora
-----------------
Example 1
CDMA =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = zhyg) (PORT = 1521))
)
(Connect_data =
(SID = tg4msql)
(SERVER = dedicated)
)
(Hs=ok)
)
Example 2
Du =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = sha38) (PORT = 1521))
)
(Connect_data =
(SID = JF)
(SERVER = dedicated)
)
(Hs=ok)
)
--------
3. Create Data Link
CREATE public DATABASE LINK DU CONNECT to SA identified by SA USING ' DU '
OK you can use the
SELECT * FROM SYSOBJECTS@CDMA



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.