Table audit-data dictionary changed
If the audit server starts to use a sequence, the audit server writes the audit-data dictionary to the sequence headers of the sequence file and the information file. Audit-data in the sequence file depends on the audit-data dictionary of that sequence. For example, for an insert/delete action, all audited field values are placed in the sequence in which the values occur in the audit-data dictionary. For updates, the field values are preceded by field numbers, which are offsets in the audit-data dictionary. 4GL interface audit-data reading also depends on the audit-data dictionary of the sequence.
If the audit-data dictionary changes after the system writes some audit-data to a sequence file, you cannot continue to use the same sequence. In this case, the audit server stops using the current sequence and marks the sequence closed while the audit-data dictionary has been changed. The audit server then starts to use the next sequence.
Note that, here, the switch is made only if the audit-data dictionary changes. This differs from changing the table data dictionary. Changes to the table-data dictionary do not necessarily imply that the audit-data dictionary is also changed.
The following example illustrates events that lead to changes in the audit-data dictionary.
Suppose you have a table with columns c1, c2, c3, c4, c5, and c6 with primary key (c4, c2) in which all except c5 are audited. The audit-data dictionary contains information for these columns in order c4, c2, c1, c3, and c6.
Consider the following changes:
Number of audited columns changed
If the audit trail status for any field is changed, the audit-data dictionary changes. For example, if audit trail is enabled for c5, the audit-data dictionary must have column information in the order c4, c2, c1, c3, c5, and c6, which differs from the audit-data dictionary of the current sequence, so a sequence change occurs. Similarly, if you disable auditing for c1, the new audit-data dictionary is c4, c2, c3 and c6, which differs from the current audit-data dictionary. As a result, a sequence change occurs.
Order of audited primary key columns changed
Initially the primary key was (c4, c2). If the primary key’s definition is changed to (c2, c4), the new audit-data dictionary is c2, c4, c1, c3, and c6. Because this differs from the audit-data dictionary of the current sequence, the audit server closes the current sequence and uses the next sequence.
Order of other audited columns changed
The audit-data dictionary changes if the order changes in which the columns (other than the primary key columns) occur in the table definition. For example, if the table is now defined as c1, c2, c4, c5, c6, c3, the new audit-data dictionary is c4, c2, c1, c6, c3. In this case the sequence order is changed.
Number of audited primary key columns changed
You can change the number of audited primary key columns without affecting any of these conditions. For example, if the primary key definition is changed to (c4, c2, c1), the new audit-data dictionary is the same as the current audit-data dictionary. But, because c1 is now a primary key field, the c1 value must be stored in an update action, even if the value is not changed. In previous updates in the current sequence, this step was not required. To make the sequence file consistent, the audit server switches to the next sequence.