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/