Table of Contents

Search

  1. Preface
  2. Change Data Capture Introduction
  3. PowerExchange Listener
  4. PowerExchange Condense
  5. DB2 for i5/OS Change Data Capture
  6. Remote Logging of Data
  7. Introduction to Change Data Extraction
  8. Extracting Change Data
  9. Monitoring CDC Sessions
  10. Managing Change Data Extractions
  11. Tuning CDC Sessions
  12. Appendix A: DTL__CAPXTIMESTAMP Time Stamps

CDC Guide for i5/OS

CDC Guide for i5/OS

Restart Tokens and the Restart Token File

Restart Tokens and the Restart Token File

PowerExchange uses a pair of token values, called a restart token pair, to determine where to begin extracting change data in the change stream for each source in a CDC session. A restart token pair matches the position of a specific change record in the change stream.
You can specify restart token pairs in the restart token file. PWXPC also stores restart tokens for CDC sessions that have run in a state table or file. The token values in the restart token file override those in the state table or file.
Specify restart tokens in the restart token file in the following situations:
  • For a new CDC session, specify restart token pairs for the sources in the session. You can define a unique restart token pair for each source, or use the special override statement to specify a restart token pair that pertains to all or multiple data sources. The restart tokens should represent the point-in-time in the change stream when you materialized the corresponding targets.
  • If you add a data source to a CDC session, specify a restart token pair for that source.
  • If you need to override token values for one or more data sources in a CDC session, use override statements in the restart token file.
A restart token pair is composed of the following token types:
Sequence token
A binary value that represents, for each change record that is read, the change stream position of the end of the UOW followed by the position of the change record. A sequence token is a strictly ascending and repeatable value.
Restart token
A binary value that represents, for each change record that is read, a change stream position that PowerExchange can use to reconstruct the UOW state for the change record.
In some cases, the restart token might contain the position of the oldest open UOW. An open UOW is a UOW for which PowerExchange has read the beginning of the UOW from the change stream but has not yet read the commit record, or end-UOW.
When a CDC session runs, PWXPC reads the token values for each source from the state table or file and also reads the restart token file. PowerExchange uses the appropriate restart token values to determine the point from which to start reading change data from the change stream for each source in the CDC session. After determining the start point, PowerExchange starts reading and passing change data to PWXPC. PWXPC uses the sequence token for a source to determine the point at which to start providing the change data for the source.

0 COMMENTS

We’d like to hear from you!