Hi, My name is Jimmy Sam. If you need DBA help, please email to jimmy_sam001@yahoo.com for further discussion. Thanks.

Oracle Hetergeneous Database --- ODBC (hana)

1.  rpm -qa|grep -i odbc
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
unixODBC-2.2.14-14.el6.i686
unixODBC-devel-2.2.14-14.el6.i686
unixODBC-2.2.14-14.el6.x86_64
unixODBC-devel-2.2.14-14.el6.x86_64

2. $ORACLE_HOME/hs/admin/inittesthsdb.ora
initdh1hana.ora
HS_DB_NAME = HS1
HS_FDS_CONNECT_INFO = HS1
HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so
#HS_FDS_TRACE_LEVEL = FULL
#HS_FDS_SUPPORT_STATISTICS=FALSE
#HS_LANGUAGE = AMERICAN_AMERICA.US7ASCII
#HS_NLS_NCHAR = AMERICAN_AMERICA.US7ASCII
HS_LANGUAGE=AMERICAN_AMERICA.UTF8
HS_NLS_NCHAR=UCS2
HS_FDS_TRANSACTION_MODEL=READ_ONLY
set ODBCINI=/etc/odbc.ini

3. cat /etc/odbc.ini
cat /etc/odbc.ini
[HS1]
Driver=/usr/sap/hdbclient/libodbcHDB.so
ServerNode=hs1serverhost:30015
[TESTHSDB]
#Driver=/u01/oracle/DataDirect/Connect64_for_ODBC_71/lib/ddsqls27.so
#Description=DataDirect 7.0 SQL Server Wire Protocol
#HostName=10.10.20.21,1433
Database=mydb
LogonID=myusername
Password=mypassword
PortNumber=1433
EnableQuotedIdentifiers=1

4. listener.ora

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

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
       (SID_NAME =  testhsdb)
       (ORACLE_HOME = /u01/oracle/ora11.203)
       (PROGRAM = dg4odbc)
       (ENVS=LD_LIBRARY_PATH=/usr/sap/hdbclient:/usr/lib64:/u01/oracle/ora11.203/lib)
    )
)

5. tnsnames.ora

testhsdb =
  (DESCRIPTION =
    (ADDRESS=(PROTOCOL=TCP)(HOST=oracle_host_name)(PORT=1521))
    (CONNECT_DATA=(sid=testhsdb))
      (HS=OK)
  )

6. create database link:

CREATE PUBLIC DATABASE LINK LNK_TESTHSDB
CONNECT TO LNK_USER_TESTHSDB
IDENTIFIED BY 
USING 'TESTHSDB';

Hetergeneous Database --- ODBC (mysql)

-- grep -i ODBCINI init*.ora|cut -d: -f2-|sort -u
SET ODBCINI=/u01/oracle/DataDirect/Connect64_for_ODBC_71/etc/odbc.ini
set ODBCINI=/u01/oracle/mysqlodbc/unixODBC-2.3.1/etc/odbc.ini


$ORACLE_HOME/hs/admin/initMYSQLDB1.ora
HS_FDS_CONNECT_INFO = MYSQLDB1
HS_FDS_TRACE_LEVEL = OFF
#  other options: 0, 4, 7 or DEBUG or ON
#  (trace files in $ORACLE_HOME/hs/log)
HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P15
HS_FDS_SUPPORT_STATISTICS=FALSE
HS_FDS_SHAREABLE_NAME=/usr/lib64/libodbc.so
set ODBCINI=/u01/oracle/mysqlodbc/unixODBC-2.3.1/etc/odbc.ini
#
HS_OPEN_CURSORS=300
HS_FDS_QUOTE_IDENTIFIER=FALSE
HS_AUTOREGISTER=TRUE
HS_RPC_FETCH_REBLOCKING=OFF
HS_FDS_FETCH_ROWS=1
HS_FDS_DELAYED_OPEN=FALSE
HS_FDS_SUPPORT_STATISTICS=FALSE

odbc.ini
[MYSQLDB1]
Driver              = /usr/lib64/libmyodbc5.so
Description         = Connection to MySQL
Database            = ncl_drupal
Server              = 10.10.10.10
User                = myusername
UserName            = myusername
Password            = myusername_pass
Port                = 3306
CHARSET             = utf8
Trace               = no
Tracefile           = /tmp/trace_MYSQLDB1.log

Hetergeneous Database --- ODBC (mssql)

initMSSQLDB1.ora
# The agent init file that contains the HS parameters needed for an ODBC Agent.
#
HS_FDS_CONNECT_INFO = MSSQLDB1
HS_FDS_TRACE_LEVEL = OFF
#  other options: 0, 4, 7 or DEBUG or ON
#  (trace files in /u01/oracle/ora11.203/hs/log)
#HS_LANGUAGE = AMERICAN_AMERICA.US7ASCII
#HS_NLS_NCHAR = AMERICAN_AMERICA.US7ASCII
HS_FDS_SUPPORT_STATISTICS=FALSE
HS_FDS_SHAREABLE_NAME = /u01/oracle/DataDirect/Connect64_for_ODBC_71/lib/libodbc.so
SET ODBCINI=/u01/oracle/DataDirect/Connect64_for_ODBC_71/etc/odbc.ini

odbc.ini
[MSSQLDB1]
Driver=/u01/oracle/DataDirect/Connect64_for_ODBC_71/lib/ddsqls27.so
Description=DataDirect 7.0 SQL Server Wire Protocol
HostName=10.10.10.10,1433
Database=mydbname
LogonID=myusername
Password=mypassword
PortNumber=1433
EnableQuotedIdentifiers=1

Hetergeneous Database --- dg4msql (mssql)

initdg4msql.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server

#
# HS init parameters
#
HS_FDS_CONNECT_INFO=10.10.10.10:1433//MYDBNAME
# alternate connect format is hostname/serverinstance/databasename
#HS_FDS_TRACE_LEVEL=0
HS_FDS_RECOVERY_ACCOUNT=MYUSERNAME
HS_FDS_RECOVERY_PWD=MYPASSWORD
#HS_LANGUAGE=turkish_turkey.WE8ISO8859P9
HS_NLS_NCHAR=WE8ISO8859P9
#HS_FDS_TRACE_LEVEL=DEBUG

listener.ora
dg4msql =
(DESCRIPTION =
     (ADDRESS =(PROTOCOL= TCP)(HOST = oracledbhost)(PORT = 1521))
     (CONNECT_DATA=(SID=dg4msql) )
     (ENVS=LD_LIBRARY_PATH=/oracle/gateway/product/11.2.0/dg4msql/driver/lib;/oracle/gateway/product/11.2.0/lib)
     (HS=OK)
)

CREATE DATABASE LINK sqlserver CONNECT TO MYSQLUser IDENTIFIED BY "MYSQLPass" USING 'dg4msql';

How to Setup DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit (Doc ID 466225.1)

How to Setup DG4MSQL (Database Gateway for MS SQL Server) on Windows 32bit (Doc ID 466267.1)

odbc.ini and testing

export ODBCINI=$MYPATH/odbc.ini

${HOME}/.odbc.ini
/etc/odbc.ini

isql MY_DATA_SOURCE MY_USERNAME  MY_PASSWORD

Home   Oracle