Help Q Replication and Event Publishing

Load options for different types of Q Replication

Options for loading target tables depend on the type of Q Replication that you are setting up.

The following sections explain what load options are available for each type of Q Replication, which server is used for the initial load, and the steps that you must take to begin the load:

Load options for unidirectional replication

This section explains the load options for unidirectional replication.

Load options
The available options depend on the target type:
DB2® targets
All load options are available.
CCD targets
If the CCD table is noncomplete, the only valid choice is no load. If the CCD table is complete, all load options are available.
Non-DB2 targets
For automatic loads, the EXPORT and IMPORT utilities are supported.You can also specify that Q Apply use an ODBC select to fetch data from the source, and for Oracle targets, you can specify that Q Apply call the SQL*Loader utility.
Which server is used for the initial load
Q Capture server
What you must do
By default, the Q Apply program begins the loading process when you start the Q Capture program for the Q subscription's source table. If you create the Q subscription so that it is not started automatically when the Q Capture program starts, then you must start the Q subscription for the load to begin.
Example

Assume that you want to replicate data in one direction from the DEPARTMENT table at Server A to the DEPARTMENT table at Server B and use the most automatic method. You want the Q Apply program to handle the load and use the best available utility.

  1. You create a Q subscription for the DEPARTMENT table that specifies an automatic load that uses the best available utility.
  2. You start the Q Capture program at Server A and the Q Apply program at Server B.

    The Q Apply program calls a load utility that copies the data from the DEPARTMENT table at Server A to the DEPARTMENT table at Server B. Once the loading process is finished, replication begins in one direction from Server A to Server B.

Load options for bidirectional and peer-to-peer replication with two servers

This section explains the load options for bidirectional and peer-to-peer replication with two servers.

Load options
All load options are available. However, if you specify an automatic load, by default the Q Apply program will choose between a combination of the EXPORT and LOAD utilities and a combination of the EXPORT and IMPORT utilities, depending on your operating system and version. You can override this behavior and instruct the Q Apply program to use the LOAD from CURSOR utility by opening the Q Subscription Properties notebook for individual Q subscriptions.
Which server is used for the initial load
When you create the two Q subscriptions for bidirectional or peer-to-peer replication with two servers, you choose which server will be the initial load source. This server contains the table whose data you want to copy to a table on the other server.

For subsequent loads (for example, if you stop the Q subscriptions for the logical table and then start them), you specify which server will be the load source when you decide which of the two Q subscriptions to start. The source table for the Q subscription that you start will be the load source.

What you must do
The process of initiating a load differs depending on whether you specify an automatic or manual load:
Automatic load
If you created the Q subscriptions to start automatically when the Q Capture program starts, you only need to start the Q Capture and Q Apply programs at both servers for the loading process to begin.

If you chose not to have the Q subscriptions start automatically, you must take the following actions:

  • Start the Q Capture and Q Apply programs at both servers.
  • Start the Q subscription whose source table you specified as the load source.
Manual load
  1. Start the Q Capture and Q Apply programs at both servers.
  2. Start the Q subscription whose source table you want to be the load source.

    The Q subscription will go into load pending state.

  3. Load the target table for the Q subscription, using any method.
  4. When you are done with the load, tell the Replication Center that the load is finished or insert a LOADDONE signal into the IBMQREP_SIGNAL table at the source server for the Q subscription.
Example

Assume that you wanted to replicate the EMPLOYEE table in a bidirectional setup on Server A and Server B, and use the most automatic method. You want Server A to be the initial load source:

  1. You create two Q subscriptions, EMP_A2B and EMP_B2A. When you create EMP_A2B, you specify Server A as the initial load source and specify an automatic load in which the Q Apply program chooses the best available load utility.
  2. You initiate the load by starting the Q Capture and Q Apply programs at Server A and Server B.

    The Q Apply program at Server B initiates the load for EMP_A2B by calling a load utility to copy the data from the EMPLOYEE table at Server A to the EMPLOYEE table at Server B. When the loading completes, replication begins in both directions between Server A and Server B.

Load options for peer-to-peer replication with three or more servers

This section explains the load options for peer-to-peer replication with three or more servers.

Load options
All load options are available. However, if you specify an automatic load, by default the Q Apply program chooses between a combination of the EXPORT and LOAD utilities, and a combination of the EXPORT and IMPORT utilities, depending on your operating system and version. You can override this behavior and instruct the Q Apply program to use the LOAD from CURSOR utility by opening the Q Subscription Properties notebook for individual Q subscriptions.
Which server is used for the initial load
In a peer-to-peer group with three or more servers, you start replication in stages. First you start replication between two servers, and then you bring additional servers into the group by starting replication between an active server and a new server. Follow these guidelines:
  • When you start replication between the first two servers, choose one server as the load source. Start the Q subscription that specifies this server as its source. The Q Apply program at the second server begins the loading process for the table at the second server.
  • To add a new server, choose one of the active servers as the load source. Start the Q subscription that specifies this server as its source and the new server as its target. The Q Apply program at the new server begins the loading process for the table at the new server.
What you must do
In a peer-to-peer configuration with three or more servers, you cannot create Q subscriptions that start automatically. You must manually start the Q subscriptions in stages. Follow these steps:
  1. Start the Q Capture and Q Apply programs at the first two servers in the group.
  2. Start one of the two Q subscriptions between the servers. The source table for the Q subscription that you start will be the load source, and the target table will be loaded.
  3. Start the Q Capture and Q Apply programs at a new server.
  4. Start a Q subscription that specifies one of the active servers as its source, and the new server as its target. The source table for the Q subscription that you start will be the load source, and the table at the new server will be loaded.
  5. Follow Steps 3 and 4 until all the servers in the group are loaded.

Manual load: If you choose a manual load, you must load the target table after you start each Q subscription, and then notify the replication programs when the target table is loaded.

Example

Assume that you want to initiate the loading process for a peer-to-peer Q subscription group that includes Server A, Server B, and Server C, with a single logical table, the DEPARTMENT table. You want the Q Apply program to handle the loading and use the best available load utility. You will use Server A as the load source for the tables at both Server B and Server C.

  1. You create six Q subscriptions, DEP_A2B, DEP_B2A, DEP_A2C, DEP_C2A, DEP_B2C, and DEP_C2B, all specifying an automatic load using the best available utility.
  2. You start the Q Capture and Q Apply programs at Server A and Server B.
  3. You start the Q subscription DEP_A2B.

    The Q Apply program at Server B calls a utility to load the DEPARTMENT table at Server B with data from the DEPARTMENT table at Server A. When the loading completes, replication begins in both directions between Server A and Server B.

  4. To begin the load at Server C, you first start the Q Capture and Q Apply programs at Server C.
  5. Next, you start the Q subscription DEP_A2C.

    The Q Apply program at Server C calls a utility to load the DEPARTMENT table at Server C with data from the DEPARTMENTS table at Server A. When the loading completes, replication begins in all directions between all three servers.



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

Update icon Last updated: 2013-10-25