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 10 and later databases

 

Rebuilding a database (command line)

You can use the dbunload utility to upgrade a version 10 or later SQL Anywhere database to the latest version.

Prerequisites

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

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

Ensure that you have exclusive access to the database being upgraded and ensure that the path of the version 16 utilities is ahead of the path of the 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.

Ensure that the database is backed up before unloading and reloading. For example:

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

Context and remarks

When using dbunload with a version 10 or later database, the version of dbunload used must match the version of the database server used to access the database. If an older version of dbunload is used with a newer database server, or vice versa, an error is returned.

If you are rebuilding a database that is a remote database in a MobiLink installation or that is involved in SQL Remote replication, and if you use the dbunload utility, you must be sure to use the -ar or -an option. These options ensure that the transaction log offsets for the new database are set to match those of the old database.

 Rebuild a database (command line)
  1. Run the Unload utility (dbunload) and use the -an option to create a database.

    dbunload -c "connection-string" -an new-db-file

    This command creates a database. To replace the existing database with an upgraded database, use the -ar option instead of -an. To use the -ar option, connect to a personal database server, or to a network database server on the same computer as the Unload utility (dbunload).

    For information about other Unload utility (dbunload) options, see Unload utility (dbunload).

  2. Shut down the database and archive the transaction log before using the reloaded database.

    To change the characteristics of the database during unload and reload (for example, change a case-sensitive database to a case-insensitive database), the procedure is more involved. See Database rebuilds.

Results

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

Next

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

 See also