This lesson assumes you have completed all preceding lessons. See Lesson 1: Setting up your MobiLink consolidated 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. You must perform the following tasks:
Create a T1 table, which you synchronize with the consolidated database.
Create a synchronization publication, user, and subscription.
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:
Start your MobiLink client database using the dbeng12 command line utility.
Run the following command to start the remote database:
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.
Proceed to Lesson 6: Recording synchronization.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|