Description:
/usr/lib64/libmyodbc5a.so and /usr/lib64/libmyodbc5w.so fails to load by Oracle HS service (dg4odbc) with following diagnostics:
ANSI version (/usr/lib64/libmyodbc5a.so)
[...skipped...]
Entered hgolofns at 2015/08/27-14:00:07
libname=/usr/lib64/libmyodbc5a.so, funcname=SQLColAttributeW
peflerr=6521, libname=/usr/lib64/libmyodbc5a.so, funcname=SQLColAttributeW
hoaerr:28500
Exiting hgolofns at 2015/08/27-14:00:07
Failed to load ODBC library symbol: /usr/lib64/libmyodbc5a.so(SQLColAttributeW)
Exiting hgolofn, rc=28500 at 2015/08/27-14:00:07
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
UNICODE version (/usr/lib64/libmyodbc5w.so)
[...skipped...]
Entered hgolofns at 2015/08/27-14:01:46
libname=/usr/lib64/libmyodbc5w.so, funcname=SQLSetDescRec
peflerr=6521, libname=/usr/lib64/libmyodbc5w.so, funcname=SQLSetDescRec
hoaerr:28500
Exiting hgolofns at 2015/08/27-14:01:46
Failed to load ODBC library symbol: /usr/lib64/libmyodbc5w.so(SQLSetDescRec)
Exiting hgolofn, rc=28500 at 2015/08/27-14:01:46
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. enable yum repository "MySQL community) (rpm -ihv https://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm)
3. create odbc connection to some mysql server:
==========[/etc/odbc.ini]=========
[customers]
Description = Customers Database on the MariaDB Cluster
Driver = MySQL ODBC 5.3 Unicode Driver
#Driver = MySQL ODBC 5.3 ANSI Driver
Database = customers
Server = 10.10.10.217
User = oracle
Password = password
Port = 3306
CHARSET = utf8
==============================
4. 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/libmyodbc.so
#HS_FDS_SHAREABLE_NAME = /usr/lib64/libmyodbc5a.so
HS_FDS_SHAREABLE_NAME = /usr/lib64/libmyodbc5w.so
set ODBCINI= /etc/odbc.ini
HS_NLS_NCHAR=AL32UTF8
HS_LANGUAGE=american_america.al32utf8
HS_FDS_TRACE_LEVEL = 4
===============================================
5. 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)
)
)
=======================================================
6. restart listener:
$ lsnrctl stop; lsnrctl start
7. create database link in oracle:
$ sqlplus "/as sysdba" <<EOF
create public database link mysql
connect to "oracle"
identified by "password"
using 'mysql';
EOF
8. test the link:
$ sqlplus "/as sysdba" <<EOF
select 'x' from dual@MYSQL;
EOF
9. check the logfile at the /opt/oracle/product/11.2.0/db_1/hs/log/