utorak, 29. srpnja 2014.

Connecting MySQL and ORACLE database - part II - Windows edition

Last post spoke about connecting MySQL database from Oracle database using Oracle Enterprise Linux. This post is almost the same but using M$ Windows. It is almost the same but without CLI.

First download latest (at the time) Connector/ODBC 5.3.2  Windows (x86, 32-bit), MSI Installer from the 
web page: : http://dev.mysql.com/downloads/connector/odbc/

Since I am connectin pre 4.1.1 mySQL database I got this message:




 I found on OTN that bulletproof Connector version that works is 3.51.27. After some search i download it from: http://ftp.nchu.edu.tw/MySQL/downloads/connector/odbc/3.51.html

Create new ODBC source:


In listener ora i add new entry for remote database where SID_NAME is equal to Data Source Name from Connector/ODBC menu (notice that here PROGRAM is hsodbc which points that this is 32 bit Oracle 10g database):

(SID_DESC =
      (SID_NAME = baza)
      (ORACLE_HOME = c:\oracle\ora10)
      (PROGRAM = hsodbc)
    )

Add in tnsnames.ora entry for a remote database:

BAZA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = baza)
    )
    (HS = OK)
  )

In directory %ORACLE_HOME%\hs create init%sid%.ora. I create initbaza.ora with minimum required parameters

#
# HS init parameters
#
HS_FDS_CONNECT_INFO = baza
HS_FDS_TRACE_LEVEL = 0
HS_FDS_TRACE_FILE_NAME=baza.trc


#
# Environment variables required for the non-Oracle system
#
#set <envvar>=<value>

After that create user with database link to tables in MySQL database and enjoy.



Nema komentara:

Objavi komentar