Pular para o conteúdo

Fóruns Banco de dados Oracle Criar DB-Link Oracle com SQL Server utilizando DG4MSQL Criar DB-Link Oracle com SQL Server utilizando DG4MSQL

#88770
priscilla
Participante

    Como criar um DB-Link de Oracle para SQLServer

    Requisitos
    1 –Oracle (10.2.0.4)
    2 –SQLServer (2000 ou 2005)
    3 – Ter o Oracle Database Gateways 11g Release (11.1.0.6.0) for Linux x86-64 que pode ser encontrado no site http://www.oracle.com/technology/softwa … 4soft.html

    Depois que tudo estiver instalado dever ser feita as seguintes configurações:

    1 – Database do Oracle
    Incluir no TNSNAMES.ora

    dg4msql =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ‘hostname’)(PORT = 1522))
    (CONNECT_DATA =
    (SID = dg4msql)
    )
    (HS = OK)
    )

    2 – Gateway

    Incluir no LISTENER.ora do Gateway

    listener.ora Network Configuration File: /u01/gateways/network/admin/listener.ora

    Generated by Oracle configuration tools.

    LISTENER11G =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ‘hostname’)(PORT = 1522))
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    )
    )

    SID_LIST_LISTENER11G =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME=dg4msql)
    (ORACLE_HOME=/u01/gateways)
    (ENVS=LD_LIBRARY_PATH=/u01/gateways/dg4msql/driver/lib:/u01/gateways/lib)
    (PROGRAM=dg4msql)
    )
    )

    Incluir no initdg4msql.ora

    This is a customized agent init file that contains the HS parameters

    that are needed for the Database Gateway for Microsoft SQL Server

    #

    HS init parameters

    #
    HS_FDS_CONNECT_INFO=10.0.2.6:1433//DadosAdv-Priscilla

    alternate connect format is hostname/serverinstance/databasename

    HS_FDS_TRACE_LEVEL=DEBUG
    HS_FDS_RECOVERY_ACCOUNT=RECOVER
    HS_FDS_RECOVERY_PWD=RECOVER

    Obs.: 10.0.2.6 é o servidor do SQLServer, a porta padrão é 1433, DadosAdv-Priscilla é o banco de dados

    3 – Dever ser feita a seguinte configuração nas variáveis de ambiente

    unset na ORA_NLS33

    LD_LIBRARY_PATH=/U01/gateways/lib

    oracle_base=/u01/gateways

    oracle_home=/u01/gateways

    PATH=/U01/gateways/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin

    Pode ser que seja necessário a executação do patch gateway 11.1.0.7

    4 – Criar o DB-Link

    Create public database link connect to “usuário” identified by “senha” using dg4msql;

    select * from “cliente”@nome do dblink;

    []´s

    Priscilla