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 (manual)

You can manually rebuild a database involved in synchronization or replication.


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

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

Context and remarks

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.

  1. Shut down the database.

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

  3. Run the dbtran utility to display the starting offset and ending offset of the database's current transaction log file.

    Note the ending offset for use in Step 8.

  4. Rename the current transaction log file so that it is not modified during the unload process, and place this file in the dbremote offline logs directory.

  5. Rebuild the database.

  6. Shut down the new database.

  7. Erase the current transaction log file for the new database.

  8. Use dblog on the new database with the ending offset noted in Step 3 as the -z option, and also set the relative offset to zero.

    dblog -x 0 -z 0000698242 -ir -is database-name.db
  9. When you run the Message Agent, provide it with the location of the original offline directory on its command line.

  10. Start the database. You can now allow user access to the reloaded database.


The database is reloaded and started.

 See also