IBM SPSS Modeler Server and the data access pack
If you want to use the ODBC drivers with IBM® SPSS® Modeler Server, the ODBC environment must be configured by odbc.sh when the IBM SPSS Modeler Server process starts. You do this by editing the appropriate IBM SPSS Modeler start up script, either in modelersrv.sh, rc.modeler, or in both. (See Editing Scripts for more information. )
For more information, see the Technical Support web site at http://www.ibm.com/support. If you have questions about creating or setting permissions for ODBC data sources, contact your database administrator.
To configure ODBC to start with IBM SPSS Modeler Server
- Stop the IBM SPSS Modeler Server host if it is running.
- Download the relevant compressed TAR archive for the platform on which you have IBM SPSS Modeler Server installed. Make sure that you download the correct drivers for your installed version of IBM SPSS Modeler Server. Copy the file to the location where you want to install the ODBC drivers (for example, /usr/spss/odbc).
- Extract the TAR archive file using tar -xvof.
- Run the setodbcpath.sh script that is extracted from the archive.
- Edit the script odbc.sh to add the definition of
ODBCINI to the bottom of this script and export it, for example:
ODBCINI=/usr/spss/odbc/odbc.ini; export ODBCINI
ODBCINI must point to the full pathname of the odbc.ini file that you want IBM SPSS Modeler to read to get a list of the ODBC datasources that you define (a default odbc.ini is installed with the drivers).
- Save odbc.sh.
- (64-bit IBM SPSS Modeler Server installations only; for
other installations, continue from the next step) Define and export LD_LIBRARY_PATH_64 in
odbc.sh:
if [ "$LD_LIBRARY_PATH_64" = "" ]; then LD_LIBRARY_PATH_64=<library_path> else LD_LIBRARY_PATH_64=<library_path>:$LD_LIBRARY_PATH_64 fi export LD_LIBRARY_PATH_64
where library_path is the same as for the LD_LIBRARY_PATH definition already in the script that has been initialized with your installation path (for example, /usr/spss/odbc/lib). The easiest way to do this is to copy the
if
andexport
statements for LD_LIBRARY_PATH in your odbc.sh file, append them to the end of the file, and then replace the "LD_LIBRARY_PATH" strings in the newly appendedif
andexport
statements with "LD_LIBRARY_PATH_64".As an example, your final odbc.sh file on a 64-bit IBM SPSS Modeler Server installation might look like this:
if [ "$LD_LIBRARY_PATH" = "" ]; then LD_LIBRARY_PATH=/usr/spss/odbc/lib else LD_LIBRARY_PATH=/usr/spss/odbc/lib:$LD_LIBRARY_PATH fi export LD_LIBRARY_PATH if [ "$LD_LIBRARY_PATH_64" = "" ]; then LD_LIBRARY_PATH_64=/usr/spss/odbc/lib else LD_LIBRARY_PATH_64=/usr/spss/odbc/lib:$LD_LIBRARY_PATH_64 fi export LD_LIBRARY_PATH_64 ODBCINI=/usr/spss/odbc/odbc.ini; export ODBCINI
Remember to export LD_LIBRARY_PATH_64, as well as defining it with the
if
loop. - Edit the odbc.ini file that you defined earlier using $ODBCINI. Define the data source names that you require (these depend on the database that you are accessing).
- Save the odbc.ini file.
- Configure IBM SPSS Modeler Server to use these drivers. To
do so, edit modelersrv.sh and add the following line immediately below the line
that defines SCLEMDNAME:
. <odbc.sh_path>
where odbc.sh_path is the full path to the odbc.sh file that you edited near the beginning of this procedure, for example:
. /usr/spss/odbc/odbc.sh
Note: The syntax is important here; be sure to leave a space between the first period and the path to the file. - Save modelersrv.sh.
To test the connection
- Restart IBM SPSS Modeler Server.
- Connect to IBM SPSS Modeler Server from a client.
- On the client, add a Database source node to the canvas.
- Open the node and verify that you can see the data source names that you defined in the odbc.ini file earlier in the configuration procedure.
If you do not see what you expect here, or you get errors when you try to connect to a data source that you have defined, follow the Troubleshooting procedure. See the topic Troubleshooting ODBC configuration for more information.
To configure ODBC to start with IBM SPSS Modeler Solution Publisher Runtime
When you can successfully connect to the database from IBM SPSS Modeler Server, you can configure an IBM SPSS Modeler Solution Publisher Runtime installation on the same server by referencing the same odbc.sh script from the startup script of IBM SPSS Modeler Solution Publisher Runtime.
- Edit the modelerrun script in IBM SPSS Modeler Solution Publisher Runtime to add the
following line immediately above the last line of the script:
. <odbc.sh_path>
where odbc.sh_path is the full path to the odbc.sh file that you edited near the beginning of this procedure, for example:
. /usr/spss/odbc/odbc.sh
Note: The syntax is important here. Be sure to leave a space between the first period and the path to the file. - Save the modelerrun script file.
- By default, the DataDirect Driver Manager is not configured for IBM SPSS Modeler Solution Publisher Runtime to use ODBC on
UNIX systems. To configure UNIX to load the DataDirect Driver Manager, enter the following commands
(where sp_install_dir is the installation directory of Solution Publisher
Runtime):
cd sp_install_dir rm -f libspssodbc.so ln -s libspssodbc_datadirect.so libspssodbc.so
To configure ODBC to start with IBM SPSS Modeler Batch
No configuration of the IBM SPSS Modeler Batch script is necessary for ODBC. This is because you connect to IBM SPSS Modeler Server from IBM SPSS Modeler Batch in order to run streams. Ensure that the IBM SPSS Modeler Server ODBC configuration has been made and is working correctly, as described earlier in this section.
To add or edit a data source name
- Edit the odbc.ini file to include the new or changed name.
- Test the connection as described earlier in this section.
When the connection with IBM SPSS Modeler Server is working correctly, the new or changed data source should also work correctly with IBM SPSS Modeler Solution Publisher Runtime and IBM SPSS Modeler Batch.
SQL Server support with the Data Access Pack driver
The ODBC configuration for SQL Server must have the Enable Quoted
Identifiers
ODBC connection attribute set to Yes
(the default for this
driver is No
). On UNIX this attribute is configured in the system information file
(odbc.ini) using the QuotedId
option.