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

SQL Anywhere 10.0.1 » MobiLink - Client Administration » SQL Anywhere Clients » Creating a remote database

Creating a remote database Next Page

Deploying remote databases


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

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 pre-populate them, you can set the remote ID back to NULL before deployment. This method ensures that the remote ID will be 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.

See Setting remote IDs.

To deploy MobiLink remote databases by customizing a prototype
  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:

  2. For each remote database, carry out the following operations:

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

    See also
    Example

    The following SQL script is taken from the Contact sample. It can be found in samples-dir\MobiLink\Contact\customize.sql. (For information about samples-dir, see Samples directory.)

    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'
            OPTION MEM=''
    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 line executes the script for a remote database with data source dsn_remote_1:

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