I get the error "Failed to load ODBC library symbol" when using Oracle Heterogeneous Services. What can I do?

The full text of the error that was reported to us was:

Entered hgolofn at 2014/01/13-06:49:08
HOSGIP for "HS_FDS_SHAREABLE_NAME" returned
"/usr/local/easysoft/unixODBC/lib/libodbc.so"
Entered hgolofns at 2014/01/13-06:49:08
 libname=/usr/local/easysoft/unixODBC/lib/libodbc.so, funcname=SQLAllocHandle
 peflerr=6520, libname=/usr/local/easysoft/unixODBC/lib/libodbc.so,
funcname=SQLAllocHandle
 hoaerr:28500
Exiting hgolofns at 2014/01/13-06:49:08
Failed to load ODBC library symbol:
/usr/local/easysoft/unixODBC/lib/libodbc.so(SQLAllocHandle)
    

The customer was using Oracle 11.2.0.3.

This error occurs when the unixODBC Driver Manager shared object can't be loaded. Reasons for this include:

Check the DG4ODBC and Driver Manager Architecture

To check whether the Driver Manager is the same architecture as DG4ODBC, use the file command. For example:

file $ORACLE_HOME/bin/dg4odbc
/u01/app/oracle/product/11.2.0/dbhome_1//bin/dg4odbc: ELF 64-bit LSB
executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs),
for GNU/Linux 2.6.15, BuildID[sha1]=0xabf85c0b2ad8205ca66c2af01da05d480cab3454,
not stripped

If the file is 64-bit, the command output contains ELF 64-bit (or something similar such as ELF-Class64 or ELF-64). In our example output, DG4ODBC is 64-bit.

We now need to check that the Driver Manager is also 64-bit. For example:

file /usr/local/easysoft/unixODBC/lib/libodbc.so
/usr/local/easysoft/unixODBC/lib/libodbc.so: ELF 64-bit LSB shared object,
x86-64, version 1 (SYSV), dynamically linked, not stripped

In our case, the Driver Manager is also 64-bit.

If your DG4ODBC and Driver Manager architecture are different, you need to obtain a Driver Manager that is the same architecture as that of DG4ODBC. (The ODBC driver architecture must be the same as the Driver Manager as well.)

If your version of DG4ODBC is 64-bit, download a 64-bit SQL Server ODBC driver from the Easysoft web site. The SQL Server ODBC driver distribution includes the unixODBC Driver Manager.

If your version of DG4ODBC is 32-bit, download a 32-bit SQL Server ODBC driver from the Easysoft web site. The SQL Server ODBC driver distribution includes the unixODBC Driver Manager.

Check the initSID.ora file

Check that the path specified in the HS_FDS_SHAREABLE_NAME flag value is correct. For example:

$ more $ORACLE_HOME/hs/admin/inithsconnect.ora
#
# This is a sample agent init file containing the HS parameters that
# are needed for an ODBC Agent.
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = MY_ODBC_DSN
HS_FDS_SHAREABLE_NAME = /usr/local/easysoft/unixODBC/lib/libodbc.so

$ ls /usr/local/easysoft/unixODBC/lib/libodbc.so