Use this statement to synchronize a SQL Anywhere database with a MobiLink server. The synchronization options can be specified in the statement itself.
SYNCHRONIZE { PROFILE sync-profile-name [ MERGE sync-option [ ;... ] ] | USING sync-option [ ;... ] | START | STOP }
[ PORT port-number ] [ VERBOSITY { LOW | NORMAL | HIGH } ] [ TIMEOUT timeout ] [ USER user-name IDENTIFIED BY password ]
sync-option-value : string
sync-profile-name The name of the synchronization profile to use for this synchronization.
MERGE clause Use this clause to add or override synchronization profile options.
USING clause Use this clause to specify synchronization profile options when you are not using a synchronization profile.
sync-option
A string of one or more synchronization profile option value pairs, separated by semicolons. For example, 'option1=value1;option2=value2'
.
PORT clause Use this clause to specify the port number that the database server uses to communicate with the dbmlsync utility. The default is 4433.
VERBOSITY clause This clause controls the amount of information that is added to the synchronize_results shared global temporary table during synchronization.
The following is a list of client API events that are returned by each VERBOSITY option. For descriptions of the options, see DBSC_Event structure.
Option | Returns |
---|---|
LOW |
|
NORMAL (default) |
|
HIGH |
|
The optional VERBOSITY parameter does not change the verbosity settings of your synchronization profile. When used with the SYNCHRONIZE statement, the VERBOSITY parameter specifies the amount of information that is added to the synchronize_results shared global temporary table. The verbosity settings of your synchronization profile define the verbosity of the DBSC_EVENTTYPE_INFO_MSG that is added to the dbmlsync log. If you modify the synchronization profile or use the MERGE option to change the synchronization profile verbosity from BASIC to BASIC,ROW_DATA, the number of rows placed in the synchronize_results shared global temporary table increases. For example, the following two statements result in different data being added to the synchronize_results shared global temporary table:
SYNCHRONIZE PROFILE SalesData VERBOSITY NORMAL; |
SYNCHRONIZE PROFILE SalesData MERGE 'Verbosity='BASIC,ROW_DATA' VERBOSITY NORMAL; |
TIMEOUT clause This clause specifies how long the database server waits, in seconds, for the synchronization to complete before attempting to cancel the synchronization. The default is 240 seconds.
USER / IDENTIFIED BY clause Use this clause to specify that database user id and password that the dbmlsync utility uses to synchronize the database. The user id specified must have REMOTE DBA or DBA authority. By default, synchronization uses the user id for database connection that issued the SYNCHRONIZE command.
START clause Starts the dbmlsync utility running in server mode and leaves it running. No synchronization is performed. When you are performing more than one synchronization in a short period, you can improve performance by explicitly starting the server using this clause, performing your synchronizations, then explicitly stopping the server using the STOP clause.
STOP clause Stops a dbmlsync utility running in server mode that was previously started using the START clause. No synchronization is performed.
When synchronization is complete, you can view the results of the synchronization in the synchronize_results shared global temporary table. The synchronize_results shared global temporary table stores the results of all synchronizations that have been executed with the SYNCHRONIZE statement since the database server was started. The synchronize_results shared global temporary table is truncated each time the database server is shut down.
You can use the synchronize_results shared global temporary table to monitor the progress of a synchronization on a connection that is different from your current connection. To monitor the progress of a synchronization on a different connection:
Execute SELECT CONNECTION_PROPERTY statement to determine the connection ID of the current connection.
Execute a SYNCHRONIZE statement to start synchronization.
On a separate connection, use the sp_get_last_synchronize_results system procedure to retrieve results using the connection ID you determined above.
To view the results of a synchronization that is complete or in progress on a specific connection, you can use the sp_get_last_synchronize_results system procedure.
The SYNCHRONIZE statement is similar to the UltraLite SYNCHRONIZE statement. However, the SQL Anywhere SYNCHRONIZE statement launches the dbmlsync utility in server mode to perform the synchronization. The UltraLite SYNCHRONIZE statement uses UltraLite runtime.
The database server functions as a dbmlsync API client and uses TCP/IP to communicate with a dbmlsync server. By default, this communication occurs on port 4433. Use the PORT clause to specify a different port.
Use the SYNCHRONIZE PROFILE and SYNCHRONIZE USING statements to perform a synchronization. Use the SYNCHRONIZE START and SYNCHRONIZE STOP to start or stop a dbmlsync server. When executing a SYNCHRONIZE PROFILE or SYNCHRONIZE USING statement, the database server attempts to connect to a dbmlsync server that is already running. If a dbmlsync server that is already running cannot be located, a dbmlsync server is started. When the synchronization is complete, the database server shuts down the dbmlsync server it started. If the statement connected to a dbmlsync server that was already running, the dbmlsync server is not shut down. If you are performing multiple synchronizations and do not want to start and stop the dbmlsync server for each synchronization, you may want to execute a SYNCHRONIZE START statement, followed by multiple SYNCHRONIZE PROFILE or SYNCHRONIZE USING statements, and end with a SYNCHRONIZE STOP statement.
REMOTE DBA or DBA authority
None
SQL/2008 Vendor extension.
The following example shows the syntax for synchronizing a synchronization profile named Test1:
SYNCHRONIZE PROFILE Test1; |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |