Home Forums SQL Server 7,2000 Working with Oracle create Linked Server to Oracle DB - Is this TSQL Script correct? - Novice RE: create Linked Server to Oracle DB - Is this TSQL Script correct? - Novice

  • I am back and struggling again. Suspecting there is a step missing before the script is run?

    They dropped the server before I could connect. Now, have a new server.

    Have uninstalled and re-installed Oracle ODBC Driver Release 11.2.01.0 on the SQL Server to match the new 11g.

    Tried to use the Oracle Internet Directory with the User ID, Password, the Port number, and the server name (ServerName.Company.com) they provided. The error is Server is not up and running (server name/port)

    Oracle.ldap.admin.common.saveChanggeException

    Searching on the internet, it indicates that some type of 'Listener" must be installed?

    This is what they sent (with PW, UserID, port)

    See if these tnsnames help.

    PN.coname.COM =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = scanpr04)(PORT = xxx))

    (LOAD_BALANCE = YES)

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = PO_TAF.coname.COM)

    (FAILOVER_MODE =

    (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY = 5)

    )

    )

    )

    The script above returns

    The server 'PN.coname.COM' does not exist. as indicated by the Oracle Internet Directory

    My Linked Servers - Providers show OraOLEDB.Oracle 10.50.2500 SP1 I think the new server is 11g, so I might be behind one version.

    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'Na1' --this is your ALias

    SET @srvproduct = N'Oracle'

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

    SET @datasrc = N'PN.CoNAME.COM' --this is the SID

    set @provstr = ''

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

    -- exec sp_dropserver AccessDb

    exec sp_addlinkedsrvlogin @rmtsrvname='PN.CoName.COM',

    @useself = N'FALSE',

    @locallogin = 'MyUNOnsql',

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

    @rmtpassword = 'PasswordHere' --oracle password

    /*