oracle通过dblink连接Mysql

时间:2021-10-02 07:41:54

1 下载mysql odbc驱动


2  安装mysqlodbc并且在ODBC->DSN下进行配置,配置的名称为mysqlodbc(下载mysql odbc驱动,然后)

oracle通过dblink连接Mysql oracle通过dblink连接Mysql

2 在目录D:\app\Administrator\product\11.2.0\dbhome_1\hs\admin下新建文件:initqz_dept.ora文件(其中qz_dept为mysql数据库名称),
具体配置如下:


HS_FDS_CONNECT_INFO = mysqlodbc --这里的名称为DSN下配置的名称
HS_FDS_TRACE_LEVEL = off


3 配置监听
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
    (SID_DESC =
      (SID_NAME = qz_dept) --sid_name为mysql数据库名称
      (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = dg4odbc)  --对于oracle11为dg4odbc
    
  )
4 tns配置




mysqllink =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = qz_dept)
    )
    (HS = OK)
  ) --其中这里的Host为oracle服务器的地址