IBM Books

DB2 Replication Guide and Reference


Control Tables Used at the Source Server

The following section provides a brief description of the control tables used at the source server, the columns in each control table, and the create table and create index statements for each table. The structure of all control tables is subject to change.

Capture Enqueue Table

ASN.IBMSNAP_CCPENQ

The Capture enqueue table is used in the VM and VSE environments only.

Table 35 provides a list and a brief description of the Capture enqueue table column.

Table 35. CD Table Column
Column name Description
LOCKNAME Unique name of the resource for this database.

Figure 34 shows the create table statement for Capture enqueue tables.

Figure 34. Create Table Statement for DB2 for VM/VSE Capture Enqueue Tables

For DB2 for VM/VSE

CREATE TABLE ASN.IBMSNAP_CCPENQ (
 LOCKNAME CHAR (9) NOT NULL);
 

Change Data Table

This section contains programming interface information.

ASN.CDtimestamp

Change data (CD) tables contain changed data assigned to source table rows, in time series. The changed data is used to update other target tables. There is one CD table for each source table. The CD table is created when you define a replication source that is enabled for data capture.

CD tables can contain committed changes and uncommitted changes, and possibly incomplete changes in rows. Normally, the Capture program inserts rows into this table for a particular platform. It also prunes rows periodically. On cold start, all of the CD table's entries will be deleted.

Commit sequencing, which is not known when records are inserted into the CD table, is provided through the unit-of-work table.

The Control Center automatically creates an index. A unique ascending index is required in the IBMSNAP_UOWID and IBMSNAP_INTENTSEQ columns.

Qualities of CD tables:

The Capture program prunes the CD tables based on information inserted into the pruning control table by the Apply program. The Apply program maintains the log sequence number in the SYNCHPOINT column of the pruning control table. Initially, the Apply program sets this sequence number to zero when it performs a full refresh. A zero value signals the Capture program to start capturing. When the Apply program copies changes from the CD table to the target table, it updates the SYNCHPOINT column. The Capture program can then prune changes in the CD table up through the row with the highest log sequence number.

Pruning occurs depending on whether you start the Capture program with the PRUNE or NOPRUNE invocation parameter and how the prune interval is set in the tuning parameters table. If you don't specify a parameter, PRUNE is the default. See the Capture and Apply chapter for your platform in this book to learn how to set pruning.

Table 36 provides a list and a brief description of each of the CD table columns.

Table 36. CD Table Columns
Column name Description
IBMSNAP_UOWID Unit-of-work ID. It is also the foreign key into the unit-of-work table.
IBMSNAP_INTENTSEQ Unique identifier that describes the sequence of a change within a transaction.
IBMSNAP_OPERATION Character value of 'I', 'U', or 'D', indicating an insert, update, or delete record.
KEY1 User column from source table specified by the user when defining replication sources.
DATA1 User column from source table specified by the user when defining replication sources.

Figure 35 and Figure 36 show the create table and create index statements for CD tables.

Figure 35. Create Table and Create Index Statements for DB2 for OS/390 Version 4 or Higher CD Tables

For DB2 for OS/390 Version 4 or Higher

CREATE TABLE userid.CDtimestamp (
 IBMSNAP_UOWID CHAR(10) FOR BIT DATA  NOT NULL,
 IBMSNAP_INTENTSEQ CHAR(10) FOR BIT DATA  NOT NULL,
 IBMSNAP_OPERATION CHAR(1) NOT NULL,
 <user data columns>); 
 
CREATE TYPE 2 INDEX userid.IXtimestamp
 timestamp ON userid.CDtimestamp (
 IBMSNAP_UOWID ASC,
 IBMSNAP_INTENTSEQ ASC);

Figure 36. Create Table and Create Index Statements for CD Tables on All Other Platforms

For All Other Platforms

CREATE TABLE userid.CDtimestamp (
 IBMSNAP_UOWID CHAR(10) FOR BIT DATA  NOT NULL,
 IBMSNAP_INTENTSEQ CHAR(10) FOR BIT DATA  NOT NULL,
 IBMSNAP_OPERATION CHAR(1) NOT NULL,
 <user data columns>); 
 
CREATE INDEX userid.IXtimestamp ON 
 userid.CDtimestamp (IBMSNAP_UOWID ASC, IBMSNAP_INTENTSEQ ASC);

Critical Section Table

ASN.IBMSNAP_CRITSEC

The critical section table is used for concurrency control purposes between the Capture and Apply programs for servers without isolation UR (uncommitted read).

Table 37 provides a brief description of the critical section table column.

Table 37. Critical Section Table Column
Column name Description
APPLY_QUAL Identifies the Apply program for the platform instance that will run this subscription. The value must be unique among all Apply program processes maintaining dependent replicas of a user table or parent replica, and unique among all Apply program processes sharing a common set of control tables. This value is case sensitive. When you use a user-written Apply program, you must specify this value when you define a subscription. This value is used to populate the IBMSNAP_APPLY_QUAL column of the unit-of-work table.

Figure 37 and Figure 38 show the create table and create index statements for critical section tables.

Figure 37. Create Table and Create Index Statements for DB2 for OS/390 Version 4 or Higher Critical Section Tables

For DB2 for OS/390 Version 4 or Higher

CREATE TABLE ASN.IBMSNAP_CRITSEC(
 APPLY_QUAL CHAR(18) NOT NULL,
 DATA CAPTURE CHANGES;
 
CREATE TYPE 2 INDEX ASN.IBMSNAP_CRITSECX ON ASN.IBMSNAP_CRITSEC
 (APPLY_QUAL ASC); 

Figure 38. Create Table and Create Index Statements for Critical Section Tables on All Other Platforms

For All Other Platforms

CREATE TABLE ASN.IBMSNAP_CRITSEC(
 APPLY_QUAL CHAR(18) NOT NULL,
 <additional padding columns for DB2 for OS/390 version 3>
 DATA CAPTURE CHANGES;
 
CREATE UNIQUE INDEX ASN.IBMSNAP_CRITSECX ON ASN.IBMSNAP_CRITSEC 
 (APPLY_QUAL ASC); 

Pruning Control Table

This section contains programming interface information.

ASN.IBMSNAP_PRUNCNTL

The pruning control table provides a timestamp and log-address translation in case the SYNCHPOINT column for Capture for MVS is a relative byte address value.

The pruning control table also coordinates the pruning of the change data tables, which have the potential for unlimited growth. There is one pruning control table at each source server and one row for each subscription member.

This table is located at the source server, but it is also automatically created at the target server when replica and CCD target tables are defined. Replica and CCD target tables created at the target server can be used as source tables for further subscriptions, making the target server a source server as well. This is performed as part of auto-registration, described in Part 3. Administering Your Replication System.

The rows in the pruning control table are not deleted during a cold start of the Capture program. The Control Center uses the values from the pruning control table to list direct copies of a particular source table.

Table 38 provides a brief description of each of the pruning control table columns.

Table 38. Pruning Control Table Columns
Column name Description
TARGET_SERVER Matches the column in the subscription set table of the same name. The name that appears in this column is also the name of the database (DRDA application server) where the target is stored. For DB2 for OS/2, there is no DRDA application server, so this column is informational.
TARGET_OWNER The middle qualifier of the target table name. Default is the user ID of the user defining the subscription. Matches the column of the same name in the subscription targets member table.
TARGET_TABLE The third qualifier of the target table name. Matches the column of the same name in the subscription targets member table.
SYNCHTIME A source server timestamp that can be added to any captured log records for any source table. This timestamp indicates that a change did not occur before this time. If the log records are individually timestamped, use those timestamps; otherwise, these values are approximate and are set by the Apply program at the start of a subscription cycle and after each subsequent cycle. These values are eventually appended into each change data table row.
SYNCHPOINT The SYNCHPOINT value equals the SYNCHPOINT field value in the common subscription set table. This value is used to coordinate the pruning of change data tables. The Apply program sets this initial value to 0, indicating refresh. If the Apply program sets a nonzero value, the change data table can be eligible for pruning.
SOURCE_OWNER The middle qualifier of the source table, which names the owner of the source table whose updates are being captured.
SOURCE_TABLE The third qualifier of the source table, which names the source table whose updates are being captured.
SOURCE_VIEW_QUAL Supports join subscriptions by matching the similar columns in the register table. You must have this column to support multiple subscriptions for the different source views with identical SOURCE_OWNER, SOURCE_TABLE column values.
APPLY_QUAL Identifies the Apply program for the platform instance that will run this subscription. The value must be unique among all Apply program processes maintaining dependent replicas of a user table or parent replica, and unique among all Apply program processes sharing a common set of control tables. This value is case sensitive. You must specify this value when you define a subscription. This column is part of the foreign key from the subscription set table.
SET_NAME Names a subscription set. This value is unique within an Apply qualifier value. This column is part of the foreign key from the subscription set table.
CNTL_SERVER The RDB name of the control server for the Apply program updating this row; either Apply for MVS, Apply for VSE, or Apply for VM.
TARGET_STRUCTURE A value that identifies the type of target table:
1
Source table
2
N/A
3
CCD table
4
Point-in-time table
5
Base aggregate table
6
Change aggregate table
7
Replica
8
User copy
CNTL_ALIAS The name of the control server used by the Apply program on the DB2 Universal Database. This alias name identifies the location of the subscription definition and is later used to perform administrative actions on a subscription. This alias name does not necessarily match the alias of the control server used by the Apply program for the DB2 Universal Database.

Figure 39, Figure 40, and Figure 41 show the create table and create index statements for pruning control tables.

Figure 39. Create Table and Create Index Statements for DB2 for OS/390 Version 4 or Higher Pruning Control Tables

For DB2 for OS/390 Version 4 or Higher

CREATE TABLE ASN.IBMSNAP_PRUNCNTL (
 TARGET_SERVER CHAR (18) NOT NULL,
 TARGET_OWNER CHAR (18) NOT NULL,
 TARGET_TABLE CHAR(18) NOT NULL,
 SYNCHTIME TIMESTAMP
 SYNCHPOINT CHAR(10) FOR BIT DATA,
 SOURCE_OWNER CHAR (18) NOT NULL,
 SOURCE_TABLE CHAR (18) NOT NULL,
 SOURCE_VIEW_QUAL SMALLINT NOT NULL,
 APPLY_QUAL CHAR (18) NOT NULL,
 SET_NAME CHAR (18) NOT NULL,
 CNTL_SERVER CHAR(18) NOT NULL,
 TARGET_STRUCTURE SMALLINT NOT NULL,
 CNTL_ALIAS CHAR(8))
 DATA CAPTURE CHANGES;
 
CREATE TYPE 2 UNIQUE INDEX ASN.IBMSNAP_PRUNCNTLX ON ASN.IBMSNAP_PRUNCNTL
 (SOURCE_OWNER ASC, SOURCE_TABLE ASC, SOURCE_VIEW_QUAL ASC, SET_NAME ASC,
 TARGET_SERVER ASC, TARGET_TABLE ASC, TARGET_OWNER ASC);

Figure 40. Create Table and Create Index Statements for DB2 for VM/VSE Pruning Control Tables

For DB2 for VM/VSE

CREATE TABLE ASN.IBMSNAP_PRUNCNTL (
 TARGET_SERVER CHAR (18) NOT NULL,
 TARGET_OWNER CHAR (18) NOT NULL,
 TARGET_TABLE CHAR(18) NOT NULL,
 SYNCHTIME TIMESTAMP
 SYNCHPOINT CHAR(10) FOR BIT DATA,
 SOURCE_OWNER CHAR (18) NOT NULL,
 SOURCE_TABLE CHAR (18) NOT NULL,
 SOURCE_VIEW_QUAL SMALLINT NOT NULL,
 APPLY_QUAL CHAR (18) NOT NULL,
 SET_NAME CHAR (18) NOT NULL,
 CNTL_SERVER CHAR(18) NOT NULL,
 TARGET_STRUCTURE SMALLINT NOT NULL,
 CNTL_ALIAS CHAR(8))
 DATA CAPTURE CHANGES;
 
CREATE UNIQUE INDEX ASN.IBMSNAP_PRUNCNTLX ON ASN.IBMSNAP_PRUNCNTL
 (SOURCE_OWNER ASC, SOURCE_TABLE ASC, SOURCE_VIEW_QUAL ASC, 
 SET_NAME ASC, TARGET_SERVER ASC, TARGET_TABLE ASC, TARGET_OWNER ASC);

Figure 41. Create Table and Create Index Statements for Pruning Control Tables on All Other Platforms

For All Other Platforms

CREATE TABLE ASN.IBMSNAP_PRUNCNTL (
 TARGET_SERVER CHAR (18) NOT NULL,
 TARGET_OWNER CHAR (18) NOT NULL,
 TARGET_TABLE CHAR(18) NOT NULL,
 SYNCHTIME TIMESTAMP
 SYNCHPOINT CHAR(10) FOR BIT DATA,
 SOURCE_OWNER CHAR (18) NOT NULL,
 SOURCE_TABLE CHAR (18) NOT NULL,
 SOURCE_VIEW_QUAL SMALLINT NOT NULL,
 APPLY_QUAL CHAR (18) NOT NULL,
 SET_NAME CHAR (18) NOT NULL,
 CNTL_SERVER CHAR(18) NOT NULL,
 TARGET_STRUCTURE SMALLINT NOT NULL,
 CNTL_ALIAS CHAR(8)
 <additional padding columns for DB2 for OS/390 Version 3>)
  DATA CAPTURE CHANGES;
 
CREATE UNIQUE INDEX ASN.IBMSNAP_PRUNCNTLX ON ASN.IBMSNAP_PRUNCNTL
 (SOURCE_OWNER ASC, SOURCE_TABLE ASC, SOURCE_VIEW_QUAL ASC,
 SET_NAME ASC, TARGET_SERVER ASC, TARGET_TABLE ASC, TARGET_OWNER ASC);

To avoid clone subscriptions, the APPLY_QUAL column is not included in the index. Instead, you must post each entry during subscription definition.

Register Table

This section contains programming interface information.

ASN.IBMSNAP_REGISTER

The register table holds information about replication source objects at the source server.

Table 39 provides a brief description of the register table columns.

Table 39. Register Table Columns
Column name Description
SOURCE_OWNER The middle qualifier of the source table, which names the owner of the source table whose updates are being captured.
SOURCE_TABLE The third qualifier of the source table, which names the source table whose updates are being captured.
SOURCE_VIEW_QUAL This value is set to equal 0 for registered physical tables and is greater than 0 for view registration.
GLOBAL RECORD A flag that indicates whether this row is the global record. This record is generated by the Capture program. If the Capture program is not installed, then there is no global record.
Y
This row is the global record.
N
This row is not the global record.
SOURCE_STRUCTURE A value that identifies structure of the base table:
1
Source table
3
CCD table
4
Point-in-time copy
5
Base aggregate copy
6
Change aggregate copy
7
Replica
8
User copy
SOURCE_CONDENSED A flag that indicates:

Y
Changes can be netted out, with at most one row in the base table for every original table primary key value.

N
All changes must remain, retaining a complete update history.

A
Valid only for base aggregate or change aggregate tables.
SOURCE_COMPLETE

A flag indicating:

Y
The base table contains a row for every primary key value of interest.

N
The base table contains some subset of rows of primary key values.

CD_OWNER The owner of the change data table.
CD_TABLE The name of the staging table for captured updates to the source table (set when you define the replication source). This value is used by the Apply program and can be the name of a table or a view.
PHYS_CHANGE_OWNER The owner of the PHYS_CHANGE_TABLE. For a view registration, the value equals the value of the change data replication source referenced in the change data view definition. The Capture program uses this value to properly maintain CD_OLD_SYNCHPOINT and CD_NEW_SYNCHPOINT for view replication sources. The Apply program uses this value to properly maintain CCD_OLD_SYNCHPOINT and SYNCHPOINT for view registrations based on CCD target table registrations that the Apply program maintains.
PHYS_CHANGE_TABLE The name of the physical CD or CCD table. For a view replication source, the value equals the value of the change data table replication source definition referenced in the change data view definition. The Capture program uses this value to properly maintain CD_OLD_SYNCHPOINT and CD_NEW_SYNCHPOINT for view replication sources. The Apply program uses this value to properly maintain CCD_OLD_SYNCHPOINT and SYNCHPOINT for view registrations based on the CCD target table registrations that the Apply program maintains.
CD_OLD_SYNCHPOINT The SYNCHPOINT value of the last cold start of the Capture program. The Capture program sets this value to NULL when the CD_TABLE is emptied. The Apply program sets this value to NULL for a target replica when cascading a gap condition. If the value is null when the synchpoint column of the pruning control table is set to x'00000000000000000000', the Capture program sets an initial value, and the same sequence number is reflected back into the SYNCHPOINT column of the pruning control table, which is the sequence number associated with the pruning control table update. Subsequent values are set by the Capture program when old rows are pruned from the table.
CD_NEW_SYNCHPOINT The SYNCHPOINT value associated with the most recent change inserted into the change data table. If the Capture program has not inserted into the change data table recently, then the value does not advance.

This value reduces the need to prepare and open cursors on change data tables. CD_NEW_SYNCHPOINT can reliably indicate a no-change condition only when CD_NEW_SYNCHPOINT is less than or equal to the SYNCHPOINT column of the subscription set table. Change conditions are not reported as reliably because uncommitted work will cause this value to increase, even when there are no committed updates to replicate.

DISABLE_REFRESH A flag that indicates whether full refresh queries are issued against the source table if a change data table becomes invalid, if a gap is detected, or if the Capture program cold starts. This flag prevents full refresh activity from overloading the source database when the Capture program is restarted. You can set this flag manually, use a program at the source database site to set it, or have the Capture program set it automatically while executing an UPDATE operation.
0
Full refreshes are enabled.
1
Full refreshes are prevented.

This column is initialized to 0.

CCD_OWNER The owner of the local consistent change data table.
CCD_TABLE The name of the staging table that contains committed-only captured updates as copied from a join of the local change data table (defined by a subscription definition, which names the source table) and the unit-of-work table.
CCD_OLD_SYNCHPOINT The SYNCHPOINT value of the oldest row in the external consistent change data table. This value is set in one of the following ways:

  • By the Control Center when the consistent change data table is being auto-registered. CCD_OLD_SYNCHPOINT is set to NULL.

  • By the Control Center when a consistent change data table is defined as an external replication source table. CCD_OLD_SYNCHPOINT is set to MIN(IBMSNAP_COMMITSEQ) of the consistent change data table.

  • By the Apply program or another external application.
SYNCHPOINT The SYNCHPOINT value equals the SYNCHPOINT field value in the register table. This value is used to coordinate the pruning of change data tables. The Apply program sets this initial value to 0, indicating refresh. If the Apply program sets a nonzero value, the change data table can be eligible for pruning.
SYNCHTIME A source server timestamp that can be added to any captured log records for any source table. This timestamp indicates that a change did not occur before this time. If the log records are individually timestamped, use those timestamps; otherwise, these values are approximate and are set by the Apply program at the start of a subscription cycle and after each subsequent cycle. These values are eventually appended into each change data table row.
CCD_CONDENSED A flag indicating:

Y
Changes can be netted out, with at most one row in the CCD table for every base table primary key value.

N
All changes must remain, retaining a complete update history.
CCD_COMPLETE

A flag indicating that:

Y
The CCD table contains a row for every primary key value of interest.

N
The CCD table contains some subset of rows of primary key values.

ARCH_LEVEL The architectural level of the definition in the row. This level is defined by IBM, and for Version 5 is '0201'.
DESCRIPTION A field for comments that you enter when defining replication sources.
BEFORE_IMG_PREFIX Represents the default character identifying before-image column names in the CD table. The value can be NULL, but must not match any leading character identifying after-image user data column names in the CD table. The length of BEFORE_IMG_PREFIX is:
1
For an ASCII single-byte character system prefix character.
1
For an EBCDIC single-byte character system prefix character.
2
For an ASCII double-byte character system prefix character.
4
For an EBCDIC double-byte character system prefix character. This length allows for shift-in and shift-out characters.
CONFLICT_LEVEL A flag that indicates:

2
Enhanced detection with cascading transaction rejection.

1
Standard detection (no log flush to CD) with cascading transaction rejection.

0
No conflict detection.

CONFLICT_LEVEL is assumed to never change and to be the same for all descendents of the user table.

PARTITION _KEYS_CHG A flag indicating:

N
The source table columns that are included in the partitioning keys are not updated by applications, only deleted or inserted. The Capture program will capture updates in a single row with IBMSNAP_OPERATION = 'U'.

Y
The source table columns that are included in the partitioning keys are not updated by applications. Updates are captured as two rows in the CD table with ascending IBMSNAP_INTENTSEQ values. The first row contains the IBMSNAP_OPERATION value, where 'D' = all other deletions, meaning the before-image of all columns. The second row contains the IBMSNAP_OPERATION value, where 'I' = all other insertions, meaning the after-image of all columns. The delete must have a lower IBMSNAP_INTENTSEQ value than the insert, so that the updated partitioning key will not allow out-migration from a particular partition. In such cases, the insert must come last so that the row will remain in the partition.

NULL
If this is the global control row.
dependent replicas.

Figure 42 and Figure 43 show the create table and create index statements for register tables.

Figure 42. Create Table and Create Index Statements for DB2 for OS/390 Version 4 or Higher Register Tables

DB2 for OS/390 Version 4 or Higher

CREATE TABLE ASN.IBMSNAP_REGISTER (
 SOURCE_OWNER CHAR(18) NOT NULL,
 SOURCE_TABLE CHAR(18) NOT NULL,
 SOURCE_VIEW_QUAL SMALLINT NOT NULL,
 GLOBAL_RECORD CHAR(1) NOT NULL,
 SOURCE_STRUCTURE SMALLINT NOT NULL,
 SOURCE_CONDENSED CHAR(1) NOT NULL,
 SOURCE_COMPLETE CHAR(1) NOT NULL,
 CD_OWNER CHAR(18),
 CD_TABLE CHAR(18),
 PHYS_CHANGE_OWNER CHAR(18),
 PHYS_CHANGE_TABLE CHAR(18),
 CD_OLD_SYNCHPOINT CHAR(10) FOR BIT DATA,
 CD_NEW_SYNCHPOINT CHAR(10) FOR BIT DATA,
 DISABLE_REFRESH SMALLINT NOT NULL,
 CCD_OWNER CHAR(18),
 CCD_TABLE CHAR(18),
 CCD_OLD_SYNCHPOINT CHAR(10) FOR BIT DATA,
 SYNCHPOINT CHAR(10) FOR BIT DATA,
 SYNCHTIME TIMESTAMP,
 CCD_CONDENSED CHAR(1),
 CCD_COMPLETE CHAR(1),
 ARCH_LEVEL CHAR(4) NOT NULL,
 DESCRIPTION CHAR(254),
 BEFORE_IMG_PREFIX VARCHAR(4),
 CONFLICT_LEVEL CHAR(1),
 PARTITION_KEYS_CHG CHAR(1));
 
CREATE TYPE 2 UNIQUE INDEX ASN.IBMSNAP_REGISTERX ON
 ASN.IBMSNAP_REGISTER (SOURCE_OWNER ASC, SOURCE_TABLE ASC, 
 SOURCE_VIEW_QUAL ASC);

Figure 43. Create Table and Create Index Statements for Register Tables on All Other Platforms

For All Other Platforms

CREATE TABLE ASN.IBMSNAP_REGISTER (
 SOURCE_OWNER CHAR(18) NOT NULL,
 SOURCE_TABLE CHAR(18) NOT NULL,
 SOURCE_VIEW_QUAL SMALLINT NOT NULL,
 GLOBAL_RECORD CHAR(1) NOT NULL,
 SOURCE_STRUCTURE SMALLINT NOT NULL,
 SOURCE_CONDENSED CHAR(1) NOT NULL,
 SOURCE_COMPLETE CHAR(1) NOT NULL,
 CD_OWNER CHAR(18),
 CD_TABLE CHAR(18),
 PHYS_CHANGE_OWNER CHAR(18),
 PHYS_CHANGE_TABLE CHAR(18),
 CD_OLD_SYNCHPOINT CHAR(10) FOR BIT DATA,
 CD_NEW_SYNCHPOINT CHAR(10) FOR BIT DATA,
 DISABLE_REFRESH SMALLINT NOT NULL,
 CCD_OWNER CHAR(18),
 CCD_TABLE CHAR(18),
 CCD_OLD_SYNCHPOINT CHAR(10) FOR BIT DATA,
 SYNCHPOINT CHAR(10) FOR BIT DATA,
 SYNCHTIME TIMESTAMP,
 CCD_CONDENSED CHAR(1),
 CCD_COMPLETE CHAR(1),
 ARCH_LEVEL CHAR(4) NOT NULL,
 DESCRIPTION CHAR(254),
 BEFORE_IMG_PREFIX VARCHAR(4),
 CONFLICT_LEVEL CHAR(1),
 PARTITION_KEYS_CHG CHAR(1);
 <additional padding columns for DB2 for OS/390 Version 3>);
 
CREATE UNIQUE INDEX ASN.IBMSNAP_REGISTERX ON
 ASN.IBMSNAP_REGISTER (SOURCE_OWNER ASC, SOURCE_TABLE ASC, 
 SOURCE_VIEW_QUAL ASC);

Trace Table

ASN.IBMSNAP_TRACE

This table contains trace information for Capture for MVS, Capture for VM, Capture for VSE, and the DB2 Universal Database.

On cold start, all of the trace table's entries will be deleted.

The message numbers ASN0100I, ASN0101W, ASN0102W are issued for warnings and initialization information.

Table 40 provides a brief description of the trace table columns.

Table 40. Trace Table Columns
Column name Description
OPERATION The type of Capture program operation, for example, initialization, capture, or error condition.
TRACE_TIME The time a row is inserted into the trace table.
DESCRIPTION The message ID followed by the message text. The message can be informational or error. This column contains English-only text and is used by IBM service personnel.

Figure 44 show the create table statements for trace tables.

Figure 44. Create Table Statement for Trace Tables on All Platforms

For All Platforms

CREATE TABLE ASN.IBMSNAP_TRACE (
 OPERATION CHAR(8) NOT NULL,
 TRACE_TIME TIMESTAMP NOT NULL,
 DESCRIPTION VARCHAR(254) NOT NULL); 

Tuning Parameters Table

ASN.IBMSNAP_CCPPARMS

This table contains parameters that you can modify to control the performance of the Capture program.

Table 41 provides a brief description of the tuning parameters table columns.

Table 41. Tuning Parameters Table Columns
Column name Description
RETENTION_LIMIT The age limit, in minutes, for keeping CD table rows. This value is used with the SYNCHPOINT column of the pruning control table to determine the pruning limit. Any change data rows older than this value are pruned, even if they have not been copied by all clients. Transactions rejected after update conflict detection will have their changes pruned by RETENTION_LIMIT aging, not by normal pruning. The default value is 10,800.
LAG_LIMIT The amount of time, in minutes, that the Capture program is allowed to lag in processing log records before it shuts itself down. During periods of high update frequency, full refreshes can be more economical than updates. The default value is 10,800.
COMMIT_INTERVAL The Capture program commit threshold, in seconds, for any inserts, updates, or deletes to any CD tables, pruning control tables, and the global ASN.IBMSNAP_UOW table. The default value is 30.

On systems that do not support ISOLATION (UR), this value should be less than the DB2 lock timeout value to prevent Apply program instances from timing out due to contention with the Capture program.

PRUNE_INTERVAL The Capture program commit threshold, in seconds, for automatic or manual pruning of CD and UOW rows that are no longer needed. The default value is 300. Values set lower will save space, but will increase processing costs. Values set higher require more CD and UOW table space but decrease processing costs.

Figure 45 shows the create table statement for the tuning parameter table.

Figure 45. Create Table Statement for the Tuning Parameter Table for All Platforms

For All Platforms

CREATE TABLE ASN.IBMSNAP_CCPPARMS (
 RETENTION_LIMIT INT,
 LAG_LIMIT INT,
 COMMIT_INTERVAL INT,
 PRUNE_INTERVAL INT);

Unit-of-Work Table

This section contains programming interface information.

ASN.IBMSNAP_UOW

The UOW table ensures data integrity by recording transactions that were committed at the source server. By performing a join of this table and the changes logged by the Capture program, the Apply program ensures that only committed changes are being copied. On cold start, all of this table's entries will be deleted.

This table is indexed into the CD table, ordered by the commit sequence. This order is necessary because:

This table is created automatically when you define a replication source. The existence and use of this table are required if the Capture program is installed.

The Capture program prunes the UOW table based on information inserted into the pruning control table by the Apply program. The Apply program maintains the log sequence number in the SYNCHPOINT column of the pruning control table. Initially, the Apply program sets this sequence number to zero when it performs a full refresh. A zero value signals the Capture program to start capturing. When the Apply program copies changes from the CD table to the target table, it updates the SYNCHPOINT column.

Pruning occurs depending on whether you start the Capture program with the PRUNE or NOPRUNE invocation parameter and how the prune interval is set in the tuning parameters table. If you don't specify a parameter, PRUNE is the default. See the Capture and Apply chapter for your platform in this book to learn how to set pruning.

Table 42 provides a brief description of the UOW table columns.

Table 42. UOW Table Columns
Column name Description
IBMSNAP_UOWID The unit-of-recovery ID from the log record header for this unit of work.
IBMSNAP_COMMITSEQ The transaction commit sequencing value.
IBMSNAP_LOGMARKER The approximate commit time at the source server.
IBMSNAP_AUTHTKN The authorization token associated with the transaction. This ID is useful for database auditing. For DB2 for MVS, this field is the correlation ID. This column is not automatically copied to other tables; you must select it and copy it as a user data column.
IBMSNAP_AUTHID The authorization ID associated with the transaction. It is useful for database auditing. For DB2 for MVS, this field is the primary authorization ID. This column is not automatically copied to other tables; you must select it and copy it as a user data column.
IBMSNAP_REJ_CODE A value indicating:

0
For a transaction with no known conflict

1
For a transaction containing at least one same-row intra-table update conflict

2
For a cascade-rejection of a transaction dependent on a prior transaction having at least one same-row conflict

3
For a transaction containing at least one constraint conflict, such as an inter-table referential constraint conflict

4
For a cascade-rejection of a transaction dependent on a prior transaction having at least one constraint conflict
IBMSNAP_APPLY_QUAL This column is blank for local updates and the name of the associated Apply program for foreign updates. The Capture program derives this value from the critical section table.

Figure 46, Figure 47, and Figure 48 show the create table and create index statements for UOW tables.

Figure 46. Create Table and Create Index Statements for DB2 for OS/390 Version 4 or Higher Unit-of-Work Tables

For DB2 for OS/390 Version 4 or Higher

CREATE TABLE ASN.IBMSNAP_UOW (
 IBMSNAP_UOWID CHAR(10) FOR BIT DATA NOT NULL,
 IBMSNAP_COMMITSEQ CHAR(10) FOR BIT DATA NOT NULL,
 IBMSNAP_LOGMARKER TIMESTAMP NOT NULL,
 IBMSNAP_AUTHTKN CHAR(12) NOT NULL,
 IBMSNAP_AUTHID CHAR(18) NOT NULL),
 IBMSNAP_REJ_CODE CHAR(1) NOT NULL WITH DEFAULT,
 IBMSNAP_APPLY_QUAL CHAR(18) NOT NULL WITH DEFAULT);
 
CREATE TYPE 2 UNIQUE INDEX ASN.IBMSNAP_UOW_IDX ON ASN.IBMSNAP_UOW (
 IBMSNAP_COMMITSEQ ASC, IBMSNAP_UOWID ASC, IBMSNAP_LOGMARKER ASC);

Figure 47. Create Table and Create Index Statements for DB2 for VM/VSE Unit-of-Work Tables

For DB2 for VM/VSE

CREATE TABLE ASN.IBMSNAP_UOW (
 IBMSNAP_UOWID CHAR(10) FOR BIT DATA NOT NULL,
 IBMSNAP_COMMITSEQ CHAR(10) FOR BIT DATA NOT NULL,
 IBMSNAP_LOGMARKER TIMESTAMP NOT NULL,
 IBMSNAP_AUTHTKN CHAR(12) NOT NULL,
 IBMSNAP_AUTHID CHAR(18) NOT NULL),
 IBMSNAP_REJ_CODE CHAR(1) NOT NULL,
 IBMSNAP_APPLY_QUAL CHAR(18) NOT NULL);
 
CREATE UNIQUE INDEX ASN.IBMSNAP_UOW_IDX ON ASN.IBMSNAP_UOW (
 IBMSNAP_COMMITSEQ ASC, IBMSNAP_UOWID ASC, IBMSNAP_LOGMARKER ASC);

Figure 48. Create Table and Create Index Statements for Unit-of-Work Tables on All Other Platforms

For All Other Platforms

CREATE TABLE ASN.IBMSNAP_UOW (
 IBMSNAP_UOWID CHAR(10) FOR BIT DATA NOT NULL,
 IBMSNAP_COMMITSEQ CHAR(10) FOR BIT DATA NOT NULL,
 IBMSNAP_LOGMARKER TIMESTAMP NOT NULL,
 IBMSNAP_AUTHTKN CHAR(12) NOT NULL,
 IBMSNAP_AUTHID CHAR(18) NOT NULL),
 IBMSNAP_REJ_CODE CHAR(1) NOT NULL WITH DEFAULT,
 IBMSNAP_APPLY_QUAL CHAR(18) NOT NULL WITH DEFAULT);
 
CREATE UNIQUE INDEX ASN.IBMSNAP_UOW_IDX ON ASN.IBMSNAP_UOW (
 IBMSNAP_COMMITSEQ ASC, IBMSNAP_UOWID ASC, IBMSNAP_LOGMARKER ASC);

Warm Start Table

ASN.IBMSNAP_WARM_START

This table contains information that enables the Capture program to resynchronize (see the warm start section of the Capture and Apply programs chapter for your platform). This table is created in the same database as the register table.

Table 43 provides a brief description of the warm start table columns.

Table 43. Warm Start Table Columns
Column name Description
SEQ The log RBA for this unit of work. Records the Capture program's position in the DBMS log. Used for quickly restarting following a shutdown or failure.
AUTHTKN The DB2 token for the unit of work associated with the SEQ position.
AUTHID The DB2 authorization ID for the unit of work associated with the SEQ position.
CAPTURED A flag indicating whether or not this unit of work was captured.
Y
This unit of work was captured.
N
This unit of work was not captured.
UOWTIME The MVS time of day (TOD), or Windows NT, HP-UX, Sun Solaris, OS/2and AIX coordinated universal time (CUT) clock indicating when the unit of work associated with the SEQ position was captured (source server timestamp).

Figure 49 show the create table statements for the warm start table.

Figure 49. Create Table Statement for the Warm Start Table on All Platforms

For All Platforms

CREATE TABLE ASN.IBMSNAP_WARM_START (
 SEQ CHAR(10) FOR BIT DATA,
 AUTHTKN CHAR(12),
 AUTHID CHAR(18),
 CAPTURED CHAR(1),
 UOWTIME INT);

Warm Start Table for Capture for VSE and VM

ASN.IBMSNAP_WARM_START

This table contains information that enables the Capture program to resynchronize for VSE and VM (see the warm start section for the Capture and Apply programs for VSE and VM). This table is created in the same database as the register table.

Table 44 provides a brief description of the columns in the warm start table for Capture for VSE and VM.

Table 44. Warm Start for Capture for VSE and VM Table Columns
Column name Description
SEQ The log RBA for this unit of work. Records the Capture program's position in the DBMS log. Used for quickly restarting following a shutdown or failure.
UOWID The unit-of-recovery ID from the log record header for this unit of work.
AUTHID The DB2 authorization ID for the unit of work associated with the SEQ position.
CAPTURED A flag indicating whether or not this unit of work was captured.
Y
This unit of work was captured.
N
This unit of work was not captured.
UOWTIME The VSE or VM time of day (TOD) clock indicating when the unit of work associated with the SEQ position was captured (source server timestamp).

Figure 50 shows the create table statement for warm start tables for Capture for VSE and VM.

Figure 50. Create Table Statement for Warm Start Tables for Capture for VSE and VM

For DB2 for VM/VSE

CREATE TABLE ASN.IBMSNAP_WARM_START (
 SEQ CHAR(10) FOR BIT DATA,
 UOWID CHAR(10) FOR BIT DATA
 AUTHID CHAR(18),
 CAPTURED CHAR(1),
 UOWTIME INT);


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

[ DB2 List of Books | Search the DB2 Books ]