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

SQL Anywhere 11.0.0 » MobiLink - Getting Started » MobiLink Tutorials » Tutorial: Using MobiLink with an Adaptive Server Enterprise consolidated database

 

Lesson 7: Synchronize

Now you are ready to synchronize the remote client for the first time. This is done with the MobiLink client program dbmlsync. Dbmlsync connects to the remote database, authenticates itself with the MobiLink server, and performs all of the uploads and downloads necessary to synchronize the remote and consolidated databases based on a publication in the remote database.

To synchronize the remote client

  • At a command prompt, run the following command, all on one line:

    dbmlsync
       -c "eng=remote_eng;dbn=remote_db;uid=DBA;pwd=sql;"
       -n sync_ase_publication
       -u ase_remote -mp ase_pass
    • dbmlsync   is the synchronization application.

    • eng=remote_eng   specifies the name of the remote database server.

    • dbn=remote_db   specifies the name of the remote database.

    • uid   is the user name used to connect to the remote database.

    • pwd   is the password used to connect to the remote database.

    • sync_ase_publication   is the name of the publication on the remote device that is used to perform the synchronization. (This publication was created by the Create Synchronization Model Wizard.)

    • ase_remote   is the user name used to authenticate with the MobiLink server.

    • ase_pass   is the password used to authenticate with the MobiLink server.

    A SQL Anywhere MobiLink Client messages window appears. The messages window shows you the progress. When this command runs successfully, the dbmlsync application populates the remote database with a subset of information from the consolidated database.

    If synchronization fails, you can start by checking the connection information you pass to the dbmlsync application, as well as the MobiLink user name and password. Failing that, check the publication name you used, and ensure the consolidated database and MobiLink server are running. You can also examine the contents of the synchronization logs (server and client).

    Note

    If you are running the dbmlsync application on a different computer from your MobiLink server, you must also pass in arguments that specify the location of the MobiLink server.

View the data

After successfully synchronizing the remote client to the consolidated database through the MobiLink server, the remote data should be populated with information relevant to one store. You can verify this in Sybase Central using the SQL Anywhere 11 plug-in.

To view the data in the remote database

  1. Start Sybase Central.

  2. Connect to the remote database:

    1. On the left pane, right-click SQL Anywhere 11 and choose Connect.

      A Connect window appears.

    2. Type DBA as the User Id and sql as the Password.
    3. Under the Identification tab, type remote_eng as the Server Name and remote_db as the Database Name.
    4. Click OK.
  3. If the tables created from the consolidated database are not visible, perform the following steps:

    1. Right-click remote_db and Configure Owner Filter.

      The Configure Owner Filter window appears.

    2. Select dbo and click OK.

      The tables created from the consolidated database appear in the left pane. Ownership of these tables by dbo is preserved in the remote database.

  4. Choose any remote table and then click the Data tab on the right pane.

    In the sales, salesdetail and stores tables, all the records are for the store with an identifier of 5023. This particular store is not concerned with the sales information of other stores. For this reason, you set the synchronization scripts to filter out rows by the remote ID, and you set this database's remote ID to the value of a particular store identifier. Now this particular store's database takes up less space, and requires less time to synchronize. Since the remote database size is kept to a minimum, frequently performed operations such as entering a new sale or processing a refund on a previous sale run faster and more efficiently.

Further reading