The Microsoft OLE DB Provider for Oracle allows distributed queries to query data in Oracle databases.
Note Oracle client software does not support distributed queries using Microsoft OLE DB Provider for Oracle when the distributed transactions are executed from an instance of SQL Server installed on Microsoft Windows® 98.
To create a linked server to access an Oracle database instance
This example assumes that an SQL*Net alias name has been defined as OracleDB.
sp_addlinkedserver 'OrclDB', 'Oracle', 'MSDAORA', 'OracleDB'
This example maps the SQL Server login Joe to the linked server defined in Step 3 using the Oracle login and password OrclUsr and OrclPwd:
sp_addlinkedsrvlogin 'OrclDB', false, 'Joe', 'OrclUsr', 'OrclPwd'
Each Oracle database instance has only one catalog with an empty name. Tables in an Oracle linked server must be referenced using a four-part name of the form OracleLinkedServerName..OwnerUserName.TableName. For example, this SELECT statement references the table SALES owned by the Oracle user MARY in the server mapped by the OrclDB linked server:
SELECT *
FROM OrclDB..MARY.SALES
Use these rules when referencing tables in an Oracle linked server:
To enable the OLE DB Provider for Oracle to work with your Oracle client software, the client's registry must be modified by running a registry file from a command line. Multiple instances of the client software should not run concurrently. These files are listed in the following table and are located within the same directory structure that contains your Microsoft Data Access Component (MDAC) installation, which typically is in C:\Program Files\Common Files\System Files\OLE DB.
Oracle client | Windows NT or 9x | Windows 2000 |
---|---|---|
7.x | mtxoci7x_winnt.reg | mtxoci7x_win2k.reg |
8.0 | mtxoci80x_winnt.reg | mtxoci80x_win2k.reg |
8.1 | mtxoci81x_winnt.reg | mtxoci81x_win2k.reg |