Synchronizes an UltraLite database with a MobiLink server. This tool can be used for testing synchronization during application development.
ulsync -c [ options ] [synchronization parameters]
Option | Description | ||||
---|---|---|---|---|---|
@data | Use this to read in options from the specified environment variable or configuration file. If both exist with the same name, the environment variable is used. See Configuration files. | ||||
-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. | ||||
--log | Log operations to the specified file. | ||||
-p profile-name OR --profile=profile |
Synchronize using the named sync profile, equivalent to:
where sync options are taken from the trailing ulsync options. For example:
|
||||
-q OR --quiet |
Set the utility to run in quiet mode. Suppress informational banners, version numbers, and status messages. Error messages are still displayed, however. | ||||
-r OR --result |
Display last synchronization results and exit. | ||||
-v OR --verbose |
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 CREATE SYNCHRONIZATION PROFILE statement [UltraLite]. |
When a certificate file is specified either with the trusted_certificate or the e2ee_public_key option, the UltraLite runtime only looks for these files in the main resource bundle, which is a part of every iPhone application deployment package. You add items to this bundle by including them in the /Resources folder in your Xcode project. This is not applicable to certificates that are stored in the UltraLite database, and does not affect Mac OS clients (only iPhone). See trusted_certificate and e2ee_type.
The following options that were valid for versions 10 and earlier 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 are nopw part of 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 or ulload.
Referencing an external certificate file at synchronization time with the trusted_certificate=file stream option.
This utility returns error codes. Any value other than 0 means that the operation failed.
The following command synchronizes a database file called myuldb.udb for a MobiLink user called remoteA.
ulsync -c DBF=myuldb.udb "MobiLinkUid=remoteA;Stream=http;ScriptVersion=2" |
The following command synchronizes a database file called myuldb.udb over HTTPS with the c:\certs\rsa.crt certificate. The trusted_certificate=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_certificate=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 12\Samples\UltraLite\SyncEncrypt\custdb.udb" "MobiLinkUid=50;ScriptVersion=custdb 12.0;Stream=tcpip{port=2439}" |
The following command illustrates how to use TLS encryption with E2EE:
ulsync -c "uid=dba;pwd=sql;dbf=myudb.db" "MobiLinkUid=rem1;MobiLinkPwd=password;ScriptVersion=v1;Stream=tls{host=myServer;port=2439;trusted_certificate=c:\clientcert.pem;e2ee_type=rsa;e2ee_public_key=c:\e2eepublic.pem}" |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |