Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » MobiLink - Getting Started » Exploring the CustDB Sample for MobiLink » CustDB setup

CustDB setup Next Page

Setting up the CustDB consolidated database


The CustDB consolidated database may be SQL Anywhere, Sybase Adaptive Server Enterprise, Microsoft SQL Server, Oracle, or IBM DB2.

SQL Anywhere CustDB

A SQL Anywhere CustDB consolidated database is provided in samples-dir\UltraLite\CustDB\custdb.db. A DSN called SQL Anywhere 10 CustDB is included with your installation.

You can rebuild this database using the file samples-dir\UltraLite\CustDB\newdb.bat.

If you want to explore the way the CustDB sample is created, you can view the file samples-dir\MobiLink\CustDB\syncsa.sql.

CustDB for other RDBMSs

The following SQL scripts are provided in samples-dir\MobiLink\CustDB to build the CustDB consolidated database as any one of these supported RDBMSs:

RDBMSCustdb setup script
Adaptive Server Enterprisecustase.sql
Microsoft SQL Servercustmss.sql
Oraclecustora.sql
IBM DB2custdb2.sql

The following procedures create a CustDB consolidated database for each of the supported RDBMS.

For more information about preparing a database for use as a consolidated database, see Setting up a consolidated database.

To set up a consolidated database (Adaptive Server Enterprise, Oracle, or SQL Server)
  1. Create a database in your RDBMS.

  2. Add the MobiLink system tables by running one of the following SQL scripts, located in the MobiLink\setup subdirectory of your SQL Anywhere 10 installation:

  3. Add sample user tables to the CustDB database by running one of the following SQL scripts, located in the Samples\MobiLink\CustDB subdirectory of your SQL Anywhere 10 installation:

  4. Create an ODBC data source called CustDB that references your database on the client machine.

To set up a consolidated database (IBM DB2)
  1. Create a DB2 database on the DB2 server. For the purposes of this tutorial, call it CustDB.

  2. Ensure that the default table space (usually called USERSPACE1) uses 8 KB pages.

    If the default table space does not use 8 KB pages, complete the following steps:

  3. Add the MobiLink system tables to the DB2 consolidated database using the file MobiLink\setup\syncdb2long.sql:

  4. In order for DB2 to use the stored procedures defined in syncdb2long.sql, you must copy the syncdb2long_version Java and class files located in the MobiLink\setup subdirectory of your SQL Anywhere installation to the FUNCTION subdirectory of your DB2 installation.

  5. Copy custdb2.class, located in the Samples\MobiLink\CustDB subdirectory of your SQL Anywhere installation, to the SQLLIB\FUNCTION directory on your DB2 server machine. This class contains procedures used for the CustDB sample.

  6. Add data tables to the CustDB database:

  7. Create an ODBC data source called CustDB that references the DB2 database on the DB2 client machine.

  8. Run the custdb2setuplong Java application on the DB2 client machine as follows. This application resets the CustDB example in the DB2 database. After the initial setup, you can run this application at any time to reset the DB2 CustDB database by typing the same command line.

See also