UltraLite Synchronization utility (ulsync)

Synchronizes an UltraLite database with a MobiLink server. This tool can be used for testing synchronization during application development.

Syntax
ulsync -c "connection-string" [ options ]  [synchronization parameters { REPLACE | MERGE } profile-string ]
Option Description
-c "connection-string" Required. Connect to the database as identified in the DBF or file_name parameter of your connection-string. If you do not specify both a user ID and a password, the default UID of DBA and PWD of sql are assumed.
-oa Cancel the process if it identifies that the database was created by a previous version of UltraLite (which would cause the database to be upgraded).
-or

Synchronize the database in read-only mode. UltraLite makes a copy of the original file, and then uses the copy to test your scripts without altering the database. Changes to the copied file are discarded upon completion.

If you are connecting directly from the desktop to a database already deployed to a Windows Mobile device, the parameter is not supported.

-ou Upgrade the database if it was created with an older UltraLite release.
-p Synchronize using the named sync profile, equivalent to:
synchronize profileName merge 'syncOptions'
where sync options are taken from the trailing ulsync options. For example:
ulsync -p profileName "MobiLinkUid=ml;ScriptVersion=Version001...syncOptions"

See Synchronization profile options.

-q Set the utility to run in quiet mode. Suppress informational banners, version numbers, and status messages. Error messages are still displayed, however.
-r Display last synchronization results and exit.
-s Run available SQL passthrough scripts after syncing.
-v Display synchronization progress messages. This also determines whether progress is displayed for any synchronization, whether using the C++ API or the SQL synchronize profile statement. See UltraLite CREATE SYNCHRONIZATION PROFILE statement.
Remarks

The following options that were valid for versions 10 and preceding are no longer supported: -a authenticate-parameters, -e sync-parms, -k stream-type, -n (no sync), and -x protocol options. -e <keyword>=<value> is now part of the sync parameters string and -k and -x have been folded into the Stream=<stream{<stream-parms>} sync parameters string.

ulsync can be considered to be equivalent to one the following SQL statements, depending on usage:

ulsync -p <profile> "<parms>"

is equivalent to:

 SYNCHRONIZE PROFILE <profile> MERGE
<parms>

and

ulsync "<parms>"

is equivalent to:

 SYNCHRONIZE USING <parms>

For secure synchronization, the UltraLite application must have access to the public certificate. You can reference a certificate by:

  • Incorporating the certificate information into the UltraLite database at creation time with the -t file option using ulinit, ulload, or ulcreate.

  • Referencing an external certificate file at synchronization time with the trusted_certificates=file stream option.

This utility returns error codes. Any value other than 0 means that the operation failed.

See also
Examples

The following command synchronizes a database file called myuldb.udbfor a MobiLink user called remoteA.

ulsync -c DBF=myuldb.udb "MobiLinkUid=remoteA;Stream=http;ScriptVersion=2"

The following command synchronizes a database file calledmyuldb.udb over HTTPS with the c:\certs\rsa.crt certificate. The trusted_certificates=file option must be used because the trusted certificate file was not added to the database when the database was created. Additionally, the MobiLink user name is remoteB.

ulsync -c DBF=myuldb.udb "Stream=https{trusted_certificates=c:\certs\rsa.crt};
MobiLinkUid=remoteB;ScriptVersion=2;UploadOnly=ON"

The following command displays the last synchronization results for a database file named synced.udb.

ulsync -r -c dbf=synced.udb

The previous synchronization results are listed as follows:

SQL Anywhere UltraLite Database Synchronize Utility Version XX.X
    Results of last synchronization:
    Succeeded
        Download timestamp: 2006-07-25 16:39:36.708000
        Upload OK
        No ignored rows
        Partial download retained
        Authentication value: 1000 (0x3e8)

The following example shows the command line used to synchronize the CustDB database with a user name of 50 over TCP/IP on a port of 2439. It uses verbose progress messages.

ulsync -c "dbf=C:\Documents and Settings\All Users\Documents\SQL Anywhere 11\Samples\UltraLite\SyncEncrypt\custdb.udb" 
MobiLinkUid=50;ScriptVersion=custdb 11.0;Stream=tcpip{port=2439}