IBM Books

Administrative API Reference


LOB Manager Log Records

LOB manager log records are written only if a database is configured with LOG RETAIN on or USEREXITS enabled. The log records are written whenever LOB data is inserted into a table. When LOB data is updated, the update is treated as a delete of the old LOB value, followed by an insert of the new value. If the LOB manager is able to determine that the new value is simply the old value with new data appended to it, the new data is appended to the old data. In this case, only the new data is logged.

For LOB columns that were created with the NOT LOGGED option, a log record is still written if the database is forward recoverable. However, instead of logging the actual data, only the quantity of data and its position within the LOB object are logged. During forward recovery, zeros (not user data) are written to the LOB object.

For any LOB value inserted, multiple LOB records may be written. A single LOB record will not contain more than 32 768 bytes of data.

In order to conserve log space, LOB data inserted into tables is not logged if the database is configured for circular logging. In addition, when a LOB value is updated, the before image is shadowed and not logged.

All LOB manager log records begin with a log record header.

All LOB manager log record offsets are from the end of the log manager log record header.

Table 110. LOB Manager Log Record Header Structure
Description Type Offset (Bytes)
Originator code (component identifier = 5) unsigned char 0(1)
Operation identifier unsigned char 1(1)
Pool identifier unsigned short 2(2)
Object identifier unsigned short 4(2)
Parent pool identifier unsigned short 6(2)
Parent object identifier unsigned short 8(2)
Object type unsigned char 10(1)
Total Length: 11 bytes

Insert LOB Data Log Record (AFIM_DATA)

This log record is written when LOB data is inserted into a LOB column, or appended to an existing LOB value, and logging of the data has been specified.

Table 111. Insert LOB Data Log Record (AFIM_DATA)
Description Type Offset (Bytes)
Log header LOBLogRecordHeader 0(11)
Padding char 11(1)
Data length unsigned long 12(4)
Byte address in object double 16(8)
LOB data variable 24(variable)
Total Length: 24 bytes plus LOB data

Insert LOB Data Log Record (AFIM_AMOUNT)

This log record is written instead of the AFIM_DATA log record if logging for the LOB column has been turned off.

Table 112. Insert LOB Data Log Record (AFIM_AMOUNT)
Description Type Offset (Bytes)
Log header LOBLogRecordHeader 0(11)
Padding char 11(1)
Data length unsigned long 12(4)
Byte address in object double 16(8)
Total Length: 24 bytes


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]