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 - Database Administration » High availability and read-only scale-out systems » Database mirroring » Troubleshooting: Database mirroring systems

 

Troubleshooting: The primary server cannot be restarted

Force the mirror server to take over as the primary server in situations where all other attempts have failed. This method uses the ALTER DATABASE statement with the FORCE START clause and can result in losing committed transactions.

Prerequisites

You must have the privileges specified by the -gd database server option (SERVER OPERATOR system privilege, by default).

The partner servers must have been started with the -su database option, so that you can connect to the utility database on the mirror server.

You have already tried manually stopping the primary server and restarting it and executing an ALTER DATABASE statement with the SET PARTNER FAILOVER clause.

Context and remarks

You can only use the ALTER DATABASE FORCE START statement when the following conditions apply:

  • The primary server is down (for example, due to a hardware failure).
  • The mirror server failed to take over as the primary server.
  • You can connect to the utility database on the mirror database server.
Caution

Using the FORCE START clause can result in the loss of transactions if the primary server contains transactions that the mirror server does not have.

It is recommended that you restart the primary and execute ALTER DATABASE with the SET PARTNER FAILOVER clause to force a failure without lost transactions. The FORCE START clause should only be used when the primary cannot be restarted as a last resort.

 Task
  1. Stop the mirror database, and if possible the mirror server.

  2. If the database and transaction log files from the primary server are available, back them up and validate the backed up copies. Otherwise back up and validate the transaction log.

  3. If the database file and the transaction log file from the primary server are valid, then copy both files to the mirror server.

    If the database file from the primary is invalid, but the primary transaction log file is valid, then:

    1. Apply the primary log file to a backup of the mirror database and validate the database.

    2. Copy the database and transaction log file to the mirror server.

  4. Start the database on the mirror server (or restart the mirror server) with mirroring enabled. If you are restarting the mirror server, specify the -su database option, so that you can connect to the utility database.

  5. Connect to the utility database, utility_db, on the mirror server.

  6. Execute an ALTER DATABASE FORCE START statement to force the mirror server to become the primary server.

Results

The mirror server becomes the new primary server

Next

To replace the failed primary machine with a different primary machine, then the failed partner must dropped, and a new partner added for the new machine. The primary and mirror connection strings must be updated. See Moving a partner server

Example

The following statement forces the mirror server for the database mymirroreddb.db to become the primary server.

ALTER DATABASE mymirroreddb FORCE START;

 See also