Application Delivery Management
Application Modernization & Connectivity
CyberRes
IT Operations Management
This article explains how to force the unixODBC driver to write a trace file when a program uses AcuSQL runtime to access a database.
To use an ODBC-compliant database (such as MySQL) on Linux, we need to configure unixODBC on the server. If you run into problems doing this, it is possible to create a unixODBC trace file by setting up odbcinst.ini in a manner like this:
mysql@linux:/home/mysql$ more /usr/local/etc/odbcinst.ini
ySQL ODBC 3.51 Driver]
Driver = /opt/mysql-connector-odbc-3.51.25r1093/driver/.libs/libmyodbc3.so
Setup = /opt/mysql-connector-odbc-3.51.25-linux-x86-32bit/lib/libmyodbc3S.so
UsageCount = 1
DBC]
TraceFile = /tmp/odbc.trace
Trace = yes
UsageCount = 1
This generates an ODBC trace file and writes in it each ODBC operation performed with tools like "isql."
There is a problem with this, however; operations performed through AcuSQL runtime do not generate and access this trace file.
This happens because AcuSQL runtime is linked to different libraries from "isql" (which is probably linked directly to MySQL Connector), and AcuSQL runtime does not use ODBC driver libraries.
To solve this issue, we need to relink the runtime to the same libraries that "isql" uses.
mysql@linux:/home/mysql$ ldd /opt/Acucbl810/bin/runcbl
linux-gate.so.1 => (0xb7f7a000)
libmyodbc3-3.51.25.so => /opt/mysql-connector-odbc-3.51.25r1093/driver/.libs/libmyodbc3-3.51.25.so (0xb7f31000)
....
mysql@linux:/home/mysql$ ldd /usr/local/bin/isql
linux-gate.so.1 => (0xb7f9e000)
libodbc.so.1 => /usr/local/lib/libodbc.so.1 (0xb7f02000)
#ifndef NO_ACUSQL
define NO_ACUSQL 0
#endif /* NO_ACUSQL */
In file included from sub.c:32:
config85.c:133: error: expected â, â, â, âasmâ â__attribute__â before numeric constant
make: *** ub.o] Error 1
ACUSQL_ODBC_LIB = /usr/local/lib/libodbc.so.1
# Use the following two lines for an AcuSQL-DISABLED runtime:
#ACUSQL_FLAGS = -DNO_ACUSQL=1
#ACUSQL_LIBS = # nothing - no acusql runtime libraries are necessary
# Use the following two lines for an AcuSQL-ENABLED runtime:
ACUSQL_FLAGS = -DNO_ACUSQL=0
ACUSQL_LIBS = $(ACU_LIBDIR)/libesql.a $(ACUSQL_ODBC_LIB)
make clean
make
Incident Number: 2266010