StarQuest Technical Documents

Troubleshooting Tips for StarSQL for UNIX

Last Update: 21 November 2018
Product: StarSQL
Version: All
Article ID: SQV00SU003

Abstract

This article provides troubleshooting and configuration hints for StarSQL for UNIX.

For additional information, see How to Report a StarSQL ODBC Driver for UNIX Problem for instructions on capturing ODBC and DRDA traces. Also see Common StarSQL Error Messages for error messages that may occur when using either StarSQL for Windows or StarSQL for UNIX.

Solution

Confirming bitwidth of application, ODBC driver manager, and driver

StarSQL (64-bit) and StarSQL (32-bit) can be installed on the same system and are independent of each other. Be sure that bitwidth of the ODBC application and any shared libraries that it uses, including the ODBC driver manager and the StarSQL driver itself, are all of the same bitwidth. You can use the file command to display the bitwidth of a binary.

Viewing the environment of a running process

Identify the PID of the process you are interested in, then use ps e (as root) to display the environment for that process. Pipe the output to more or to a file so that long lines are wrapped instead of truncated. This is useful in troubleshooting ODBC problems involving a service; of particular interest is the value for LD_LIBRARY_PATH (Linux & Solaris).

$ su
# ps -eaf | grep <process-name> or <user-id>
# ps e -p <pid> | more

Viewing the shared library dependencies of an application or shared library

Often a failure to load a dependent shared library results in a misleading error message, identifying a file that is known to exist (e.g. libSWODBC.so) rather than the missing or unloadable shared library.

Another common issue is due to the presence of multiple versions of ODBC driver managers - for example, a system may include the version of unixODBC installed with StarSQL, an older version of unixODBC installed by the Linux distribution, and a copy of the DataDirect driver manager installed with a commercial application. It is important to understand exactly which copy of libodbc.so, libodbcinst.so, etc. is being used by your application, and be careful to use one and only one driver manager.

On Linux and Solaris, use the ldd command to identify the dependencies of the ODBC application or a shared library. On AIX, a freeware version of ldd is available, or you can use dump -H. On HP-UX, use /usr/ccs/bin/ldd (part of the developer tools). On MacOS, use otool -L ( part of the developer tools).

$ ldd /usr/share/starsql64/bin/simpleconn
$ ldd /usr/share/starsql64/lib/libSWODBC.so

Identifying processes using a shared library

Use the lsof (list open files) command to identify processes using a shared library or other binary. Run this command as root.

Example: the following commands will identify any processes currently using the branded DataDirect Driver Manager or the StarSQL driver:

$ su
# /usr/sbin/lsof /opt/IBM/InformationServer/Server/branded_odbc/lib/libodbc.so
# /usr/sbin/lsof /usr/share/starsql64/lib/libSWODBC.so

Configuring system-wide LD_LIBRARY_PATH

Configuring the system-wide LD_LIBRARY_PATH (Linux & Solaris) may be useful when experiencing ODBC problems with a service.

On all systems: Edit /etc/profile or create a custom.sh shell script in /etc/profile.d/

Linux: Add the path to shared libraries (e.g. /usr/share/starsql64/odbc/lib) to /etc/ld.so.conf or file with a .conf extension in /etc/ld.so.conf.d/, and execute the ldconfig command as root.

FreeBSD: Use ldconfig -m /usr/share/starsql64/odbc/lib
Solaris: Use crle
HP-UX: Edit /etc/SHLIB_PATH
AIX: no equivalent

Disabling SELinux

Some applications may experience issues if SELinux (Security-Enhanced Linux) is enabled. SELinux is often enabled by default on Red Hat and related distributions such as Fedora, CentOS, and Scientific Linux.

Use the command sestatus to display the current state of SELinux.

To verify whether SELinux is the source of connectivity problems, temporarily configure permissive mode by changing the contents of /selinux/enforce from 1 to 0:

# echo 0 > /selinux/enforce

Disable SELinux permanently by editing /etc/selinux/config:
SELINUX=DISABLED

 

Conversion problems: UTF-8 and SQLBindParameter()/SQL_C_CHAR

Symptom: When using SQLBindParameter() with SQL_C_CHAR to insert UTF-8 characters such as the Euro sign ('€'), the data sent to the host is incorrect. The issue does not occur when using literals in an INSERT statement.

Solution:

  • Edit /usr/share/starsql64/etc/conf/ccsid.csv and insert the following line (between 1200 & 1208):

1202,U,G,UTF-16LE

  • Add the following to your ODBC data source:

ICONV4UTF8=Y

 


DISCLAIMER

The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization.  The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.