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 » Upgrades and rebuilds in a database mirroring system


Upgrading or rebuilding (unloading/reloading) the databases in a database mirroring system

Upgrade the primary database, and then copy the upgraded database and transaction log to the mirror. The mirroring system is temporarily stopped. Upgrading databases is generally performed when updating to a major version or minor release of the software.


You must have the BACKUP DATABASE system privilege. You must be the owner of the database, or have the VALIDATE ANY OBJECT system privilege.

By default, you must have the SERVER OPERATOR system privilege to start or stop network database servers.

To upgrade a database, you must have the ALTER DATABASE system privilege, and must be the only connection to the database

To rebuild (unload/reload) a database using the Unload utility (dbunload), you must have the SELECT ANY TABLE system privilege. For an unload with a reload, you must also have the SERVER OPERATOR system privilege.

Test the following steps in non-production environment with your application before performing the steps in a production environment.

 Apply a SQL Anywhere minor release to a database mirroring system
  1. Install the new version of the software on each computer in the system. All database servers in a database mirroring system must use the same maintenance version of SQL Anywhere.

  2. Make a backup of the primary database, copy the backup, and validate the copy of the backup.

    For example, run the following command to back up a database named mydb.db:

    dbbackup -c "DBN=mydb;ENG=myserver;UID=DBA;PWD=sql" backup-dir

    Create a copy of the backup:

    xcopy backup-dir\*.db validatebackup-dir\backupmydb.db

    Validate the backup copy:

    dbvalid -c "DBF=validatebackup-dir\backupmydb.db;UID=DBA;PWD=sql"

    If the copy of the backup does not validate, then fix the problems that cause the validation to fail before proceeding. Otherwise, you risk losing data.

  3. Stop the servers in the following order:

    1. copy nodes

    2. mirror

    3. primary

  4. Option Action
    Upgrade the database

    Run the Upgrade utility (dbupgrad) on the primary database. For example:

            dbupgrad -c "UID=DBA;PWD=sql;DBF=C:\primary-database.db"    

    The database is upgraded, a new transaction log is created, and the database is stopped. You can delete the old transaction logs.

    Rebuild (unload/reload) the database
            dbunload -c "UID=DBA;PWD=sql;DBF=C:\primary-database.db"    
  5. Copy the upgraded or rebuilt database and its new transaction log to the mirror server and any scale-out copy nodes.

  6. Start the servers in the following order:

    1. primary

    2. mirror

    3. copy nodes


The databases in the mirroring system are upgraded or rebuilt and the mirroring system is running.


Examine the database mirroring system to confirm that the upgrade completed properly, and test the database mirroring system with your application.

 See also