DB2 10.5 for Linux, UNIX, and Windows

Log record header

All DB2® log records begin with a log manager header.

This header contains information detailing the log record and transaction information of the log record writer.

Table 1. Log Manager Log Record Header (LogManagerLogRecordHeader)
Field Description Data Type Offset (bytes)
Length of the log record db2Uint32 0(4)
Type of the log record (see Table 2) db2Uint16 4(2)
Log record flags 1 db2Uint16 6(2)
Log sequence number (LSN) of the log record db2LSN 2 8(8)
Log flush sequence (LFS) for this log record db2Uint64 16(8)
Log sequence offset (LSO) of the previous log record in this transaction db2Uint64 24(8)
Unique transaction identifier SQLU_TID 3 32(6)
Log stream ID db2LogStreamIDType 38(2)
Extra log stream ID of previous LSO for compensation log records db2LogStreamIDType 40(2)
Reserved Not applicable 42(6)
Extra LSO for compensation log records db2Uint64 48(8)
Extra LSO for propagatable compensation log records db2Uint64 56(8)
Note: A basic log record header has a total length of 40 bytes and the log stream ID is not set. Compensation log records require an extra LSO value at the end, for a total length of 56 bytes. Propagatable compensation log records require an additional LSO value at the end, for a total length of 64 bytes. In both of these cases, the log stream ID field is set appropriately.
Note:
  1. Log record general flag constants
       Redo always                                          0x0001
       Propagatable                                         0x0002
       Temp table                                           0x0004
       Table space rollforward undo                         0x0008
       Singular transaction (no commit/rollback)            0x0010
       Conditionally recoverable                            0x0080
       Table space rollforward at check constraint process  0x0100
       Runtime rollback                                     0x0200
       Pseudo compensation                                  0x0800
  2. Log sequence number (LSN)
       A 64-bit identifier that determines the order of the operations
       that generated the log records. The LSN is an ever-increasing value.
       Each member writes to its own set of log files (a log stream),
       and the LSN within a single log stream is a unique number.
    
       db2LSN: { db2Uint64 lsnU64;
                         }
  3. Transaction identifier (TID)
       A unique log record identifier representing the transaction.
    
       SQLU_TID: union { unsigned char  [6] ;
                         unsigned short [3] ;
                         }
  4. Record ID (RID)
       A unique number identifying the position of a record.
       RID: Page number 	char [4];
       slot number 	char [2];
Table 2. Log Manager Log Record Header Log Type Values and Definitions
Value Definition
0x0041 Normal abort
0x0042 Backout free
0x0043 Compensation
0x0049 Heuristic abort
0x004A Load start
0x004E Normal log record
0x004F Backup end
0x0051 Global pending list
0x0052 Redo
0x0055 Undo
0x0056 System catalog migration begin
0x0057 System catalog migration end
0x0069 information only. A log record of type 0x0069 is an informational log record only. It is ignored by the DB2 database manager during rollforward, rollback, and crash recovery.
0x006F Backup start
0x0071 Table Space Roll Forward to Point in Time Ends
0x0072 TIMESTAMP log record. Marks a timestamp that can be used for point in time recovery.
0x007B MPP prepare
0x007C XA prepare
0x007D Transaction Manager (TM) prepare
0x0084 Normal commit
0x0085 MPP subordinate commit
0x0086 MPP coordinator commit
0x0087 Heuristic commit
0x0089 Table Space Roll Forward to Point in Time Starts
0x008A Local pending list
0x008B Application information