MobiLink Synchronization User's Guide
Synchronization Basics
Consolidated database
Setting up a consolidated database
To set up IBM DB2 UDB version 6 or later to work as a MobiLink consolidated database, run the syncdb2long.sql setup script, located in the MobiLink\setup subdirectory of your SQL Anywhere installation. For IBM DB2 prior to version 6, run the syncdb2.sql setup script from the same location.
The syncdb2.sql and syncdb2long.sql scripts contain a default connection statement, connect to DB2Database
. You should make a copy of the script and alter this line to be appropriate for your installation. The syntax of the line must be:
connect to DB2Database user userid using password
where DB2Database, userid, and password are names you provide.
The syncdb2.sql and syncdb2long.sqlscripts use the tilde character (~) as a command delimiter. You can run the scripts as follows:
db2 -c -ec -td~ +s -v -f syncdb2long.sql
In addition, there are columns that require a LONG tablespace. If there is no default LONG tablespace, the creation statements for the tables containing these columns must be qualified appropriately, as in the following example.
CREATE TABLE ... ( ... ) IN tablespace LONG IN long-tablespace
The stored procedures in syncdb2.sql and syncdb2long.sql are implemented in Java in the files SyncDB2.class and syncdb2long.class. The source code is provided in SyncDB2.java and SyncDB2long.java. These scripts use the tilde character (~) as a command delimiter.
The default tablespace (usually called USERSPACE1) of a DB2 database that you wish to use as a consolidated database must use 8 kb pages.
For an example using the sample application, see The CustDB Sample Application.
For tips on using IBM DB2 as a MobiLink consolidated database, see DBMS-dependent scripts and Supported DBMS scripting strategies.
You must set up an ODBC DSN for your DB2 UDB consolidated database.
For Solaris, Linux, and AIX, SQL Anywhere Studio includes an iAnywhere Solutions ODBC driver for IBM DB2.
For Windows, we recommend that you use the ODBC driver provided by IBM.
You must configure the driver to work with MobiLink. For more information, see iAnywhere Solutions ODBC driver for DB2.