Bug #78256 Oracle HS fails to operate on mysql-connector-odbc-5.2.5-6.0.1.el7.x86_64
Submitted: 28 Aug 2015 8:56 Modified: 28 Aug 2015 9:45
Reporter: Станислав Сухолёт Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.2.5-6.0.1.el7.x86 OS:Oracle Linux (7.1)
Assigned to: CPU Architecture:Any

[28 Aug 2015 8:56] Станислав Сухолёт
Description:
/usr/lib64/libmyodbc5.so (symlink to /usr/lib64/libmyodbc5w.so) fails to load by Oracle HS service (dg4odbc) with following diagnostics: 
==========================================
Heterogeneous Agent Release
11.2.0.4.0

Oracle Corporation --- FRIDAY    AUG 28 2015 09:44:27.209

    Version 11.2.0.4.0

Entered hgogprd
HOSGIP for "HS_FDS_TRACE_LEVEL" returned "4"
Entered hgosdip
[...skipped...]
Entered hgolofns at 2015/08/28-09:44:27
 libname=/usr/lib64/libmyodbc5w.so, funcname=SQLAllocHandle
 peflerr=6520, libname=/usr/lib64/libmyodbc5w.so, funcname=SQLAllocHandle
 hoaerr:28500
Exiting hgolofns at 2015/08/28-09:44:27
Failed to load ODBC library symbol: /usr/lib64/libmyodbc5w.so(SQLAllocHandle)
Exiting hgolofn, rc=28500 at 2015/08/28-09:44:27
Exiting hgoinit, rc=28500 with error ptr FILE:hgoinit.c LINE:424 FUNCTION:hgoinit() ID:Loading ODBC aray of function ptrs
Entered hgoexit
HS Gateway:  NULL connection context at exit
Exiting hgoexit, rc=0 with error ptr FILE:hgoexit.c LINE:113 FUNCTION:hgoexit() ID:Connection context
===================================

How to repeat:
1. Install oracle 11.2.0.4 on OEL 7.1
2. create odbc connection to some mysql server:
==========[/etc/odbc.ini]=========
[customers]
Description         = Customers Database on the MariaDB Cluster
Driver              = MySQL
Database        = customers
Server             = 10.10.10.217
User                = oracle
Password       = password
Port                 = 3306
CHARSET       = utf8
==============================
3. create HS config:
==[/opt/oracle/product/11.2.0/db_1/hs/admin/initmysql.ora]==
HS_FDS_CONNECT_INFO = customers
HS_FDS_SHAREABLE_NAME = /usr/lib64/libmyodbc5.so

set ODBCINI= /etc/odbc.ini
HS_NLS_NCHAR=AL32UTF8
HS_LANGUAGE=american_america.al32utf8
HS_FDS_TRACE_LEVEL = 4
===============================================

4. Edit configuration for the oracle listener:
==[/opt/oracle/product/11.2.0/db_1/network/admin/listener.ora]==
ADR_BASE_LISTENER = /opt/oracle
LOGGING_LISTENER = ON
CONNECT_TIMEOUT_LISTENER = 180

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
      (SID_DESC =
            (SID_NAME = mysql)
            (PROGRAM = dg4odbc)
      )
      (SID_DESC =
            (SID_NAME = ORADB)
      )
  )
=======================================================
5. restart listener: 
$ lsnrctl stop; lsnrctl start
6. create database link in oracle:
$ sqlplus "/as sysdba" <<EOF
create public database link mysql 
  connect to "oracle" 
  identified by "password" 
  using 'mysql';
EOF
7. test the link:
$ sqlplus "/as sysdba" <<EOF
select 'x' from dual@MYSQL;
EOF
8. check the logfile at the /opt/oracle/product/11.2.0/db_1/hs/log/
[28 Aug 2015 9:39] Chiranjeevi Battula
Hello Станислав Сухолёт,

Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

https://bugs.mysql.com/bug.php?id=78242

Thank you for your interest in MySQL.

Thanks,
Chiranjeevi.
[28 Aug 2015 9:45] Станислав Сухолёт
Don't exactly sure which version of mysql-connector-odbc you understand as main: 5.2.5 is within the EL7.1 packages and 5.3.4 is in the separate repository.

Moreover, the error messages are quite different, even the result is the same