On federated servers that run Linux or UNIX,
the federated server must be able to access Microsoft SQL
Server data sources. To prepare the federated server, you must verify
the settings in the odbc.ini file, and test the
connection to Microsoft SQL Server data
sources.
Before you begin
You must configure odbc.ini(DSN) in db2dj.ini
and use the node parameter when you create the server statement. Using odbc.ini (DSN-less)
to access Microsoft SQL Server data source through native wrapper
is not supported.
Procedure
- Verify that the odbc.ini file is updated
on the federated server. If the odbc.ini file
does not exist on the federated server, you can create it in a text
editor.
- Configure odbc.ini file.
Add
the
odbc.ini file location into
db2dj.ini. For
example, add this row into
db2dj.ini. file:
ODBCINI=$INSTANCE_HOME/odbc.ini
The
default driver directory is:
$INSTANCE_HOME/sqllib/federation/odbc/lib/FOsqls27.so
Example of odbc.ini file like this:
[ODBC]
InstallDir=/home/db2inst1/sqllib/federation/odbc
[mssql2014]
Driver=/home/db2inst1/sqllib/federation/odbc/lib/FOsqls27.so
HostName=xxx.xxx.ibm.com
PortNumber=1433
What to do next
After you complete this task, you can set the environment
variables.