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

SAP Sybase SQL Anywhere 16.0 » MobiLink - Client Administration » SQL Anywhere clients for MobiLink » SQL Anywhere clients » Using a SQL Anywhere database as a remote database

 

Deploying MobiLink remote databases by customizing a prototype

To deploy SQL Anywhere remote databases, you need to create the databases and add the appropriate publications. To do this, you can customize a prototype remote database.

Prerequisites

There are no prerequisites for performing this task.

Context and remarks

When deploying a starter database to multiple locations, it is safest to deploy databases that have a null remote ID. If you have synchronized the databases to prepopulate them, you can set the remote ID back to null before deployment. This method ensures that the remote ID is unique because the first time the remote database synchronizes, a unique remote ID is assigned. Alternatively, the remote ID can be set as a remote setup step, but it must be unique.

When you use the Create Synchronization Model Wizard to create your MobiLink client application, you can deploy your database using a wizard.

 Task
  1. Create a prototype remote database.

    The prototype database should have all the tables and publications that are needed, but not the data that is specific to each database. This information typically includes the following:

    • The MobiLink user name.

    • Synchronization subscriptions.

    • The global_database_id option that provides the starting point for global autoincrement key values.

  2. For each remote database, perform the following operations:

    1. Create a directory to hold the remote database.

    2. Copy the prototype remote database into the directory.

    3. If the transaction log is held in the same directory as the remote database, the transaction log file name does not need to be changed.

    4. Run a SQL script that adds the individual information to the database.

      The SQL script can be a parameterized script.

Results

The remote databases are deployed.

Example

The following SQL script is taken from the Contact sample. It can be found in %SQLANYSAMP16%\MobiLink\Contact\customize.sql.



PARAMETERS ml_userid, db_id;
go
SET OPTION PUBLIC.global_database_id = {db_id}
go
CREATE SYNCHRONIZATION USER {ml_userid}
        TYPE 'TCPIP'
        ADDRESS 'host=localhost;port=2439'        
go
CREATE SYNCHRONIZATION SUBSCRIPTION TO "DBA"."Product"
        FOR {ml_userid}
go
CREATE SYNCHRONIZATION SUBSCRIPTION TO "DBA"."Contact"
        FOR {ml_userid}
go
commit work
go

The following command executes the script for a remote database with data source dsn_remote_1:

dbisql -c "DSN=dsn_remote_1" read customize.sql [SSinger] [2]

 See also