Creates a subscription in a SQL Anywhere remote database between a MobiLink user and a publication.
CREATE SYNCHRONIZATION SUBSCRIPTION[ subscription-name ] TO publication-name [ FOR ml-username, ... ] [ TYPE network-protocol ] [ ADDRESS protocol-options ] [ OPTION option=value, ... ] [ SCRIPT VERSION script-version ]
subscription-name: identifier
ml-username: identifier
network-protocol: http | https | tls | tcpip
protocol-options: string
value: string | integer
script-version: string
subscription-name A unique name that you can use to identify this subscription. It is strongly recommended that you name all your subscriptions.
FOR clause This clause specifies one or more MobiLink user names. If you specify more than one user name, a separate subscription is created for each user. If you specify a subscription name, only one MobiLink user name can be specified.
ml-username is a user who is authorized to synchronize with the MobiLink server.
For more information about synchronization user names, see Introduction to MobiLink users.
Omit the FOR clause to set the protocol type, protocol options, and extended options for a publication.
If the FOR clause is omitted, you cannot specify a subscription name or use the SCRIPT VERSION clause.
For information about how dbmlsync processes options that are specified in different locations, see Priority order.
TYPE clause This clause specifies the network protocol to use for synchronization. The default protocol is tcpip.
For more information about network protocols, see CommunicationType (ctp) extended option.
ADDRESS clause This clause specifies network protocol options such as the location of the MobiLink server. Multiple options must be separated with semicolons.
For a complete list of protocol options, see MobiLink client network protocol option summary.
OPTION clause This clause allows you to set extended options for the subscription. If no FOR clause is provided, the extended options act as default settings for the publication.
For information about how dbmlsync processes options that are specified in different locations, see Priority order.
For a complete list of options, see MobiLink SQL Anywhere client extended options.
SCRIPT VERSION clause This clause specifies the script version to use during synchronization. Typically, you must specify a new script version for each schema change you implement.
You cannot use the SCRIPT VERSION clause if the FOR clause is omitted.
For more information about MobiLink script versions, see Script versions.
If no subscription-name is specified, a unique name is generated. The generated subscription name is the same as the publication name, provided it is unique. Otherwise, a unique name is formed by adding a number to the end of the publication name, for example, pub001, pub002, and so on ).
The network-protocol, protocol-options, and option can be set in several places.
For information about how dbmlsync processes options that are specified in different locations, see Priority order.
This statement causes options and other information to be stored in the SQL Anywhere ISYSSYNC system table. Anyone with DBA authority for the database can view the information, which could include passwords and encryption certificates. To avoid this potential security issue, you can specify the information on the dbmlsync command line. See dbmlsync syntax.
DBA authority and exclusive access to all tables referenced in the publication.
Automatic commit.
SQL/2008 Vendor extension.
The following example creates a subscription named sales between the MobiLink user ml_user1 and the publication called sales_publication. When the subscription is synchronized, the script version sales_v1 is used and tables are locked in exclusive mode:
CREATE SYNCHRONIZATION SUBSCRIPTION sales TO sales_publication FOR ml_user1 OPTION locktables='exclusive' SCRIPT VERSION 'sales_v1' |
The following example omits the FOR clause and stores settings for the publication called sales_publication:
CREATE SYNCHRONIZATION SUBSCRIPTION TO sales_publication ADDRESS 'host=test.internal;port=2439; security=ecc_tls' OPTION locktables='exclusive'; |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |