Data manager log records

Data manager log records are the result of DDL, DML, or utility activities.

There are two types of data manager log records:
  • Data Management System (DMS) logs have a component identifier of 1 in their header.
  • Data Object Manager (DOM) logs have a component identifier of 4 in their header.
Table 1. DMS log record header structure (DMSLogRecordHeader)
Description Type Offset (Bytes)
Component identifier (=1) unsigned char 0(1)
Function identifier (See Table 2.) unsigned char 1(1)
Table identifiers

  Table space identifier

  Table identifier

  

unsigned short

unsigned short

  

2(2)

4(2)

Total Length: 6 bytes
Table 3. DOM log record header structure (DOMLogRecordHeader)
Description Type Offset (Bytes)
Component identifier (=4) unsigned char 0(1)
Function identifier (See Table 4.) unsigned char 1(1)
Object identifiers

  Table space identifier

  Object identifier

  

unsigned short

unsigned short

  

2(2)

4(2)

Table identifiers

  Table space identifier

  Table identifier

  

unsigned short

unsigned short

  

6(2)

8(2)

Object type unsigned char 10(1)
Flags unsigned char 11(1)
Total Length: 12 bytes
Table 4. DOM log record header structure function identifier values and definitions
Value Definition
2 Create index
3 Drop index
4 Drop table
5 Undo drop table
11 Truncate table (import replace)
12 Activate NOT LOGGED INITIALLY
35 Reorg table
101 Create table
130 Undo create table
Note: All data manager log record offsets are from the end of the log manager record header.

All log records whose function identifier short name begins with UNDO are log records written during the UNDO or ROLLBACK of the action in question.

The ROLLBACK can be a result of:
  • The user issuing the ROLLBACK transaction statement
  • A deadlock causing the ROLLBACK of a selected transaction
  • The ROLLBACK of uncommitted transactions following a crash recovery
  • The ROLLBACK of uncommitted transactions following a RESTORE and ROLLFORWARD of the logs.

Initialize table log record

The initialize table log record is written when a new permanent table is being created; it signifies table initialization. This record appears after any log records that creates the DATA and Block Map storage objects, and before any log records that create the LF and LOB storage objects. This is a Redo log record. The function ID is 128.

Table 5. Initialize table log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
File create LSN db2LSN 6(8)
Internal Internal 14(74)
Table description length sqluint32 88(4)
Table description record variable 92(variable)
Total Length: 92 bytes plus table description record length
Table 6. Table description record
Description Type Offset (Bytes)
  record type unsigned char 0(1)
  Internal Internal 1(1)
  number of columns unsigned short 2(2)
  array of column descriptor variable long variable
Total length: 4 bytes plus the array of column descriptor length
Table description record: Column descriptor array
(number of columns) * 8, where each element of the array contains:
  • field type (unsigned short, 2 bytes)
       SMALLINT     0x0000
       INTEGER      0x0001
       DECIMAL      0x0002
       DOUBLE       0x0003
       REAL         0x0004
       BIGINT       0x0005
       DECFLOAT64   0x0006
       DECFLOAT128  0x0007
       CHAR         0x0100
       VARCHAR      0x0101
       LONG VARCHAR 0x0104 
       DATE         0x0105
       TIME         0x0106
       TIMESTAMP    0x0107
       BLOB         0x0108
       CLOB         0x0109
       STRUCT       0x010D
       BOOLEAN      0x010F 
       BINARY       0x0110  
       VARBINARY    0x0111 
       XMLTYPE      0x0112
       GRAPHIC      0x0200
       VARGRAPH     0x0201
       LONG VARG    0x0202
       DBCLOB       0x0203
  • length (2 bytes)
    • If BLOB, CLOB, or DBCLOB, this field is not used. For the maximum length of this field, see the array that follows the column descriptor array.
    • If not DECIMAL, length is the maximum length of the field (short).
    • If PACKED DECIMAL: Byte 0, unsigned char, precision (total length) Byte 1, unsigned char, scale (fraction digits).
  • null flag (unsigned short, 2 bytes)
    • mutually exclusive: allows nulls, or does not allow nulls
    • valid options: no default, type default, user default, generated, or compress type default
         ISNULL                  0x0001
         NONULLS                 0x0002
         TYPE_DEFAULT            0x0004
         USER_DEFAULT            0x0008
         GENERATED               0x0040
         COMPRESS_SYSTEM_DEFAULT 0x0080
  • field offset (unsigned short, 2 bytes) This is the offset from the start of the fixed-length portion of user record to where the field's fixed value can be found.
Table description record: LOB column descriptor array
(number of LOB, CLOB, DBCLOB and structured-type fields) * 12, where each element of the array contains:
  • length (MAX LENGTH OF FIELD, sqluint32, 4 bytes)
  • inline length (INLINE_LENGTH, sqluint16, 2 bytes)
  • log flag (IS COLUMN LOGGED, sqluint16, 2 bytes)
  • reserved (internal, sqluint32. 4 bytes)

The first LOB, CLOB, DBCLOB or structured-type field encountered in the column descriptor array uses the first element in the LOB descriptor array. The second LOB, CLOB, DBCLOB or structured-type field encountered in the column descriptor array uses the second element in the LOB descriptor array, and so on.

Import replace (truncate) log record

The import replace (truncate) log record is written when an IMPORT REPLACE action is being executed. This record indicates the re-initialization of the table (no user records, new life LSN). The table identifiers in the log header identify the table being truncated (IMPORT REPLACE). This is a normal log record. The function ID is 11.

Table 7. Import replace (truncate) log record structure
Description Type Offset (Bytes)
Log header DOMLogRecordHeader 0(12)
Internal Internal 12(variable)
Total Length: 12 bytes plus variable length

Activate not logged initially log record

The activate not logged initially log record is written when a user issues an ALTER TABLE statement that includes the ACTIVATE NOT LOGGED INITIALLY clause. This is a normal log record. This is function ID 12.

Table 8. Active not logged initially log record structure
Description Type Offset (Bytes)
Log header DOMLogRecordHeader 0(12)
Internal Internal 12(4)
Long Tablespace ID* unsigned short 16(2)
Index Tablespace ID* unsigned short 18(2)
Index Object ID unsigned short 20(2)
LF Object ID unsigned short 22(2)
LOB Object ID unsigned short 24(2)
XML Object ID unsigned short 26(2)
Total Length: 28 bytes

* Same as table space identifiers in the DOM header; it is a unique identifier for each table space defined in the database.

Rollback insert log record

The rollback insert log record is written when an insert row action (INSERT RECORD) is rolled back. This is a Compensation log record. The function ID is 110.

Table 9. Rollback insert log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
Internal Internal 6(2)
Record Length unsigned short 8(2)
Free space unsigned short 10(2)
RID char[] 12(6)
Total Length: 16 bytes

Reorg table log record

The reorg table log record is written when the REORG utility has committed to completing the reorganization of a table. This is a normal log record. The function ID is 35.

Table 10. Reorg table log record structure
Description Type Offset (Bytes)
Log header DOMLogRecordHeader 0(12)
Internal variable 12(476)
Index token 1 unsigned short 488(2)
Temporary table space ID 2 unsigned short 490(2)
Long temporary table space ID unsigned short 492(2)
Total Length: 494 bytes
Note:
  1. If the value of the index token is not 0, it is the index by which the reorg is clustered (clustering index).
  2. If the value of the temporary table space ID is not 0, it is the system temporary table space that was used to build the reorganized table.

Create index, drop index log records

These log records are written when indexes are created or dropped. The two elements of the log record are:
  • The index root page, which is an internal identifier
  • The index token, which is equivalent to the IID column in SYSCAT.INDEXES. If the value for this element is 0, the log record represents an action on an internal index, and is not related to any user index.
This is a normal log record. The function ID is either 2 (create index) or 3 (drop index).
Table 11. Create index, drop index log records structure
Description Type Offset (Bytes)
Log header DOMLogRecordHeader 0(12)
Internal Internal 12(2)
Index token unsigned short 14(2)
Index root page sqluint32 16(4)
Total Length: 20 bytes

Create table, drop table, rollback create table, rollback drop table log records

These log records are written when the DATA object for a permanent table is created or dropped. For creation of an MDC or ITC table, there is also a create table log record for creation of the Block Map object. The DATA object (and block Map object if applicable) is created during a CREATE TABLE operation, and before table initialization (Initialize Table). Create table and drop table are normal log records. Rollback create table and rollback drop table are Compensation log records. The function ID is either 101 (create table), 4 (drop table), 130 (rollback create table), or 5 (rollback drop table).

Table 12. Create table, drop table, rollback create table, rollback drop table log records structure
Description Type Offset (Bytes)
Log header DOMLogRecordHeader 0(12)
Internal variable 12(72)
Total Length: 84 bytes

Alter table attribute log record

The alter table attribute log record is written when the state of a table is changed using the ALTER TABLE statement or as a result of adding or validating constraints. This can be a Normal or Compensation log record. The function ID is 124.

Table 13. Alter table attribute, undo alter table attribute
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
Alter bit (attribute) mask sqluint64 6(8)
Alter bit (attribute) values sqluint64 14(8)
Total Length: 22 bytes
Attribute bits
  0x00000001   Propagation
  0x00000002   Check Pending
  0x00000010   Value Compression
  0x00010000   Append Mode
  0x00200000   LF Propagation

All other bits are for internal use.

If one of the previously listed bits is present in the alter bit mask, then this attribute of the table is being altered. To determine the new value of the table attribute (0 = OFF and 1 = ON), check the corresponding bit in the alter bit value.

Alter table add columns, drop columns, rollback add columns, rollback drop columns log record

These log records are written when the user is adding or dropping columns to an existing table using an ALTER TABLE statement. Complete information on the old columns and new columns is logged.
  • Column count elements represent the old number of columns and the new total number of columns.
  • The parallel arrays contain information about the columns defined in the table. The old parallel array defines the table before the ALTER TABLE statement, while the new parallel array defines the table resulting from ALTER TABLE statement.
  • Each parallel array consists of 2 sections:
    • The first section has one 8-byte element for each column.
    • If there are any LOB or structured-type columns, the second section has one 12-byte element for each column. This element follows the array of 8-byte elements. If there are no LOB or structured-type columns, there are no 12-byte elements.
Alter table add columns and drop columns are Normal log records. Rollback add columns and rollback drop columns are Compensation log record. The function IDs are 102 (add column), 104 (undo add column), 169 (drop columns) or 170 (undo drop columns).
Table 14. Alter table add columns, drop columns, rollback add columns, rollback drop columns log records structure
Description Type Offset (Bytes)
Log header DMSLogRecordheader 0(6)
Internal Internal 6(2)
Old column count sqluint32 8(4)
New column count sqluint32 12(4)
Old parallel arrays 1 variable 16(variable)
New parallel arrays variable variable(variable)
Total Length: 16 bytes plus 2 sets of parallel arrays.
Array Elements:
  1. The lengths of the elements in this array are defined as follows:
    • If the element is a column descriptor, the element length is 8 bytes.
    • If the element is a LOB or structured-type column descriptor, the element length is 12 bytes.
For information about the column descriptor array or the LOB column descriptor array, see the description following Table 6.

Alter column attribute log record

The function IDs are 113 for non-LOB columns and 116 for LOB columns.

Table 15. Alter column attribute log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordheader 0(6)
Column ID unsigned short 6(2)
Old column definition Column descriptor 1 8(8)
New column definition Column descriptor 1 16(8)
Total Length: 24 bytes plus record length.
1 For a description of the column descriptor array, see the description following Table 6.

Undo alter column attribute log record

The function IDs are 115 for non-LOB columns and 119 for LOB columns.

Table 16. Undo alter column attribute log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
Column ID unsigned short 6(2)
Old column definition Column descriptor 1 8(8)
New column definition Column descriptor 1 16(8)
Total Length: 24 bytes plus record length.
1 For a description of the column descriptor array, see the description following Table 6.

Insert record, delete record, rollback delete record, rollback update record log records

These log records are written when rows are inserted into a table, or when a deletion or update is rolled back. Insert Record and Delete Record log records can also be generated during an update, if the location of the record being updated must be changed to accommodate the modified record data. Insert Record log records are Normal log records. Rollback Delete records and rollback update records are Compensation log records. The function IDs are 162 (insert), 161 (delete), 111 (rollback delete), or 112 (rollback update).

Table 17. Insert record, delete record, rollback delete record, rollback update record log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
lrIUDflags unsigned short 6(2)
Internal unsigned short 8(2)
Free space unsigned short 10(2)
RID char[] 12(6)
Record offset unsigned short 18(2)
Record header and data variable 20(variable)
Total Length: 20 bytes plus record length
Following are details about the record header and data:
Record header
  • 4 bytes
  • Record type (unsigned char, 1 byte).
  • Reserved (char, 1 byte)
  • Record length (unsigned short, 2 bytes)
Record
  • Variable length
  • Record type (unsigned char, 1 byte).
  • Reserved (char, 1 byte)
  • The rest of the record is dependent upon the record type and the table descriptor record defined for the table.
  • Data records with record type value 0 are for internal meta data, not user data.
  • The following fields apply to user data records with record type having the 1 bit set:
    • Fixed length (unsigned short, 2 bytes). This is the length of the fixed length section of the data row.
    • Formatted record (all of the fixed length columns, followed by the variable length columns).
  • The following fields apply to user data records with record type having the 2 bit set:
    • Number of columns (unsigned short, 2 bytes). This is the number of columns in the data portion of the data row. See Formatted user data record for table with VALUE COMPRESSION.
      Note: the offset array will contain 1 + the number of columns.
    • Formatted record (offset array, followed by the data columns).
A user record is specified completely by the following characteristics:
  1. Outer record type is 0, or
  2. Outer record type is 0x10, or
  3. Outer record type has the 0x04 bit set and
    • Inner record type has the 0x01 bit set, or
    • Inner record type has the 0x02 bit set.

Extracting inlined LOB data from formatted user data record

Inlined LOB data can be extracted from the user data record. Once the beginning of the LOB column data is located (based on whether the table has VALUE COMPRESSION enabled or not), examination of the first byte can reveal the presence of inlined LOB data.

If the first byte is 0x69, it marks the beginning of a 4-byte inlined LOB data header. The inlined LOB data begins after this 4-byte header.

If the first byte is 0x80, the LOB data is an empty string.

Formatted user data record for a table without VALUE COMPRESSION

For records formatted without VALUE COMPRESSION, all fields contain a fixed-length portion. In addition, the following field types have variable length parts:
  • VARCHAR
  • LONG VARCHAR
  • VARBINARY
  • BLOB
  • CLOB
  • VARGRAPHIC
  • LONG VARG
  • DBCLOB
The length of the fixed portion of the different field types can be determined as follows:
DECIMAL
This field is a standard packed decimal in the form: nnnnnn...s. The length of the field is: (precision + 2)/2. The sign nibble (s) is xC for positive (+), and xD or xB for negative (-).
SMALLINT INTEGER BIGINT DOUBLE REAL CHAR GRAPHIC BOOLEAN BINARY
The length field in the element for this column in the table descriptor record contains the fixed length size of the field.
DATE
This field is a 4-byte packed decimal in the form: yyyymmdd. For example, April 3, 1996 is represented as x'19960403'.
TIME
This field is a 3-byte packed decimal in the form: hhmmss. For example, 1:32PM is represented as x'133200'.
TIMESTAMP
This field is a 10-byte packed decimal in the form: yyyymmddhhmmssuuuuuu (DATE|TIME|microseconds).
VARCHAR LONG VARCHAR BLOB CLOB VARGRAPHIC LONG VARG DBCLOB VARBINARY
The length of the fixed portion of all the variable length fields is 4.

The following sections describe the location of the fixed portion of each field within the formatted record.

The table descriptor record describes the column format of the table. It contains an array of column structures, whose elements represent field type, field length, null flag, and field offset. The latter is the offset from the beginning of the formatted record, where the fixed length portion of the field is located.

Table descriptor record structure
record type
number of columns
column structure
  • field type
  • length
  • null flag
  • field offset
LOB information
Note: For more information, see the description following Table 5.
For columns that are nullable (as specified by the null flag), there is an additional byte following the fixed length portion of the field. This byte contains one of two values:
  • NOT NULL (0x00)
  • NULL (0x01)

If the null flag within the formatted record for a column that is nullable is set to 0x00, there is a valid value in the fixed length data portion of the record. If the null flag value is 0x01, the data field value is NULL.

The formatted user data record contains the table data that is visible to the user. It is formatted as a fixed length record, followed by a variable length section.

Formatted user data record structure for table without VALUE COMPRESSION
record type
length of fixed section
fixed length section
variable data section
Note: For more information, see the description following Table 17.

All variable field types have a 4-byte fixed data portion in the fixed length section (plus a null flag, if the column is nullable). The first 2 bytes (short) represent the offset from the beginning of the fixed length section, where the variable data is located. The next 2 bytes (short) specify the length of the variable data referenced by the offset value. If the high bit (0x8000) of the offset is set and the data record is varying-length string data, then the data is stored out of row. Clearing the high bit returns the offset for the varying-length data descriptor and in this case the length field is 24.

Formatted user data record for table with VALUE COMPRESSION

Records formatted with VALUE COMPRESSION consist of the offset array and the data portion. Each entry in the array is a 2-byte offset to the corresponding column data in the data portion. The number of column data in the data portion can be found in the record header, and the number of entries in the offset array is one plus the number of column data that exists in the data portion.
  1. Compressed column values consume only one byte of disk space which is used for attribute byte. The attribute byte indicates that the column data is compressed, for example, the data value is known but is not stored on disk. The high bit (0x8000) in the offset is used to indicate that the accessed data is an attribute byte. (Only 15 bits are used to represent the offset of the corresponding column data.)
  2. For regular column data, the column data follows the offset array. There will not be any attribute byte or any length indicator present.
  3. Accessed data can take two different values if it is an attribute byte:
    • NULL   0x01   (Value is NULL)
    • COMPRESSED SYSTEM DEFAULT   0x80   (Value is equal to the system default)
  4. The length of column data is the difference between the current offset and the offset of the next column.
  5. For varying-length string data and if the high bit (0x8000) in the offset is used to indicate the accessed data is a varying-length data descriptor and in this case the length field is 24. The varying-length data is stored out of row.
Formatted user data record structure for table with VALUE COMPRESSION
record type
number of column in data portion
offset array
data portion
Note: For more information, see the description following Table 17.

Insert record to empty page, delete record to empty page, rollback delete record to empty page, rollback insert record to empty page log records

These log records are written when the table is a multidimensional clustered (MDC) table. The Insert Record To Empty Page log record is written when a record is inserted and it is the first record on a page, where that page is not the first page of a block. This log record logs the insert to the page, as well as the update of a bit on the first page of the block, indicating that the page is no longer empty. The Delete Record To Empty Page log record is written when the last record is deleted from a page, where that page is not the first page of a block. This log record logs the delete from the page, as well as the update of a bit on the first page of the block, indicating that the page is empty. Insert Record to Empty Page log records and Delete Record to Empty Page log records are Normal log records. Rollback Delete Record log records and Rollback Insert Record log records are Compensation log records. The function IDs are 165 (insert record to empty page), 164 (delete record to empty page), 166 (rollback delete record to empty page), or 131 (rollback insert record to empty page).

Table 18. Rollback insert record to empty page
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
lrIUDflags unsigned short 6(2)
Record length unsigned short 8(2)
Free space unsigned short 10(2)
RID char[] 12(6)
Internal Internal 18(2)
First page of the block sqluint32 20(4)
Total length: 24 bytes

lrIUDflags

Table 19. lrIUDflags values and definition
Value Definition
0x0200 The operation is the result of redistribute or load
0x0400 The operation is the result of internal temporal operation
0x0800 The operation is the result of an MQT maintenance operation
0x1000 The operation is the result of a referential integrity operation
0x2000 The operation is the result of a trigger
0x4000 The operation is the result of a SET INTEGRITY statement
0x8000 The operation is the result of a decomposed update1
Note: An update operation is called a decomposed update when it is actually performed as a delete of the old record followed by an insert of the new record. The delete and the insert log record generated by a decomposed update would have the 0x8000 flag in the lrIUDflags field. An example of a decomposed update is in a partitioned database environment where the partitioning key value of a record is changed by the update operation that results in moving the record from one database partition to another.
Table 20. Insert record to empty page
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
lrIUDflags unsigned short 6(2)
Record Length unsigned short 8(2)
Free space unsigned short 10(2)
RID char[] 12(6)
Internal Internal 18(2)
First page of the block sqluint32 20(4)
Record offset unsigned short 24(2)
Record header and data variable 26(variable)
Total Length: 26 bytes plus Record length
Note: For Record Header and Data Details, see the description following Table 17.
Table 21. Rollback delete record to empty page and delete record to empty page
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
Internal Internal 6(2)
Record Length unsigned short 8(2)
Free space unsigned short 10(2)
RID char[] 12(6)
Internal Internal 18(2)
First page of the block sqluint32 20(4)
Record offset unsigned short 24(2)
Record header and data variable 26(variable)
Total Length: 26 bytes plus Record length

Update record log record

The update record log record is written when a row is updated. It contains two parts, each of which is identical to the insert record (also the same as the delete log record) log records (see Insert record, delete record, rollback delete record, rollback update record log records). The first part of the log record contains the pre-update image of the row being updated. In the second part, if the record type in the Record Header in the 'New record header and data' is x00 or x10, or the x04 bit set, it contains the post-update image of the row being updated. If the x02 bit is set in the record type, the after image will be in the preceding insert log record for the transaction and the insert log record will have the x04 bit set in the record type.

Table 22. Update record log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
lrIUDflags unsigned short 6(2)
Internal unsigned short 8(2)
Free space unsigned short 10(2)
RID char[] 12(6)
Record offset unsigned short 18(2)
Old record header and data variable 20(variable)
Log header DMSLogRecordHeader variable(6)
Internal Internal variable(2)
Internal unsigned short variable(2)
Free space unsigned short variable(2)
RID char[] variable(6)
Record offset unsigned short variable(2)
New record header and data variable variable(variable)
Total Length: 40 bytes plus 2 Record lengths

Rename of a table or schema log record

The Rename of a Table Schema Log Record is written when a table or schema name is modified. This is function ID 122.

Table 23. Rename of a table or schema log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
Total Length: 6 bytes

The Rename of a Table or Schema Log Record does not contain information regarding the old and new names of a table or schema object. Separate insert, update, and delete log records associated with operations on the system catalog tables are generated when a table or schema renaming takes place.

Undo rename of a table or schema log record

The Undo Rename of a Table Schema Log Record is written when a table or schema name modification is rolled back. This is function ID 123.

Table 24. Undo rename of a table or schema log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
Total Length: 6 bytes

The Rename of a Table or Schema Log Record does not contain information regarding the old and new names of a table or schema object. Separate insert, update, and delete log records associated with operations on the system catalog tables are generated when a table or schema renaming takes place.

Insert multiple records, undo insert multiple records

These log records are written when multiple rows are inserted into the same page of a table. Rollback insert multiple record is a compensation log record. The function IDs are 167 and 168.

Table 25. Insert multiple records structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
Padding char[] 6(2)
Number of records unsigned short 8(2)
Free space unsigned short 10(2)
Sum of record lengths unsigned short 12(2)
Variable part length unsigned short 14(2)
Pool page number sqluint32 16(4)
Record descriptions or rollback descriptions variable 20(variable)
Total Length: 20 bytes plus record length
Table 26. Records descriptions (one for each record)
Description Type Offset (Bytes)
RID unsigned char[6] 0(6)
Record offset unsigned short 6(2)
Record header and data variable 8(variable)
Total Length: 8 bytes plus record length
Table 27. Rollback descriptions (one for each record)
Description Type Offset (Bytes)
RID unsigned char[6] 0(6)
Record offset unsigned short 6(2)
Total Length: 8 bytes
For record header and data details, see the description following Table 17.

Update partition state, rollback partition state log records

The update partition state log record is written when a user issues an ALTER TABLE statement with ADD PARTITION, ATTACH PARTITION, or DETACH PARTITION clauses. It is also written when the SET INTEGRITY statement is executed on a partitioned table to bring a previously attached partition online and visible. The log record function ID is 137, while the undo or rollback log record function ID is 108.

Table 28. Update partition state, rollback partition state log record structure
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0(6)
Master table space identifier unsigned short 6(2)
Master table identifier unsigned short 8(2)
Internal Internal 10(2)
Data partition identifier unsigned short 12(2)
Internal Internal 14(6)
Internal Internal 20(2)
Partition action unsigned short 22(2)
Total Length: 24 bytes
Log header
See Table 1. The table space and table identifiers in the DMSLogRecordHeader match the TBSPACEID and PARTITIONOBJECTID column values in the SYSCAT.DATAPARTITIONS catalog view for the table partition.
Master table space identifier
The master table space identifier matches the TBSPACEID column value in the SYSCAT.TABLES catalog view for the partitioned table.
Master table identifier
The master table identifier matches the TABLEID column value in the SYSCAT.TABLES catalog view for the partitioned table.
Data partition identifier
The data partition identifier matches the DATAPARTITIONID column value in the SYSCAT.DATAPARTITIONS catalog view for the table partition.
Partition action
The partition action values have the following definitions:
Table 29. Data partition action values and definitions:
Action value Definition
1 ADD PARTITION
2 ATTACH PARTITION
4 SET INTEGRITY after ATTACH PARTITION
5 DETACH PARTITION (Deferred: Materialized query tables (MQT) need to be maintained.)1
6 DETACH PARTITION (Deferred: Nonpartitioned indexes require cleanup.)1
7 DETACH PARTITION (Immediate: Attached partition never had SET INTEGRITY executed.)1
8 DETACH PARTITION (Immediate: There are no MQT or nonpartitioned indexes.)1
13 DETACH PARTITION (Deferred: Logically detached)2
15 DETACH PARTITION (Deferred: Materialized query tables (MQT) need to be maintained.)2
16 DETACH PARTITION (Deferred: Attached partition never had SET INTEGRITY executed.)2
18 DETACH PARTITION (Deferred: Detached dependents maintained)2
20 DETACH PARTITION (Deferred: Nonpartitioned indexes require cleanup.)2
21 DETACH PARTITION (Immediate: DETACH complete.)2
Note:
  1. Starting with Db2® Version 9.7 Fix Pack 1, the action value will not be generated. The value is listed for backward compatibility only.
  2. The action value is defined starting with Db2 Version 9.7 Fix Pack 1.

The start of out-of-row data log record

The function ID for this log record is 211. The start of out-of-row data log record can be written for any of the following operations:
  • Long field (LF) or LOB data is logged for a table that has DATA CAPTURE CHANGES enabled.
  • XML data is inserted or updated for a table that has DATA CAPTURE CHANGES enabled and the registry variable DB2_DCC_XML_SERIALIZE set to ON.
Note: There might not be any LF, LOB, or XML serialized document log records following the start of out-of-row data log record.
Table 30. The start of out-of-row data log record
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0 (6)
The total length of the start of out-of-row data log record is 6 bytes.

The undo start of out-of-row data log record

The function ID for this log record is 212.
Table 31. The undo start of out-of-row data log record
Description Type Offset (Bytes)
Log header DMSLogRecordHeader 0 (6)
The total length of the undo start of out-of-row data log record is 6 bytes.