This document discusses installing and configuring Microsoft ODBC Driver, Oracle Gateway, and connecting Oracle to SQL Server using ODBC on Linux. It involves downloading and installing the Driver Manager, Microsoft ODBC driver, Oracle gateway, configuring the ODBC DSN, gateway initialization file, listener, TNS descriptor, and creating a database link to connect Oracle to SQL Server. An example response file for configuring the gateway installation is also provided.
1. Using Microsoft ODBC and Oracle Gateway
1 Installing the Driver Manager
An ODBC application makes ODBC calls to the Driver Manager. The Driver
Manager carries out a number of tasks for the application such as ensuring the
proper driver is loaded/unloaded. You can download the DriverManager from
http://www.unixodbc.org. Here I use unixODBC-2.3.0 .
1.1Copy it to the Linux server and unzip it.
1.2Change to the unixODBC-2.3.0 directory.
1.3Execute : export CPPFLAGS="-DSIZEOF_LONG_INT=8"
1.4Execute : ./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --
enable-gui=no --enable-drivers=no --enable-iconv --with-iconv-char-
enc=UTF8 --with-iconv-ucode-enc=UTF16LE
3. 2 Installing Microsoft ODBC Driver for SQL Server on Linux
You can download the Microsoft ODBC Driver 11 for SQL Server on Linux from
here: https://www.microsoft.com/en-us/download/details.aspx?id=36437
2.1unzip msodbcsql-11.0.2270.0.tar.gz
2.2change to msodbcsql-11.0.2270.0
4. 2.3Execute the command: ./install.sh install
2.4After reviewing the license agreement, type YES to continue with the
installation.
2.5To verify that the ODBC driver on Linux was registered successfully,
execute the following command: odbcinst -q -d -n "ODBC Driver 11 for
SQL Server".
5. 3 installing oracle gateway
Oracle Database Gateways provide the ability to transparently integrate with non-
Oracle systems from an Oracle environment. You can download it from here:
http://www.oracle.com/technetwork/database/enterprise-
edition/downloads/database12c-linux-download-2240591.html
3.1Unzip the binaries
3.2Change to gateways
3.3Execute: ./runinstaller –silent –noconfig –responseFile ./gw.rsp
3.4Execute root.sh
6. 4 Configuring ODBC and Oracle Gateway
The configuring steps includes:
Configure ODBC DSN
Configure the Gateway Initialization Parameter File
Configure the Gateway Listener
Configure the Database TNS descriptor
Create the Database DB Links
4.1 configure /etc/odbc.ini,the /etc/odbc.iniislookslikebelow,where DEMOisthe DSN:
[DEMO]
Description=Microsoft ODBC Driver 11 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0
Server = 10.96.114.141
Port =
Language = English
Database = HUB
Logging = 0
LogFile =
QuotedId = Yes
AnsiNPW = Yes
Mars_Connection = No
4.2 verifythe connectivityof the DSN bysqlcmd
sqlcmd –D –S DEMO –U username
4.3 Change to $GATEWAY_HOME/hs/admin,create the initial parametersfile,example:
$vi initDEMO.ora
#
# HS init parameters