Failback procedure

Failback refers to the process of restoring normal user and client access to a primary database, after a failover switched access from the primary database to a standby database.

This section describes only the failback tasks that are specific to the Mirror Activator system. General system failback procedures are not covered in this document.

Table B-2 provides a checklist of the tasks that you must include in failback procedures for the Mirror Activator system.

The checklist in Table B-2 assumes that:

NoteIf you do not purge the Replication Server stable queue to remove any open transaction that remained in the queue after failover:

Sybase recommends that you perform these tasks in the order shown.

Table B-2: Mirror Activator system failback tasks

Task

Description

1

Quiesce the standby database to suspend update activity.

2

Fail back the disk replication system to:

  • Re-materialize the primary database data and log devices from the standby database devices.

  • Materialize the mirror log devices at the standby site from the materialized primary log devices.

  • Re-establish synchronous replication from the primary log devices to the mirror log devices at the standby site.

3

Bring the primary database online.

4

Initialize the primary database using the pdb_init move_truncpt command to set the truncation point to the end of the log.

5

Quiesce the primary database.

6

Initialize the Mirror Replication Agent using the ra_init force command, and set the paths to the mirror log devices, if necessary.

7

Release the quiesce on the primary database, after the Mirror Replication Agent initialization is complete.

8

Switch access for users and client applications from the standby database to the primary database.

9

Release the quiesce on the standby database, after client access is switched to the primary database.

10

Start replication in the Mirror Replication Agent with the resume command.

Use the following procedure for Mirror Activator system failback tasks.

StepsTo fail back the Mirror Activator system

  1. Quiesce the standby database to suspend update activity.

  2. For Microsoft SQL Server: Execute the following command:

    alter database standby set READ_ONLY;
    

    NoteChanging the state of a database or file group to READ_ONLY or READ_WRITE requires exclusive access to the database.

  3. Fail back the disk replication system to:

    • Materialize the primary database data and log devices from the standby database devices.

      NoteFor Microsoft SQL Server, you can use the attach command to mount a device in the primary server to recover the primary database. For information about the attach command, see the documentation for Microsoft SQL Server.

    • Materialize the mirror log devices at the standby site from the materialized primary log devices.

    • Re-establish synchronous replication from the primary log devices to the mirror log devices at the standby site.

    Refer to the documentation provided by your disk replication system vendor for more information about the procedures in this step.

    For more information about re-materializing a primary database, see Appendix A, “Materializing Databases in a Mirror Activator system.”

  4. Bring the primary database online.

  5. Initialize the primary database using the Mirror Replication Agent pdb_init move_truncpt command. This command sets the truncation point to the end of the log.

    For more information about initializing the primary database, see “Setting up the Mirror Activator system”.

  6. Quiesce the primary database.

  7. For Microsoft SQL Server: Execute the following command:

    alter database primary set READ_ONLY;
    

    NoteChanging the state of a database or file group to READ_ONLY or READ_WRITE requires exclusive access to the database.

  8. Initialize the Mirror Replication Agent using the ra_init force command to update the system data repository in the RASD, and then use ra_devicepath to set the paths to the mirror log devices (if necessary).

    For more information, see “Updating the RASD”.

  9. Release quiesce on the primary database, after the Mirror Replication Agent initialization is complete.

  10. For Microsoft SQL Server: Execute the following command:

    alter database primary set READ_WRITE;
    

    NoteChanging the state of a database or file group to READ_ONLY or READ_WRITE requires exclusive access to the database.

  11. Switch access for users and client applications from the standby database to the primary database.

  12. Release quiesce on the standby database, after client access is switched to the primary database.

  13. For Microsoft SQL Server: Execute the following command:

    alter database standby set READ_WRITE;
    

    NoteChanging the state of a database or file group to READ_ONLY or READ_WRITE requires exclusive access to the database.

  14. Start replication in the Mirror Replication Agent.

    Log in to the Mirror Replication Agent administration port and execute the following command:

    resume
    

    After you invoke resume, use the ra_status command to verify that the Mirror Replication Agent is in Replicating state.

    The following output indicates that Mirror Replication Agent has reached the Replicating state:

    State        Action
    -----------  ------------------------------
    REPLICATING  Waiting for operator command.
    

    For more information, see “Starting replication in the Mirror Replication Agent”.