The Create Synchronization Model Wizard takes you through the steps of setting up synchronization between the consolidated database and remote database.
Start Sybase Central.
Click Tools » MobiLink 11 » Set Up MobiLink Synchronization.
Name the new synchronization model sync_oracle and type the location of the new model.
On the Primary Key Requirements page, click all three checkboxes.
On the Consolidated Database Schema page, connect to the consolidated database:
Click Choose The Consolidated Database.
Select ODBC Data Source Name and choose oracle_cons. 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. Installing the MobiLink system setup adds MobiLink system tables and procedures. Click Yes.
If you see an error message, ensure that the data source is configured properly.
Once the MobiLink system tables and procedures are added to the consolidated database, the name, user, product and version appear on the page. Click Next.
The tables from the consolidated database schemas are loaded.
Create a remote schema:
On the Remote Database Schema page, select No, Create A New Remote Database Schema and click Next.
On the New Remote Database Schema page, select the checkboxes for the following tables to include them in the remote schema and then click Next.
Choose and configure the download type:
On the Download Type page, select Timestamp-based Download.
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, select Use Shadow Tables To Hold Timestamp Columns.
Using shadow tables is often preferred because it does not require any changes to existing tables.
On the Download Deletes page, specify how to propagate record deletions to remote devices:
To indicate that you want the remote database to download deletes, select Yes.
Select Use Shadow Tables To Record Deletions.
MobiLink creates shadow tables on the consolidated database to implement deletions.
On the Download Subset page, specify that the remote database should download only a subset of data from the consolidated database:
Select Yes, Download The Same Data To Each Remote. (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, select No Conflict Detection.
Many applications require conflict detection, but this tutorial uses no conflict detection.
On the Publication, Script Version and Description page, type sync_oracle_publication as your publication and type sync_oracle_scriptversion as your script version.
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 ORDERS 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:
"OE"."ORDERS"."SALES_REP_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 salesperson, namely, the representative that has an identifier that equals the remote ID for the database.
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 |