Materializing a subscription copies the requested data from the primary database to the replicate database, thereby initializing the replicate table. Subscriptions are added to the rs_subscriptions system table for both the primary and the replicate Replication Server. The materialization method you select determines how you create subscriptions.
Because a subscription can replicate a large set of rows, materialization can burden the network or impede applications that use the primary or replicate data. Replication Server offers four methods for creating subscriptions, so you can regulate the effects of materialization on the replication system.
Table 11-1 summarizes the materialization methods you can use to create subscriptions, including commands required for the process.
Method |
Description |
---|---|
Atomic materialization (default) |
This method, invoked using the default form of the create subscription command, copies subscription data through the network in a single atomic operation. Replication Server executes the rs_select_with_lock function to retrieve the primary data. This method provides complete consistency throughout the materialization process, but may temporarily obstruct transactions using the primary or replicate data. Do not use this method for large subscriptions if a long-running transaction is unacceptable in the primary database. For details, see “Atomic materialization”. |
Nonatomic materialization |
This method, invoked using the create subscription command with the without holdlock clause, is similar to the atomic method, except that consistency constraints during materialization are relaxed to allow clients at the primary database to process transactions during materialization. Replication Server executes the rs_select function to retrieve the primary data. Subscription data is copied in a series of transactions. Because users are allowed to update primary data, this method may result in transactional inconsistency and incomplete data during materialization. When materialization is complete, all inconsistencies are fully corrected. Autocorrection for the replicate table must be enabled to resolve inconsistencies. For details, see “Nonatomic materialization”. |
No materialization |
This method, invoked using the create subscription command with the without materialization clause, allows you to create a subscription when the subscription data already exists at the replicate database. You can use this method to create subscriptions to table replication definitions, function replication definitions, and database replication definitions. For details, see “No materialization”. |
Bulk materialization |
This method is appropriate when there is too much data to copy through the network. This is a “manual” materialization method that allows you to load the subscription data from media such as magnetic tape. Use this method for subscriptions to database replication definitions and to function replication definitions when data must be initialized at the replicate database. The commands used for bulk materialization are define subscription, activate subscription, and validate subscription. For more details, see “Bulk materialization”. |