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 16 - Changes and Upgrading » How to upgrade to SQL Anywhere 16 » The rebuild process for version 9 and earlier databases


Rebuilding a version 9 or earlier database using the Unload utility (command line)

You can use the Unload utility (dbunload) -an or -ar option to rebuild a version 9 or earlier database. Rebuilt databases support all new features and performance enhancements in the latest software version.


The database user specified in the connection-string must have the SELECT ANY TABLE and SERVER OPERATOR system privileges.

It is recommended that you back up your database before rebuilding it.

The database file must be located on the same computer as the SQL Anywhere 16 installation.

Follow the standard precautions for upgrading software. See Upgrade and rebuild precautions.

Ensure that you have exclusive access to the database to be unloaded and reloaded. No other users can be connected.

Ensure that the version 16 utilities are ahead of other utilities in your system path. See How to ensure that you are running the correct version of the utilities when you have multiple versions installed.

Context and remarks

The -an option is recommended because it creates a new database leaving the original database intact. The -ar option replaces your old database with a new version 16 database.

 Rebuild a version 9 or earlier database using the Unload utility (command line)
  1. Shut down all SQL Anywhere and Adaptive Server Anywhere database servers because the version 16 dbunload utility cannot be used against a database that is running on a previous version of the database server. For example:

    dbstop -c "DBF=mydb.db;UID=DBA;PWD=sql"
  2. If possible, defragment the drive where the new database will be stored because a fragmented drive can decrease database performance.

  3. Back up the database. For example:

    dbbackup -c "DBF=mydb.db;UID=DBA;PWD=sql" old-db-backup-dir

    You must have the BACKUP DATABASE system privilege. See Backing up databases.

  4. Run the Unload utility (dbunload) using the -an or -ar option to create a new database.

    dbunload -c "connection-string" -an database-filename

    For example:

    dbunload -c "DBF=mydb.db;UID=DBA;PWD=sql" -an mydb16.db

    This command creates a database (by specifying -an). If you specify the -ar option, the existing database is replaced with a rebuilt database. To use the -ar option, you must connect to a personal database server or to a network database server on the same computer as the Unload utility (dbunload).


The database is upgraded to the latest version. By default, the database is stopped and restarted.


Examine the new database to confirm that the rebuild completed properly and test the rebuilt database with your application.

 See also