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

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - SQL Usage » Data import and export » Database rebuilds


Rebuilding databases involved in synchronization or replication (command line)

You can rebuild a database involved in synchronization or replication using the dbunload -ar option, which unloads and reloads the database in a way that does not interfere with synchronization or replication.


You must have the SELECT ANY TABLE and SERVER OPERATOR system privileges.

All subscriptions must be synchronized before rebuilding a database participating in MobiLink synchronization.

Contexte et remarques

This section applies to SQL Anywhere MobiLink clients (clients using dbmlsync) and SQL Remote.

Synchronization and replication are based on the offsets in the transaction log. When you rebuild a database, the offsets in the old transaction log are different than the offsets in the new log, making the old log unavailable. For this reason, good backup practices are especially important for databases participating in synchronization or replication.


You can use other dbunload options to specify a running or non-running database and database parameters.

  1. Shut down the database.

  2. Perform a full off-line backup by copying the database and transaction log files to a secure location.

  3. Run the following dbunload command to rebuild the database:

    dbunload -c connection-string -ar directory

    The connection-string is a connection with appropriate privileges, and directory is the directory used in your replication environment for old transaction logs. There can be no other connections to the database.

    The -ar option only applies to connections to a personal server, or connections to a network server over shared memory.

  4. Shut down the new database and then perform the validity checks that you would usually perform after restoring a database.

  5. Start the database using any production options you need. You can now allow user access to the reloaded database.


The database is reloaded and started.

 See also