Data manager log records are the result of DDL, DML, or Utility activities.
There are two types of data manager log records:
Table 87. DMS Log Record Header Structure (DMSLogRecordHeader)
Description | Type | Offset (Bytes) | ||
---|---|---|---|---|
Component identifier (=1) | unsigned char | 0(1) | ||
Function identifiera | unsigned char | 1(1) | ||
Table identifiers Tablespace identifier Table identifier | unsigned short
| 2(2)
| ||
Total Length: 6 bytes | ||||
|
Table 88. DOM Log Record Header Structure (DOMLogRecordHeader)
Description | Type | Offset (Bytes) |
---|---|---|
Component identifier (=4) | unsigned char | 0(1) |
Function identifiera | unsigned char | 1(1) |
Object identifiers Tablespace identifier Object identifier | unsigned short
| 2(2)
|
Table identifiers Tablespace identifier Table identifier | unsigned short
| 6(2)
|
Object type | unsigned char | 10(1) |
Flags | unsigned char | 11(1) |
Total Length: 12 bytes | ||
a For a list of valid function identifier values, see Table 87.
|
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 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 create the DATA storage object, and before any log
records that create the LF and LOB storage objects. This is a Redo log record.
Table 89. Initialize Table Log Record Structure
Description | Type | Offset (Bytes) | ||
---|---|---|---|---|
Log header | DMSLogRecordHeader | 0(6) | ||
File create LSN | SQLU_LSN | 6(6) | ||
Table directory record | variable | 12(72) | ||
record type | unsigned char | 12(1) | ||
reserved | char | 13(1) | ||
index flag | unsigned short | 14(2) | ||
index root page | unsigned long | 16(4) | ||
TDESC recid | long | 20(4) | ||
reserved | char | 24(56) | ||
flagsa | unsigned long | 80(4) | ||
Table description length | 84(4) | |||
Table description record | variable | 88(variable) | ||
record type | unsigned char | 88(1) | ||
reserved | char | 89(1) | ||
number of columns | unsigned short | 90(2) | ||
array | variable long | 92(variable) | ||
Total Length: 88 bytes plus table description record length | ||||
| ||||
|
The import replace (truncate) log record is written when an IMPORT REPLACE
action is being executed. This record indicates the reinitialization of the
table (no user records, new life LSN). The second set of pool and object IDs
in the log header identify the table being truncated (IMPORT REPLACE). This is
a Redo log record.
Table 90. Import Replace (Truncate) Log Record Structure
Description | Type | Offset (Bytes) |
---|---|---|
Log header | DOMLogRecordHeader | 0(12) |
internal | variable | 12(variable) |
Total Length: 12 bytes plus variable length |
The rollback insert log record is written when an insert row action (INSERT
RECORD) is rolled back This is a Compensation log record.
Table 91. Rollback Insert Log Record Structure
Description | Type | Offset (Bytes) |
---|---|---|
Log header | DMSLogRecordHeader | 0(6) |
Padding | char[ ] | 6(2) |
RID | long | 8(4) |
Record length | unsigned short | 12(2) |
Free space | unsigned short | 14(2) |
Total Length: 16 bytes |
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.
Table 92. Reorg Table Log Record Structure
Description | Type | Offset (Bytes) | ||
---|---|---|---|---|
Log header | DOMLogRecordHeader | 0(12) | ||
Internal | variable | 12(252) | ||
Index tokena | unsigned short | 2(264) | ||
Temporary tablespace IDb | unsigned short | 2(266) | ||
Total Length: 268 bytes | ||||
a If not 0, it is the index by which the reorg is clustered (clustering index). b If not 0, it is the temporary table space that was used to build the reorg. |
These log records are written when indexes are created or dropped. The two elements of the log record are:
This is a Undo log record.
Table 93. Create Index, Drop Index Log Records Structure
Description | Type | Offset (Bytes) |
---|---|---|
Log header | DOMLogRecordHeader | 0(12) |
Padding | char[ ] | 12(2) |
Index token | unsigned short | 14(2) |
Index root page | unsigned long | 16(4) |
Total Length: 20 bytes |
These log records are written when the DATA object for a permanent table is
created or dropped. The DATA object is created during a CREATE TABLE, and
prior to table initialization (Initialize Table). Create table and drop table
are Normal log records. Rollback create table and rollback drop table are
Compensation log records.
Table 94. 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(56) |
Total Length: 68 bytes |
The alter check pending log record is written when the state of a table is changed as a result of adding or validating constraints. A table is in CHECK PENDING STATE when the flag value for this PENDING state is 1 (TRUE = CHECK PENDING). Access to a table is restricted when it is in the CHECK PENDING state.
The alter propagation log record is written when the user changes the propagation state of a table with an ALTER TABLE statement. Valid flag values are:
Alter propagation and alter check pending are Normal log records.
Rollback propagation change and rollback check pending change are Compensation
log records.
Description | Type | Offset (Bytes) |
---|---|---|
Log header | DMSLogRecordHeader | 0(6) |
Padding | char[ ] | 6(2) |
Old flag value | int | 8(4) |
New flag value | int | 12(4) |
Total Length: 16 bytes |
The alter table add columns log record is written when the user is adding columns to an existing table using an ALTER TABLE statement. Complete information on the old columns and the resulting columns (new columns equals resulting columns minus old columns) is logged.
Alter table add columns is a Normal log record. Rollback add columns is a
Compensation log record.
Table 96. Alter Table Add Columns, Rollback Add Columns Log Records Structure
Description | Type | Offset (Bytes) | ||
---|---|---|---|---|
Log header | DMSLogRecordheader | 0(6) | ||
Padding | char[ ] | 6(2) | ||
Old column count | int | 8(4) | ||
New column count | int | 12(4) | ||
Old LOB count | int | 16(4) | ||
New LOB count | int | 20(4) | ||
Old LF count | int | 24(4) | ||
New LF count | int | 28(4) | ||
Old VAR flag value | int | 32(4) | ||
New VAR flag value | int | 36(4) | ||
Old parallel arraysa | variable | 40(variable) | ||
New parallel arraysb | variable | variable | ||
Total Length: 40 bytes plus 2 sets of parallel arrays; array size is (old/new column count) * 20. | ||||
For information about the column descriptor array or the LOB descriptor array, see Table 89). |
These log records are written when rows are inserted into or deleted from a
table. Insert record and delete record log records are generated during an
update if the location of the record being updated must be changed to
accommodate the modified record data. Insert record and delete record are
Normal log records. Rollback delete record and rollback update record are
Compensation log records.
Description | Type | Offset (Bytes) | ||
---|---|---|---|---|
Log header | DMSLogRecordHeader | 0(6) | ||
Padding | char[ ] | 6(2) | ||
RID | long | 8(4) | ||
Record length | unsigned short | 12(2) | ||
Free space | unsigned short | 14(2) | ||
Record offset | unsigned short | 16(2) | ||
Record header and data | variable | 18(variable) | ||
Total Length: 18 bytes plus Record length | ||||
|
Formatted User Data Record
The formatted record can be a combination of fixed and variable length data. All fields contain a fixed length portion. In addition, there are seven field types that have variable length parts:
Field Lengths
The length of the fixed portion of the different field types can be determined as follows:
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 (-).
The length field in the element for this column in the table descriptor record contains the fixed length size of the field.
This field is a 4-byte packed decimal in the form: yyyymmdd. For example, April 3, 1996 is represented as x'19960403'.
This field is a 3-byte packed decimal in the form: hhmmss. For example, 1:32PM is represented as x'133200'.
This field is a 10-byte packed decimal in the form: yyyymmddhhmmssuuuuuu (DATE|TIME|microseconds).
The length of the fixed portion of all the variable length fields is 4.
Note: | For element addresses, see Table 89. |
For more detailed information about field types, see the SQL Reference.
The following sections describe the location of the fixed portion of each field within the formatted record.
Table Descriptor 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 98. Table Descriptor Record Structure
Table Descriptor Record |
|
|
| ||
---|---|---|---|---|---|
record type | number of columns | column structure
| LOB information | ||
|
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:
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.
Table 99. Formatted User Data Record Structure
Formatted User Data Record |
|
|
| ||
---|---|---|---|---|---|
record type | length of fixed section | fixed length section | variable data section | ||
|
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.
The update record log record is written when a row is updated, and if its
storage location does not change. There are two available log record formats;
they are identical to the insert record and the delete record log records (see
"Insert Record, Delete Record, Rollback Delete Record, Rollback Update Record"). One contains the pre-update image of the row being updated; the
other contains the post-update image of the row being updated. This
is a Normal log record.
Table 100. Update Record Log Record Structure
Description | Type | Offset (Bytes) |
---|---|---|
Log header | DMSLogRecordHeader | 0(6) |
Padding | char[ ] | 6(2) |
RID | long | 8(4) |
New Record length | unsigned short | 12(2) |
Free space | unsigned short | 14(2) |
Record offset | unsigned short | 16(2) |
Old record header and data | variable | 18(variable) |
Log header | DMSLogRecordHeader | variable(6) |
Padding | char[ ] | variable(2) |
RID | long | variable(4) |
Old record length | unsigned short | variable(2) |
Free space | unsigned short | variable(2) |
Record offset | unsigned short | variable(2) |
New record header and data | variable | variable(variable) |
Total Length: 36 bytes plus 2 Record lengths |