The Microsoft OLE DB Provider for Oracle provides access to Oracle databases. Using the Microsoft OLE DB Provider for Oracle, Microsoft® SQL Server™ distributed queries can query data in Oracle databases.
To set up 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: