Creating publication subscriptions with bulk materialization

Bulk materialization allows you to load subscription data from media such as magnetic tape. Use this method if the amount of data to be transferred is too large to copy through the network. You can also use this method to create subscriptions for function replication definitions.

When you create publication subscriptions with bulk materialization, you must use define subscription, activate subscription, and validate subscription. You use these bulk materialization commands to create publication subscriptions in the same way you create single subscriptions. You cannot include where clauses in publication subscriptions.

Refer to “Specifying a where clause with the create article command” for information about adding where clauses to articles.


Using the define subscription command

Use define subscription to create a publication subscription and a subscription for each article in the publication. define subscription always creates a subscription using bulk materialization.

Execute define subscription at the Replication Server that manages the destination database. Subscription information is stored in the rs_subscriptions system tables at the source and destination sites.

All subscriptions in the publication subscription are created at the same time.

The following example creates a subscription named pubs2_sub for the publication pubs2_pub.

define subscription pubs2_sub 
    for publication pubs2_pub
    with primary at TOKYO_DS.pubs2
    with replicate at SYDNEY_DS.pubs2

When you define a publication subscription with bulk materialization, you can enable replication of truncate table to the destination table. See “Enabling replication of the truncate table command” for more information.

Refer to Chapter 3, “Replication Server Commands,” in the Replication Server Reference Manual for complete syntax and usage guidelines.


Using the activate subscription command

Use activate subscription to activate a publication subscription and its subscription subset. Execute activate subscription at the Replication Server that manages the destination database.

Before you execute activate subscription, you must execute define subscription, and the publication subscription status must be DEFINED. Refer to “Displaying status information” for information about displaying subscription status.

All subscriptions in the publication subscription are activated at the same time.

The following example activates every subscription in the publication subscription pubs2_sub.

activate subscription sub for publication pub
    with primary at TOKYO_DS.pubs2
    with replicate at SYDNEY_DS.pubs2

Refer to Chapter 3, “Replication Server Commands,” in the Replication Server Reference Manual for complete syntax and usage guidelines.


Using the validate subscription command

Use validate subscription to set the subscription status to VALID for the publication subscription, and its subscription subset. Execute validate subscription at the Replication Server that manages the replicate database.

Before you execute validate subscription, you must execute activate subscription and the publication subscription status must be ACTIVE. Refer to “Displaying status information” for information about displaying subscription status.

All subscriptions in the publication subscription are validated at the same time.

The following example validates every subscription in the publication subscription pubs2_sub.

validate subscription sub for publication pub
    with primary at TOKYO_DS.pubs2
    with replicate at SYDNEY_DS.pubs2

Refer to Chapter 3, “Replication Server Commands,” in the Replication Server Reference Manual for complete syntax and usage guidelines.


Refreshing publication subscriptions using bulk materialization

When you refresh a publication subscription using bulk materialization, use the for new articles clause when you define the publication subscription. You do not need to repeat the clause when you activate and validate the subscription.

The following example refreshes the publication subscription pubs2_sub.

define subscription pubs2_sub 
    for publication pubs2_pub
    with primary at TOKYO_DS.pubs2
    with replicate at SYDNEY_DS.pubs2
    for new articles

See “define subscription” in the Replication Server Reference Manual for syntax and usage guidelines.

To check whether a subscription exists for each article in a publication, execute check subscription at the primary or replicate Replication Server. See “Displaying status information” for more information about check subscription.