TMF Application Programmer's Guide (G06.26+)
TMF ARLIB2 Audit-Reading Procedures
HP NonStop TMF Application Programmer’s Guide—522419-005
5-8
Reading Active Audit Files
Reading Active Audit Files
The TMF audit-reading procedures use large physical transfers when reading audit
files from disk. The audit-trail file is read from the disk into cache memory and records
are then retrieved from cache into your application buffer.
If audit records are added to an audit file after the audit-reading procedures have
detected the EOF, your application can retrieve them by issuing more ARREAD calls
(provided you specified 999999 as the maximum sequence number in the AROPEN
call that opened the cursor).
The procedure for reading audit records from an active-audit trail is as follows:
1. Open a cursor for the audit trail by calling AROPEN.
Use a fully qualified file name or the appropriate audit-trail ID (MAT, AUX01,
AUX02, ...) as the generic-name. When using the fully qualified file name, the
volume name is meaningless because ARLIB2 consults the TMP to determine the
location of the audit trail, the subvolume name must be ZTMFAT, and the filename
should be the appropriate two-character identifier (AA, BB, CC, ...).
Use the desired starting audit-file sequence number as the min-seqno parameter
value and 999999 as the max-seqno parameter value.
ARLIB2 correctly processes multiple active-audit volumes, overflow-audit volumes,
and restore-audit volumes. If audit restore is necessary and enabled, the TMP
uses the TMF dump/restore capability to restore audit-trail files to one of the
configured restore-audit volumes.
2. Set the position at which to start reading by calling ARPOSITION.
To read forward from the beginning of the audit file specified in the AROPEN call,
set the audit-file-seqno parameter to the same value as the AROPEN
min-seqno parameter, the rel-byte-addr parameter to zero, and the
cursor-direction parameter to zero.
To read in reverse from the end of the current active audit file back to the beginning
of the audit file specified in the AROPEN call, set the audit-file-seqno
Note. Updates belonging to different volumes might not be written to the audit trail in the same
sequence as the updates happen in the actual transaction. For example, assume that
SQL/MP (non-referential integrity) data is being replicated to SQL/MX (referential integrity) by a
software tool reading the audit trail and that a parent-child RI relationship exists for two tables
in SQL/MX. Assume also that the SQL/MP application starts a transaction, inserts the parent
row first, then inserts the child row, and then commits. Because the DP2 disk process flush
intervals can vary, this sequence of events might show up in the audit trail as insert of the
child, followed by insert of the parent, followed by the commit. Only when the partitions are on
the same volume is order within the audit trail assured.