This article takes SQL Server 2k as an example to illustrate the specific implementation process of connecting the server from SQL Server to Oracle.
1. It is required to install oralce client software and sqlserver2000 software on the PC.
2. Client configuration tnsnames.ora file, configure the database server to be connected (windows, unix and other platforms are acceptable)
eg: tnsnames.ora
...
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.90)(PORT = 1521))
)
(CONNECT_DATA =
(sid = blue)
(SERVER = DEDICATED)
)
)
......
3. Configure the ODBC data source of windows:
Start Menu— 》Settings -> Management Tools -> Data Source (ODBC) -> Enter the configuration user DSN or system DSN: Add -> Select Microsoft ODBC for oracle -> Customize the data source name (preferably the same name as the connection string in tns! )—》Server name (required! Fill in the connection string name in the tns file)—》Complete.
4. Configure the connection server in sqlserver2000:
Enterprise Manager -> Security -> Connection Server -> Right-click to create a new connection server -> Define the connection name; Select other data sources; Specify the program name as :Microsoft OLE DB Provider for Oracle; The product name is optional; The data source specifies the data source name just defined in ODBC; The provider string is filled in in the following format: User ID=username;Password=userpasswd (or in the following format: UID =username;PWD=userpasswd), the username and password here correspond to the username and password in the oracle database to be connected - "Security tab page: Set up with this security context, and enter the oracle database username and password -" Server The options tab can be defaulted to -> OK.
5. All preparations are completed! Open the newly created connection server in sqlserver Enterprise Manager - "Security -" Connection Server - "Click on the table. You can see all the table names owned by the oracle database user in the right window, but they cannot be viewed here. Table records, this needs to be implemented using specific sql in the query analyzer of sqserver! When accessing a table, the format used is: [Connection server name]..[ORACLE user].[Table name]. More detailed and specific usage will not be described here.