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.
Prerequisites
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.
Context and remarks
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.
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 |
Start your MobiLink client database using the dbeng16 command line utility.
Run the following command to start the remote database:
dbeng16 remote |
Connect to the remote database using Interactive SQL.
Run the following command:
dbisql -c "SERVER=remote;UID=DBA;PWD=sql" |
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'; |
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'; |
Keep Interactive SQL open for the next lesson.
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |