Resynchronizing a Replicate In-Memory or Relaxed-Durability Database with Bulk Materialization

Use the simulate atomic materialization method of bulk materialization to restore an in-memory or relaxed-durability database acting as the replicate database.

Prerequisites
Before you start bulk materialization, verify that the replication definitions and subscriptions exist.
Task
  1. To quickly empty the inbound and outbound queues, deactivate the subscriptions that have the in-memory or relaxed-durability database as the replicate database:
    deactivate subscription subscription_name
    for {table_repdef_name | func_repdef_name |{publication pub_name |
    database replication definition db_repdef_name}
    with primary at dataserver.database}
    with replicate at dataserver.database
    go

    After you deactivate the subscriptions, Replication Server does not propagate all the transactions in the inbound queue to the outbound queue of the in-memory or relaxed-durability database.

    In contrast, when you drop a subscription, all the committed transactions that have been written into the inbound queue are distributed downstream of Replication Server. You can deactivate a subscription even if the DSI is not running because the deactivation only happens at the primary site. When the deactivate marker arrives at the outbound queue, you can see this entry in the Replication Server log:

    The deactivate marker for subscription subscription_name arrives at outbound queue: data_server_name.database_name.

    After the deactivate marker arrives at the outbound queue, use sysadmin sqm_purge_queue to purge the outbound queue at the replicate site to quickly empty the outbound queue. See sysadmin sqm_purge_queue, in Chapter 3, "Replication Server Commands" in the Replication Server Reference Manual.

  2. Execute check subscription at both the primary and replicate Replication Servers to verify that the subscription status is DEFINED at the primary Replication Server and VALID at the Replication Server.
  3. Use the "Simulate atomic materialization" or "Simulate nonatomic materialization" bulk materialization methods described in "Bulk materialization," in Chapter 11, "Managing Subscriptions" in the Replication Server Administration Guide Volume 1, to build the in-memory or relaxed-durability database. If you use:
    • Simulate atomic materialization — execute steps 4 to 9 in the procedure for "Simulate atomic materialization."
    • Simulate nonatomic materialization — execute steps 4 to 13 in the procedure for "Simulate nonatomic materialization."