Bulk materialization

With bulk materialization, you manually transfer subscription data between databases. Use bulk materialization when a subscription is too large to copy through the network. Bulk materialization has very little effect on primary database clients or on the network.

You can use bulk materialization to create subscriptions for function replication definitions. See Chapter 10, “Managing Replicated Functions” for more information about replicated functions.

Bulk materialization uses these commands, which are executed at different points in the materialization process: define subscription, activate subscription, validate subscription. Use the check subscription command to check the status of the subscription.

When you use bulk materialization, you must coordinate:

Three bulk-materialization methods are available to ensure data consistency between the primary and replicate sites. The method you use depends mainly on whether applications using the primary data can tolerate interruptions.

You can use any of these methods for subscriptions to either table or function replication definitions. With subscriptions to function replication definitions, it may not be obvious which replicate tables will be affected by stored replicated procedures executing in the replicate database.

Before you initiate bulk materialization, you must consider these issues in relation to the existing data in the replicate database.

Table 11-2 summarizes the three bulk materialization methods.

Table 11-2: Summary of bulk materialization methods

Method

Summary of process

Stop updates to the primary table and take a snapshot of the data

Stop all applications from updating the primary data and then retrieve the subscription data from the primary database with a select statement or database dump. Define the subscription and activate it with an option that leaves the DSI suspended for the replicate database. Clients can resume updates to the primary data. After you load the subscription data into the replicate database, you can resume the DSI and validate the subscription. For details on this procedure, see “Stop updates at the primary database and take a snapshot”.

Simulate atomic materialization

Allow client applications to continue executing transactions against the primary data while the subscription data is retrieved. After defining the subscription, you lock the primary data, retrieve the subscription data, and activate the subscription. The activate subscription command leaves the DSI for the replicate database suspended. After you load the subscription data into the replicate database, you can resume the DSI and validate the subscription. For details on this procedure, see “Simulate atomic materialization”.

Simulate nonatomic materialization

This method is the same as simulating atomic materialization, except that you activate the subscription first, and then retrieve the data from the primary database without locking the data. Because of this, the data at the replicate database may be inconsistent with the data at the primary database until the subscription is validated and you are required to enable autocorrection for the replicate data. For details on this procedure, see “Simulate nonatomic materialization”.