GAPFIX (Fix CDC Gaps)

The GAPFIX function allows you to fix gaps that occurred during Change Data Capture (CDC) processing. Using CDC does not normally cause any processing gaps. However, you need to know what action to take when gaps do occasionally occur.
datacom
The GAPFIX function allows you to fix gaps that occurred during Change Data Capture (CDC) processing. Using CDC does not normally cause any processing gaps. However, you need to know what action to take when gaps do occasionally occur.
The following topics are discussed on this page:
 
 
When to Use GAPFIX
Use the GAPFIX function when a gap occurs during Change Data Capture (CDC) processing.
A gap can occur at the following three points in time:
  • The first gap can occur when a MUF is defined to have CDC set for a set of databases, but the MUF is then enabled and runs for an extended period of time without an established or started Change Data Capture Listener (CDCL) task, during which time the LXX spills its first CDC record. The CDCL task fails to see the spilled data when it is established or started after the spill, because the spilled data is then missing from the LXX. This point in time includes cases in which the CDC database was for some reason null loaded.
  • The second gap can occur when the source MUF and the CDCL task are running normally, the CDC database becomes full, and time passes before the full database is noticed and resolved. By the time the full database is resolved, the LXX no longer has enough room available for the work that occurred before the resolution took place, resulting in some of the CDC data being spilled and overlaid on the LXX. When the CDCL task is restarted, the gap is detected.
  • The third gap can occur when the CDCL task starts and processes prior CDC records (the prior records are known to the associated control record) but then discovers that while it was stopped the LXX was initialized or reset. This situation indicates that data could have existed while the CDCL task was stopped but before the LXX was initialized or reset. In this case, provide that missing data before you start new CDC records.
You handle each of the three previously described cases based on whether the control record still exists.
  • If the control record still exists, execute the GAPFIX function of DBUTLTY with the ordered RXX file or files from the date-time of the gap. The date-time of the gap is provided in message DB03121I. GAPFIX directs message DB03121I to the MUF JES log. The STARTED and ENDED examples of message DB03121I are:
    DB03121I - DBCPGPR DBDVL A-DBDVM01 STARTED LASTLXX-00000000000000 DB03121I - DBCPGPR DBDVL A-DBDVM01 ENDED LASTLXX-20060622142058
    The date-time of the gap is provided in the ENDED form of message DB03121I following the LASTLXX in the format of ccyymmddhhmmss..
    • cc is the century
    • yy is the year
    • mm is the month
    • dd is the day
    • hhmmss to give the hour and minutes and seconds.
     GAPFIX also can generate error message DB03122E and informational message DB03123I.
    Examples are:
    DB03122E - DBCPGPR ERROR RXX EMPTY DB03123I - DBCPGPR ENDING
    The GAPFIX function reads the control record and processes the RXX data in the same way that the CDCL task processes the LXX directly. The GAPFIX function adds TSN records and adds or deletes MNT records, just as CDCL does. It also updates the control record and does commits, similar to CDCL, but because the RXX is not track-oriented, the commits occur either after every 1000 CDC records or 10000 log records. The GAPFIX function of DBUTLTY can always be restarted if for some reason it fails.
  • If the control record existed and you provided the starting date and time, if a commit has occurred a control record now exists and the date and time option must be removed when running the GAPFIX function. All RXX data needs to be processed, or at least all not currently on the LXX. If the CDCL task is set to open, the last log record handled by the GAPFIX function remains on the LXX and can therefore restart with no risk of missing data. Data spilled to the LXX still exists on the LXX until it has been overlaid with new data.
    If the control record does not exist, it might be because CDC is just starting or because the CDC database has been lost. If a control record does not exist, use GAPFIX and begin by choosing a starting date and time to use as the value of the GAPFIX DATETIME= keyword (see How to Use). In executing the GAPFIX function, ensure that the first and all subsequent RXX files after the date and time you specify are included. When GAPFIX execution begins, it makes certain that no control record exists then adds a record with a starting date and time of the first log record that matches or comes after the DATETIME= you specified. GAPFIX processes all RXX data in the same way as CDCL would. At completion, the CDC control record is updated to reflect the last RXX log record. After the GAPFIX function completes, you have two choices as follows:
    • You can run GAPFIX again, providing the last RXX file and newer RXX files, if any exist.
    • Alternately, you can direct the CDCL task to open with CDCL_OPEN, causing the CDCL task to open and read the control record. If the oldest log record processed is now on the LXX, the CDCL task continues with normal processing. If the LXX does not have the needed record, it indicates that a new gap has been found. The CDCL task issues a new gap message, and closes.
How to Use GAPFIX
The MUF must be active when you execute this command. To fix a gap that occurred during CDC processing, use the following command.
►►─ GAPFIX DBID=
n,
OPTION2=A
mufname,
─┬──────────────┬───────────────────────► └─ DATETIME=
t
─┘ ►─┬───────────────────────┬─┬───────────────┬──────────────────────────────►◄ └─ ,OPTION1-
plus-dbids
─┘ └─ ,REPORT=ALL ─┘
 
Command
 
  •  
    GAPFIX
    Invokes the GAPFIX function. GAPFIX must start with a proper file boundary, not within volumes. Because GAPFIX reads and updates the control record, it cannot run if the CDCL task is open. If the RXX contains no records, an error is recognized and GAPFIX fails.
 
Required Keywords
 
  •  
    DBID=
    n
     
    Identifies the CDC database, where 
    n
     is the CDC database ID. This keyword allows you, if necessary, to specify a system database ID for the CDC database other than the default DBID of 2009.
    •  
      Valid Entries:
      Valid database ID of the CDC database
    •  
      Default Value:
      2009
  •  
    OPTION2=A
    mufname
     
    Identifies the letter A as the control ID, and identifies the MUF or MUFplex in the 
    mufname.
    The control ID occurs in every CDC database record that is built and defines record format mapping. It does not indicate a release level.
    The MUF or MUFplex name must match that of the RXX file header. If the control record exists, this MUF or MUFplex name must also match that of the control record. The MUF name or MUFplex name used in GAPFIX is known only from the cycle start record.
    •  
      Valid Entries:
      the letter A followed by a valid MUF or MUFplex name
    •  
      Default Value:
      (No default)
 
Optional Keywords
 
  •  
    DATETIME=
    t
     
    DATETIME= specifies the date and time at which you want to start the GAPFIX function.
    •  
      Valid Entries:
      a valid date and time at which to start the GAPFIX function
    •  
      Default Value:
      (No default)
  •  
    OPTION1=
    plus-dbids
     
    Specify the database IDs for one through eight PLUS databases.
    For example, adding one PLUS database with a database ID of 2012 is specified as follows:
    OPTION1=2012
    If specifying more than one PLUS database, omitted databases are indicated by a comma, if they are not at the end (termination) of the list. For example:
    OPTION1='2012,,,,,,,2019'
    A list of databases is surrounded by single quote marks as shown.
  •  
    REPORT=ALL
    Specifying REPORT=ALL generates a detail report that you can use for debugging and testing purposes. The detail report provides a line for every CDC log record that is processed. For a sample detail report, see GAPFIX Detail Report Sample.
     The GAPFIX function always prints a non-detail report when it completes. For a sample non-detail report, see GAPFIX Non-Detail Report Sample.
GAPFIX Reports
For testing purposes, you need not ever open the CDCL task. Testing can be done with the GAPFIX function after the data is spilled.
GAPFIX has access only to RXX files, not LXX files. GAPFIX cannot validate the LXX INIT/RESET dates, nor can it provide them if a missing control record has been added by the GAPFIX function. The first CDCL task adds the current INIT/RESET dates and presumes the user has not done a reset.
Sample Report
Following is a sample report page. For an example report header, see Sample Report Headers.
DATACOM/DB FIXGAP TOTAL LOG CDC LOG ADDED ADDED DELETED RECORDS RECORDS TSN RECORDS MNT RECORDS MNT RECORDS 49,109 12,222 12 12,001 1 LOW DATE/TIME LOW STCK HIGH DATE/TIME HIGH STCK 20060622142058 00BEFE47790C696F0800 20060622142101 00BEFE477C25F6D18E00
This page of a GAPFIX non-detail report, that always prints when the GAPFIX function completes, displays the following information:
  •  
    TOTAL LOG RECORDS
    Displays the number of log records read starting with the one matching a DATETIME= option or the one following the required matching record when not using DATETIME=. It reflects the records actually processed, not skipped.
  •  
    CDC LOG RECORDS 
    Displays the number of log records not skipped, as previously described. This includes records subject to CDC and also commit and backout type records.
  •  
    ADDED TSN RECORDS
    Displays the number of TSN type records added.
  •  
    ADDED MNT RECORDS
    Displays the number of MNT type records that were added.
  •  
    DELETED MNT RECORDS
    Displays the number of MNT type records that were deleted. These occur due to various types of backout conditions. More deletes occur than adds because a previous execution could have added the records with the rollback occurring in that execution.
  •  
    LOW DATE/TIME and LOW STCK
    The LOW DATE/TIME and LOW STCK (low store clock) values represent the lowest record processed, that is, not skipped.
  •  
    HIGH DATE/TIME and HIGH STCK
    The HIGH DATE/TIME and HIGH STCK (high store clock) value is the highest log record processed.
GAPFIX Detail Report Sample
• DATACOM/DB FIXGAP •JOB NAME R-UNIT DATE TIME REQUEST BASE BLOCK URI AREA PLUS SLOT • •DBDVL13 80,829 8/14/2013 10.21.32 ADDITC01 997 00000002 00000001 A01 12------9 •DBDVL13 80,829 8/14/2013 10.21.32 ADDITC02 897 00000002 00000001 C02 12------9 •DBDVL13 80,829 8/14/2013 10.21.32 ADDITF01 797 00000000 00000002 A01 12------9 •DBDVL13 80,829 8/14/2013 10.21.32 ADDITF02 697 00000002 00000001 A01 --------9 •DBDVL13 80,829 8/14/2013 10.21.32 ADDITF03 597 00000002 00000001 A01 -2------- •DBDVL13 80,829 8/14/2013 10.21.32 ADDITRNA 497 00000002 00000001 A01 1-------- •DBDVL13 80,829 8/14/2013 10.21.32 ADDITRNB 397 00000002 00000001 A01 --------9 •DBDVL13 80,829 8/14/2013 10.21.32 COMIT 0 00000000 00000000 •DBDVL13 80,829 8/14/2013 10.21.32 ADDITC01 997 00000002 00000003 A01 12------9 •DBDVL13 80,829 8/14/2013 10.21.32 ROLBK 0 00000000 00000000 •DBDVL13 80,829 8/14/2013 10.21.32 DELETC01 997 00000002 00000001 A01 12------9 •DBDVL13 80,829 8/14/2013 10.21.32 DELETC02 897 00000002 00000001 C02 12------9 •DBDVL13 80,829 8/14/2013 10.21.32 DELETF01 797 00000000 00000002 A01 12------9 •DBDVL13 80,829 8/14/2013 10.21.32 DELETF02 697 00000002 00000005 A01 --------9 •DBDVL13 80,829 8/14/2013 10.21.32 DELETF03 597 00000002 00000006 A01 -2------- •DBDVL13 80,829 8/14/2013 10.21.32 DELETRNA 497 00000002 00000001 A01 1-------- •DBDVL13 80,829 8/14/2013 10.21.32 DELETRNB 397 00000002 00000007 A01 --------9 •DBDVL13 80,829 8/14/2013 10.21.32 DELETRNB 397 00000002 00000002 A01 --------9 •DBDVL13 80,829 8/14/2013 10.21.32 COMIT 0 00000000 00000000 •DBDVL13 80,829 8/14/2013 10.21.32 ADDITRNA 497 00000002 00000008 A01 1-------- •DBDVL13 80,829 8/14/2013 10.21.34 COMIT 0 00000000 00000000 •DBDVL13 80,829 8/14/2013 10.21.34 ADDITF02 697 00000002 00000006 A01 --------9 •DBDVL13 80,829 8/14/2013 10.21.37 COMIT 0 00000000 00000000 •DBDVL13 80,829 8/14/2013 10.21.37 ADDITF03 597 00000002 00000007 A01 -2------- •DBDVL13 80,829 8/14/2013 10.21.41 CLOSE 0 00000000 00000000 •
This is the first page of a sample detail report resulting from specifying the GAPFIX function with REPORT=ALL. Most of the columns are self-explanatory. However, the PLUS SLOT column indicates which CDC_PLUS slot the AUD (add it, update, or delete) log record went to. The example provides some records going to two output slots and some to individual slots. The example provides some records going to two output slots and some to individual slots. The report summary also provides detail plus slot information.
DATACOM/DB FIXGAP TOTAL LOG CDC LOG ADDED ADDED DELETED RECORDS RECORDS TSN RECORDS MNT RECORDS MNT RECORDS 317 116 18 165 3 CDC_PLUS ADDED ADDED DELETED DBID SLOT TSN RECORDS MNT RECORDS MNT RECORDS 2009 1 6 50 1 CDC_PLUS ADDED ADDED DELETED DBID SLOT TSN RECORDS MNT RECORDS MNT RECORDS 3009 2 6 47 1 CDC_PLUS ADDED ADDED DELETED DBID SLOT TSN RECORDS MNT RECORDS MNT RECORDS 4009 9 6 68 1 LOW DATE/TIME LOW STCK HIGH DATE/TIME HIGH STCK 20130814102124 00CBCF95CC5E04CA5B00 20130814102142 00CBCF95DCD67E2C5800
This is the second page of a sample detail report resulting from specifying the GAPFIX function with REPORT=ALL.