Ispirer Website Ispirer Capabilities - MySQL Migration Free Trial

ODBC Tuning Guide for Sybase ASE to MySQL

To tune a replication process on Linux via ODBC you have to perform actions that are described below (ISDBDriverOdbc.so universal driver will be used instead native ISDBDriverSybaseAse.so and ISDBDriverMySql.so drivers)

Please install next rpm-packets (try to use similar versions of these rpm-packets and to install it in order specified above and for unixODBC use only 2.2.11):

libtool-1.5.22-7.el5_4
libtool-ltdl-1.5.22-7.el5_4
libtool-ltdl-devel-1.5.22-7.el5_4
unixODBC-2.2.11-10.el5
unixODBC-libs-2.2.11-10.el5
unixODBC-devel-2.2.11-10.el5
mysql-connector-odbc-3.51.26r1127-2.el5
freetds-0.64-11.el5.centos
freetds-devel-0.64-11.el5.centos

Print next command to see your config infomation.

odbcinst -j
 unixODBC 2.2.11
 DRIVERS............: /etc/odbcinst.ini
 SYSTEM DATA SOURCES: /etc/odbc.ini
 USER DATA SOURCES..: /root/.odbc.ini

Edit /etc/odbc.ini and /etc/odbcinst.ini Below are examples.

odbc.inst.ini

 [PostgreSQL]
 Description           = ODBC for PostgreSQL
 Driver                = /usr/lib/psqlodbc.so
 Setup                 = /usr/lib/libodbcpsqlS.so
 Driver64              = /usr/lib64/psqlodbc.so
 Setup64               = /usr/lib64/libodbcpsqlS.so
 FileUsage             = 1
 UsageCount            = 2
  
 [MySQL]
 Description           = ODBC for MySQL
 Driver                = /usr/lib/libmyodbc3_r.so
 Setup                 = /usr/lib/libodbcmyS.so
 Driver64              = /usr/lib64/libmyodbc3_r.so
 Setup64               = /usr/lib64/libodbcmyS.so
 FileUsage             = 1
 UsageCount            = 2
  
 [PostgreSQL64]
 Description           = ODBC for PostgreSQL (64 bit)
 Driver                = /usr/lib/psqlodbcw.so
 Setup                 = /usr/lib/libodbcpsqlS64.so
 Driver64              = /usr/lib64/psqlodbcw.so
 Setup64               = /usr/lib64/libodbcpsqlS64.so
 FileUsage             = 1
 UsageCount            = 2
  
 [MySQL64]
 Description           = ODBC for MySQL (64 bit)
 Driver                = /usr/lib/libmyodbc5.so
 Setup                 = /usr/lib/libodbcmyS64.so
 Driver64              = /usr/lib64/libmyodbc5.so
 Setup64               = /usr/lib64/libodbcmyS64.so
 FileUsage             = 1
 UsageCount            = 2
  
 [FreeTDS]
 Description           = ODBC for Sybase ASE
 Driver                = /usr/lib64/libtdsodbc.so
 Setup                 = /usr/lib64/libtdsS.so
 Driver64              = /usr/lib64/libtdsodbc.so
 Setup64               = /usr/lib64/libtdsS.so
 QuotedId              = Yes
 Trace                 = on
 TraceFile             = /tmp/freetds.log
 FileUsage             = 1
 UsageCount            = 2
  

odbc.ini

 [MYSQL_TEST_WS027]
 Driver                = MySQL
 SERVER                = ws027
 PORT                  = 3306
 DATABASE              = test
 USER                  = root
 PASSWORD              = ***
  
 [SYBASE_ASE_TEST]
 Driver                = FreeTDS
 Server                = vmdbsrv010
 Port                  = 5000
 Database              = test
 UserID                = sa
 Password              = ***
 QuotedId              = Yes
 TraceFile             = /tmp/freetds.log
 Trace                 = on
 TDS_Version           = 5.0

Edit /etc/freetds.conf to set 5.0 TDS version in global section:

etc/freetds.conf

…
[global]
      # TDS protocol version
              tds version = 5.0
…

Once you create your files and save them here is how you do the install.

Install driver

odbcinst -i -d -f /etc/odbcinst.ini

Install system DSN

odbcinst -i -s -l -f /etc/odbc.ini

Test your DSN install by listening your installed data sources.

odbcinst -s -q
[zenoss]

Test that you can connect to the database via the ODBC.

isql -v zenoss root BlAh

+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+

SQL> quit

You are done. Here are some quick ways to fix some problem you can have during the install.

How to remove a driver.

odbcinst -u -d -n zenoss
 
odbcinst: zenoss has been deleted (if it existed at all) because its usage count became zero.

How to remove a data source.

odbcinst -u -s -l -n zenoss
odbcinst: DSN removed (if it existed at all). ODBC_BOTH_DSN was used as the search path.

Remember if you change a ODBC parameter you need to install it again.

odbcinst -i -s -l -f /etc/odbc.ini

A configuration process takes a lot of effort and patience. So be attentive.


© 1999-2024, Ispirer Systems, LLC. All Rights Reserved.