IBM Books

DB2 Replication Guide and Reference


Operating Capture for VSE

The administrator can use the commands in this section to operate Capture for VSE.

This section explains how to perform the following Capture for VSE tasks:

Before You Start the Capture Program

Before starting the Capture program, make sure you complete the following post-installation tasks:

The ASNS51CD job control member contains the name of the messages file used. The default is American English. Modify ASNS51CD to issue messages in a different language. See the Capture program directory for a list of supported languages.

Starting Capture for VSE

After you start the Capture program, it runs continuously until you stop it or it detects an error.

To start the Capture program:

Start it in a partition like a batch job. Sample job control member ASNS51BD provides an example of how to start the Capture program. You can specify ASNCCP invocation parameters in the PARM field, in the order shown, separated by one or more blanks:

Starting the Capture program
 
>>-//--EXEC--PGM=ASNCCP--,PARM=--'----+--------+---+---------+-->
                                      +-WARM---+   +-PRUNE---+
                                      +-COLD---+   '-NOPRUNE-'
                                      '-WARMNS-'
 
>-----+--------+---+---------+---| Group 1 |--'----------------><
      +-TERM---+   +-TRACE---+
      '-NOTERM-'   '-NOTRACE-'
 
Group 1
 
|---USERID=--auth_name/password--+------------------------+-----|
                                 '-Dbname=--databasename--'
 

Table 17 defines the optional parameters.

Table 17. ASNCCP Command Parameter Definitions for VSE

Parameter
Definition

WARM  (default) 
The Capture program resumes processing where it ended in its previous run if warm start information is available. If the Capture program cannot warm start, it switches to a cold start. See Warm and Cold Starts for more information.

WARMNS
The Capture program resumes processing where it ended in its previous run if warm start information is available. Otherwise, it issues a message and terminates. With WARMNS, the Capture program does not automatically switch to a cold start. The Capture program leaves the trace, UOW, CD, and warm start tables intact. In case of errors, the Capture program terminates instead of switching to a cold start as when WARM is specified. See Warm and Cold Starts for more information.

COLD
The Capture program starts by deleting all rows in its CD, UOW, and trace tables during initialization. See Warm and Cold Starts for more information.

PRUNE  (default) 
The Capture program automatically prunes the CD and UOW tables.

NOPRUNE
Automatic pruning is disabled. The Capture program prunes the CD and UOW tables when you enter the PRUNE command. See the PRUNE command for more information.

TERM  (default) 
Terminates the Capture program if the DB2 server is terminated.

NOTERM
Keeps the Capture program running when the DB2 server is terminated. When the DB2 server comes up, the Capture program starts in WARM mode and begins capturing where it left off when DB2 terminated.

NOTRACE  (default) 
No trace information is written.

TRACE
Writes debug trace messages to the standard output, stdout.

USERID=auth_name/password
Specifies that the Capture program should connect to the database as user ID auth_name. The correct password must be provided or an error is returned. The auth_name and password are both from 1 to 8 characters in length.

Dbname=database_name
Identifies the name of the DB2 server for VSE database for which changes are to be captured. It is from 1 to 18 characters in length. If not specified, the default is the database name as specified in the DBNAME directory or SQLDS if a DBNAME directory has not been set up.

Stopping Capture for VSE

Stopping the Capture program
 
>>-MSG--partition,DATA=STOP------------------------------------><
 

where partition represents the partition that is running Capture for VSE.

Purpose

Use the STOP command to stop the Capture program gracefully and commit the log records that it processed up to that point.

STOP should be issued before:

Usage

If you stop the Capture program, the Capture program shuts itself down and issues an informational message. If it detects an error, the program shuts itself down after cleaning up the data in the affected tables so that the data will not be used. Staging tables are pruned when it is appropriate. In the case of abnormal termination, you must initiate a cold start because the warm start information could not be saved.

Capture for VSE issues informational or error messages to the console.

Stopping the Capture Program with a Trigger

In some situations, you might want to trigger the stop of the Capture program. For example, you might want to stop it at a specific time, or after all transactions for a particular application have been committed. The simplest way to set up this trigger is to create a table (or use an existing table), define it as a replication source, and identify a particular column whose update, when captured, triggers shutdown.

To stop the Capture program with a trigger:

Use the following example as a guideline.

  1. Create a table with a column named STOPCAP or another unique identifier.

  2. Define the table as a replication source.

  3. Create an application that periodically reads the CD table associated with this replication source table to search for STOPCAP.

  4. Schedule the application to start before your Apply programs.

When your application encounters STOPCAP in the CD table, it should issue the command to stop the Capture program.

Suspending Capture for VSE

Suspending the Capture program
 
>>-MSG--partition,DATA=SUSPEND---------------------------------><
 

where partition represents the partition that is running Capture for VSE.

Purpose

Use the SUSPEND command to suspend the Capture program until you issue the RESUME command.

Usage

You can use this command to suspend the Capture program to improve performance for operational transactions during peak periods without destroying the Capture for VSE program run environment.

Resuming Capture for VSE

Resuming the Capture program
 
>>-MSG--partition,DATA=RESUME----------------------------------><
 

where partition represents the partition that is running Capture for VSE.

Purpose

Use the RESUME command to resume the suspended Capture program.

Usage

You can use this command to resume the Capture program if you suspended it with the SUSPEND command.

Reinitializing Capture for VSE

Reinitializing the Capture program
 
>>-MSG--partition,DATA=REINIT----------------------------------><
 

where partition represents the partition that is running Capture for VSE.

Purpose

Use the REINIT command to reinitialize the Capture program.

Usage

Use the REINIT command to begin to capture changes from new source tables if you add a new replication source with the Control Center while the Capture program is running. This command ensures that the Capture program recognizes the new replication sources in the register table. To allow the new replication source to be visible to the Capture program, you must issue a REINIT command. The REINIT command tells the Capture program to obtain newly added replication sources from the register table (ASN.IBMSNAP_REGISTER).

REINIT also rereads the tuning parameters table (ASN.IBMSNAP_CCPARMS) for any changes made to the tuning parameters.

Attention: Do not use REINIT to reinitialize the Capture program after canceling a replication source or dropping a replication source table while the Capture program is running. Instead, stop the Capture program and use warm start (WARM or WARMNS).

Pruning the Change Data and Unit-of-Work Tables

Pruning the Capture program
 
>>-MSG--partition,DATA=PRUNE-----------------------------------><
 

where partition represents the partition that is running Capture for VSE.

Purpose

Use the PRUNE command to initiate the pruning of the CD and UOW (UOW) tables, if you used the NOPRUNE invocation parameter to disable pruning when you started the Capture program.

Usage

This command prunes tables once. During pruning, if you stop or suspend the Capture program, pruning does not resume after you enter the RESUME command. You must enter the PRUNE command again to resume pruning.

Providing the Current Log Sequence Number

Getting the Log
 
>>-MSG--partition,DATA=GETLSEQ---------------------------------><
 

where partition represents the partition that is running Capture for VSE.

Purpose

Use the GETLSEQ command to provide the timestamp and current log sequence number.

Usage

Use the GETLSEQ command to determine how far the Capture program has read the DB2 log.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]