The Create Synchronization Model Wizard provides step-by-step instructions for setting up synchronization between the consolidated database and remote database.
Start Sybase Central.
Choose Tools » MobiLink 11 » Set Up MobiLink Synchronization.
On the Welcome page, in the What Do You Want To Name The New Synchronization Model field, type sync_ase and specify a location for your new model. Click Next.
On the Primary Key Requirements page, select all three checkboxes (you guarantee unique primary keys in Lesson 2). Click Next.
On the Consolidated Database Schema page do the following:
Click Choose The Consolidated Database.
Click ODBC Data Source Name and choose ase_cons.
In the User ID field, type sa.
In the Password field, type sa.
Click OK.
If this is the first time the consolidated database has been used by MobiLink, a message appears asking if you want to install the MobiLink system setup. Click Yes.
Click Next.
On the Remote Database Schema page, click No, Create A New Remote Database Schema. Click Next.
On the New Remote Database Schema page, in the Which Consolidated Database Tables Do You Want To Have In Your Remote Database list, select the following tables:
Click Next.
On the Download Type page, click Timestamp-based Download. Click Next.
Choosing timestamp-based downloads minimizes the amount of data that is transferred because only data that has been updated since the last download is transmitted.
On the Timestamp Download Options page, click Use Shadow Tables To Hold Timestamp Columns. Click Next.
Using shadow tables is often preferred because it does not require any changes to existing tables.
On the Download Deletes page, do the following:
In the Do You Want Data Deleted On The Consolidated Database To Be Deleted On The Remote Databases field, click Yes.
Click Use Shadow Tables To Record Deletions.
MobiLink creates shadow tables on the consolidated database to implement deletions.
Click Next.
On the Download Subset page, click Yes, Download the Same Data to Each Remote. Click Next.
In Step 2 of the Model mode lesson, you specify how to download specific data to a remote database by using custom logic.
On the Upload Conflict Detection page, click No Conflict Detection. Click Next.
Although this tutorial specifies no conflict detection, many applications require conflict detection.
On the Publication, Script Version and Description page, do the following:
In the What Do You want To Name The Publication field, type sync_ase_publication.
In the What Do You Want To Name The Script Version field, type sync_ase_scriptversion.
The publication is the object on the remote database that specifies what data is synchronized. MobiLink server scripts define how uploaded data from remotes should be applied to the consolidated database, and script versions group scripts. You can use different script versions for different applications, allowing you to maintain a single MobiLink server while synchronizing different applications.
Click Finish.
Your model appears in Model mode.
To specify the direction data is synchronized, set the directions in the Mapping Direction column as follows:
Filter the rows downloaded to the remote database by remote ID:
For the stores table, change the Download Subset to Custom.
Open the Download Subset tab at the bottom of the screen.
The remote ID uniquely identifies a remote database. To filter rows by remote ID, add a restriction to the WHERE clause of the download_cursor script. To do this, type the following search condition in the SQL Expression To Use In The Download Cursor's WHERE Clause text box:
"dbo"."stores"."stor_id" = {ml s.remote_id} |
The download cursor script specifies what columns and rows are downloaded from each table to the remote database. The search condition ensures that you only download information about one store, namely, the store that has an identifier that equals the remote ID for the database.
Follow these steps for the sales, salesdetail, and discounts tables. Make sure you rename the table in the expression appropriately.
Save the synchronization model.
The synchronization model is complete and ready to be deployed.
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |