Home Forums SQL Server 2008 SQL Server 2008 - General How to install an oracle linked server on SQL Server 2008 r2 failover cluster manager RE: How to install an oracle linked server on SQL Server 2008 r2 failover cluster manager

  • it starts out pretty much like every other desktop install around the office that is connecting to Oracle.

    Use the oracle universal installer to install the client tools. See your It guys for it, it's a pretty big item to redownload.

    next you need the 64 bit drivers as well, if they are not part of the universal install(our installer seemed to only do the 32 bit, but it's been a while since i needed to install again)

    the 64 bit ones found here:

    http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html

    in our office, we copy the TNSNAMES.ORA file and the SQLNET.ORA files from an existing installation (ie C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN) o the matching \NETWORK\ADMIN folder on the server that was created after installing the drivers.

    once that is set up, and using the tools like SQLDeveloper or SQLPlus to prove we can connect, via those programs to the Oracle Instances, it's just a matter of setting up the linked seerver.

    here's my working linked server example code:

    --#################################################################################################

    --Linked server Syntax for Oracle 10G / 11

    --#################################################################################################

    DECLARE @server sysname,

    @srvproduct nvarchar(256),

    @provider nvarchar(256),

    @datasrc nvarchar(100),

    @location nvarchar(100),

    @provstr nvarchar(100),

    @catalog sysname,

    @sql varchar(1000)

    --add an access Database as a linked server

    SET @server = N'MyOracle' --this is your ALias

    SET @srvproduct = N'Oracle'

    SET @provider = N'ORAOLEDB.Oracle' --optionally 'MSDAORA' to use the MS driver

    SET @datasrc = N'SFMN10G' --this is the SID

    set @provstr = ''

    EXEC sp_addlinkedserver @server,@srvproduct,@provider,@datasrc,NULL,@provstr

    -- exec sp_dropserver AccessDb

    exec sp_addlinkedsrvlogin @rmtsrvname='MyOracle',

    @useself = N'FALSE',

    @locallogin = 'sa',

    @rmtuser = N'CHANGE_ME',--oracle username

    @rmtpassword = 'NotARealPassword' --oracle password

    --list all the tables and their names

    EXEC sp_tables_ex 'MyOracle'

    --EXEC dbo.sp_DropServer 'MyOracle', 'DropLogins'

    GO

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!