What you need to know

with suspension clause

Use the with suspension clause with the activate subscription command to prohibit updates to the source data until after the subscription initializes.

When you use the with suspension clause, the system suspends the DSI thread after changing the subscription status to active. This prevents the replicate Replication Server from sending updates for the replicated table before the subscription data loads.

After the data loads, you can execute the resume connection command to apply the updates.

NoteIf you are activating multiple subscriptions (consecutively in a script, for example), to avoid issuing the resume connection command repeatedly, use the with suspension clause only with the first or last activate subscription command. Execute the resume connection command once after the multiple activate subscription commands.

StepsTo bulk materialize using the atomic method:

  1. Log in to the replicate Replication Server as the System Administrator (sa) using isql:

    isql -Usa -Psa_password -Sservername

  2. Define the subscription at the replicate Replication Server using the following syntax:

    define subscription subscription_name
    for replication_definition
    with replicate at dataserver.database
    [where search_conditions]
    
    
  3. Check the subscription at both the primary and replicate Replication Servers to verify that the subscription status is defined. Use the following syntax:

    check subscription subscription_name
    for replication_definition
    with replicate at dataserver.database
    
    
  4. Prevent updates to DB2 by using the following command to restrict it to read-only access during materialization:

    START DATABASE (database_name) SPACENAM (space_name) ACCESS (RO)
    

    where database_name is the DB2 database that contains the DB2 primary table, and space_name is the DB2 tablespace that contains the DB2 primary table.

  5. Unload the source data at the primary site by retrieving the data from the primary database using your site’s preferred database unload method to select or dump the subscription data.

  6. Activate the subscription with suspension at the replicate Rep Server using the folowing syntax:

    activate subscription subscription
    for replication_definition
    with replicate at dataserver.database
    with suspension
    
  7. Use the Activate and Validate Subscription panel to activate the subscription, using the with suspension clause.

    The Activate and Validate Subscription panel activates and validates subscriptions by sending Replication Server commands to the DB2 log. Replication Agent for DB2 sends the log to Replication Server, which activates and validates subscriptions.

    1. From an ISPF command line, type:

      TSO EXEChlq.ISPF(LTMCSET)

      (where hlq is the high-level qualifier and version number recorded in sections 3a of the Replication Agent Installation Worksheet).

  8. Unlock the primary tables to restore read-write access using the following example syntax:

    START DATABASE (database_name) SPACENAM (space_name) ACCESS (RW)
    

    where database_name is the DB2 database that contains the DB2 primary table, and space_name is the DB2 tablespace that contains the DB2 primary table.

  9. Wait for the subscription to become active at both the primary and replicate Replication Servers; then execute the check subscription command at both the primary and replicate Replication Servers to verify that the subscription status is active.

    When the subscription status is active at the replicate Replication Server, the database connection for the replicate database is suspended.

  10. Load the subscription data into the replicate database using the BCP utility or other load utility.

  11. From the replicate Replication Server, resume the database connection for the replicate database using the following syntax:

    resume connection to dataserver.database
    
  12. Validate the subscription at the replicate Replication Server using the following syntax:

    validate subscription subscription
    for replication_definition
    with replicate at dataserver.database
    
  13. Wait for the subscription to become valid at both the primary and replicate Replication Servers; then, execute the Replication Server check subscription command (as in step 3 of this task) at both the primary and replicate Replication Server to verify that the status is valid.

    Now the subscription is created and replication is active.