Table data dictionary as seen by audit server

By means of the Audit_cols file, the audit trail can be enabled for any column of any table. The audit trail enables a user to audit a single column or all the columns of the table.

The audit server is concerned only with audited columns of a table. The audit server logs the information only for the audited columns. If a column is not audited, no information is logged for that column. If the table has no audited columns, no information is logged for the table. The audit_cols file specifies the columns of the tables for which audit is enabled.

For the rest of this chapter, all columns are assumed to be audited, unless otherwise stated.

The audit-data dictionary (the information of audited columns) is stored in the sequence header. This information is stored in a particular order of table columns. First, information for all audited primary key columns is stored in the order in which they form the primary key. Next, information of remaining audited columns is stored in the order in which the columns occur in the table.

For example, suppose a table has columns c1, c2, c3, c4, c5, c6 with primary key (c4, c2) and all columns except c5 are audited. The audit-data dictionary contains information for the columns in this order: c4, c2, c1, c3, c6. For each column, the audit-data dictionary stores the column name without the table name prefix, field type, size, and depth. The format of a column entry in the audit-data dictionary is as follows:

Name Type Depth Size

Name

Stores column name without table name prefix.

Type

Single byte that indicates the field type. The defines in BDB layer for field type are used, because 4GL also uses the same values. For example, for the CHAR field, the BDB type is BDB_CHAR, and the 4GL counterpart DB.CHAR has the same define as BDB_CHAR.

Depth

Single byte that indicates the depth of the field.

Size

2 bytes indicate the field size. For array fields, this size is the total size of all fields in array.