Performing atomic bulk materialization

StepsTo perform atomic bulk materialization

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

    isql -Usa -Psa_password -SRRS_servername
    

    where sa is the System Administrator user ID, sa_password is the password for the System Administrator user ID, and RRS_servername is the server name of the replicate Replication Server.

  2. Define the subscription at the replicate Replication Server:

    1> define subscription subscription_name
    2> for replication_definition
    3> with replicate at dataserver.database
    4> [where search_conditions]
    5> go 
    

    The dataserver.database must match the Replication Server connection name you use for the replicate database.

  3. Check the subscription at both the primary and replicate Replication Servers. Use the following command to verify that the subscription status is DEFINED:

    1> check subscription subscription_name
    2> for replication_definition
    3> with replicate at dataserver.database
    4> go
    
  4. Lock the primary table to prevent primary transaction activity. This prevents updates to the primary table during materialization.

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

    NoteWhen unloading subscription data from the primary table, make sure you select only the columns specified in the replication definition and the rows specified in the subscription.

  6. Perform any datatype translations necessary for the subscription data.

    If any column-level translation is specified in the replication definition for this data, you must perform the datatype translation specified in the replication definition.

    If class-level translations are specified for the subscription, you must perform the datatype translations specified for the subscription.

  7. Activate the subscription using the with suspension option at the replicate Replication Server:

    1> activate subscription subscription_name
    2> for replication_definition
    3> with replicate at dataserver.database
    4> with suspension
     5> go
    
  8. Wait for the subscription to become active at both the primary and replicate Replication Servers. 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.

  9. Restore the primary table to read-write access (unlock).

  10. Load the subscription data into the replicate database using the bcp utility or your site’s preferred database load utility.

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

    1> resume connection
    2> to dataserver.database
    3> go 
    
  12. Validate the subscription at the replicate Replication Server:

    1> validate subscription subscription_name
    2> for replication_definition
    3> with replicate at dataserver.database
    4> go
    
  13. Wait for the subscription to become valid 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 status is VALID.

When you complete this procedure, the subscription is created, the replicate data is consistent with the primary data, and replication is in progress.

If replication is not in progress when you complete this procedure, see Chapter 8, “Troubleshooting Heterogeneous Replication Systems.”

See also