Help SQL Replication

Creating subscription sets

Before you replicate data from a registered source, you must create subscription sets, which are collections of subscription-set members (source-to-target mappings) that the Apply program processes as a set.

Before you begin

About this task

When you create a subscription set, you specify the source and target servers, which Capture and Apply programs you want to use, and when and how you want the Apply program to process the set.

You don't have to add subscription-set members to a subscription set. You can create an empty set that doesn't contain any source-to-target mappings. You might want to create an empty set for the following reasons:

Procedure

To create a subscription set, use one of the following methods:
Method Description
ASNCLP command-line program Use the CREATE SUBSCRIPTION SET command. This command can create only empty subscription sets, whereas the Replication Center allows you to add members to the set while creating it.

The following commands set the environment and create a subscription set named SET00 with an Apply qualifier of AQ00.

SET SERVER CAPTURE TO DB SAMPLE;
SET SERVER CONTROL TO DB TARGET;
SET OUTPUT CAPTURE SCRIPT "capsubset.sql"
CONTROLSCRIPT "appsubset.sql";
SET LOG "subset.err";
SET RUN SCRIPT LATER;
CREATE SUBSCRIPTION SET SETNAME SET00 APPLYQUAL AQ00
ACTIVATE YES TIMING INTERVAL 1 START DATE "2006-10-22"
TIME "09:00:00.000000";
Replication Center Use the Create Subscription Set notebook. To open the notebook, expand the Apply control server where the set will be defined, right click the Subscription Sets folder and click Create.
For System i

ADDDPRSUB system command

Use the Add DPR subscription set (ADDDPRSUB) command to create a subscription set with either one member or no members.

For example, to create a subscription set named SETHR under the AQHR Apply qualifier:

ADDDPRSUB APYQUAL(AQHR) SETNAME(SETHR) SRCTBL(HR/EMPLOYEE)
TGTTBL(TGTLIB/TGTEMPL) 

This subscription set, which contains one subscription-set member, replicates data from the registered source table named EMPLOYEE under the HR library to the target table named TGTEMPL under the TGTLIB library.

You provide these basic characteristics:

Apply control server alias

The local alias of the server containing the control tables for the Apply program that will process the subscription set. Define the same alias for the Apply control server in every database from which you run the Replication Center, ASNCLP, or the Apply program so that the administration tools populate the Apply control tables correctly and so that every Apply program connects to the correct server by using a standard alias name.

Subscription set name

The name of the subscription set. At the Apply control server that processes this subscription set, the set name must be unique for a given Apply qualifier. The name can be up to 18 characters long.

Apply qualifier

The name of a new or existing Apply qualifier, which identifies which Apply program will process this subscription set. You can use the same Apply qualifier to process multiple subscription sets. Subscription sets that have the same Apply qualifier must be defined in the same Apply control server.

Capture control server alias

The alias of the server containing the control tables for the Capture program that will process the registered sources for the subscription set. Define the same alias for the Capture control server in every database from which you run the Replication Center, ASNCLP, or the Apply program so that the administration tools populate the Capture and Apply control tables correctly and so that every Apply program connects to the correct server by using a standard alias name.

Capture schema

The name of the Capture schema that identifies the set of Capture control tables that define the registered sources for the subscription set. All of the source tables in a subscription set must reside on the same server, and only one Capture program can be capturing the changes for them.

Target server alias

The name of the target server that contains the tables or views to which the Apply program will replicate changes from the source. Define the same alias for the target server in every database from which you run the Replication Center, ASNCLP, or the Apply program so that the administration tools populate the Apply control tables correctly and so that every Apply program connects to the correct server by using a standard alias name.

When you create a subscription set, you can use the default settings for how the Apply program processes the set, or you can modify the subscription properties to meet your replication needs.



Send your feedback | Information roadmap | The Q+SQL Replication Forum

Update icon Last updated: 2013-10-25