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

SAP Sybase SQL Anywhere 16.0 » MobiLink - Getting Started » MobiLink tutorials » Tutorial: Simulating multiple MobiLink clients using the MobiLink Replay utility

 

Lesson 5: Setting up your MobiLink client database

MobiLink is designed for synchronization involving a consolidated database server and a large number of mobile databases. In this lesson, you create a remote database, create a T1 table, which you synchronize with the consolidated database, and create a synchronization publication, user, and subscription.

Prérequis

This lesson assumes you have completed all preceding lessons. See Lesson 1: Setting up your MobiLink consolidated database.

This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Simulating multiple MobiLink clients using the MobiLink Replay utility.

Contexte et remarques

In this lesson, you use a SQL Anywhere database for your consolidated database and your MobiLink client. For tutorial purposes, your MobiLink client, consolidated database, and MobiLink server all reside on the same computer.

To set up the MobiLink client database, you create a T1 table for the remote database. The T1 table corresponds to the T1 table on the consolidated database. The MobiLink server uses SQL-based scripts to synchronize product quantities.

You create a synchronization user, publication, and subscription on the client database after creating the tables. Publications identify the tables and columns on your remote database that you want synchronized. These tables and columns are called articles. A synchronization subscription subscribes a MobiLink user to a publication.

 Task
  1. Create your MobiLink client databases using the dbinit command line utility.

    Run the following command to create the remote database:

    dbinit -dba DBA,sql remote.db
  2. Start your MobiLink client database using the dbeng16 command line utility.

    Run the following command to start the remote database:

    dbeng16 remote
  3. Connect to the remote database using Interactive SQL.

    Run the following command:

    dbisql -c "SERVER=remote;UID=DBA;PWD=sql"
  4. Create the T1 table for the remote database.

    Execute the following SQL statements in Interactive SQL:

    CREATE TABLE T1 (
        pk1      INTEGER,
        pk2      INTEGER,
        c1       VARCHAR(30000),
        PRIMARY KEY(pk1,pk2)
    );
    
    SET OPTION PUBLIC.ml_remote_id = '0';
  5. Create your MobiLink synchronization user, publication, and subscription for the remote database.

    Execute the following SQL statement in Interactive SQL:

    CREATE PUBLICATION P1 ( TABLE T1 );
    CREATE SYNCHRONIZATION USER U1;
    CREATE SYNCHRONIZATION SUBSCRIPTION TO P1 FOR U1 TYPE 'TCPIP' ADDRESS 'host=localhost;port=2439';
  6. Keep Interactive SQL open for the next lesson.

Résultat

A remote database, T1 table, synchronization publication, user, and subscription are created.

 See also