Recovering From a Failure of the Standby Database

There are certain tasks you can perform to recover a standby database.

To recover from a failure of the standby database, complete the following tasks:

  1. Detect the standby database failure.
  2. If return twosafe service is enabled, the failure of the standby database may prevent a transaction in progress from being committed on the active database, resulting in error 8170, "Receipt or commit acknowledgement not returned in the specified timeout interval". If so, then call the ttRepSyncSet built-in procedure with a localAction parameter of 2 (COMMIT) and commit the transaction again. For example:
    call ttRepSyncSet( null, null, 2);
    commit;
  3. Call ttRepStateSave('FAILED','standby_database','host_name') on the active database. Afterwards, as long as the standby database is unavailable, updates to the active database are replicated directly to the subscriber databases. Subscriber databases may also be duplicated directly from the active.
  4. If the replication agent for the standby database has automatically restarted, stop the replication agent. See Starting and Stopping the Replication Agents.
  5. Recover the standby database in one of the following ways:
    • Connect to the standby database. This triggers recovery from the local transaction logs.

    • Duplicate the standby database from the active database.

    The amount of time that the standby database has been down and the amount of transaction logs that need to be applied from the active database determine the method of recovery that you should use.

  6. Set up the replication agent policy and start the replication agent on the new standby database. See Starting and Stopping the Replication Agents.

The standby database enters the STANDBY state and starts sending updates to the subscribers after the active database determines that the two master databases have been synchronized and stops sending updates to the subscribers.

Note:

You can verify that the standby database has entered the STANDBY state by using the ttRepStateGet built-in procedure.