TMF Application Programmer's Guide (G06.26+)
TMF ARLIB2 Audit-Reading Procedures
HP NonStop TMF Application Programmer’s Guide—522419-005
5-5
Retrieving Information From Audit Records
Retrieving Information From Audit Records
Once you position a cursor, each call to ARREAD reads the audit record at the cursor
position. ARREAD returns the fixed-length fields and common attributes in a record
structure. The audit-trail file sequence number and RBA returned by ARREAD permit
you to position the cursor directly at that record if you need to later.
For distributed transactions, commit and abort records are written to the master audit
trail on the parent node when the parent node releases its locks. Such records can be
retrieved by calls to ARREAD, and are identified by the record types NETWORK-
COMMIT and NETWORK-ABORT (RECTYPE constants 18 and 19, respectively). To
retrieve NETWORK-COMMIT and NETWORK-ABORT records, you call
ARGETNETWORKRECS prior to the first call to ARREAD. Conversely, the
ARSTOPNETWORKRECS procedure disables the returning of NETWORK-COMMIT
and NETWORK-ABORT records. (Alternatively, you can use ARSETOPTIONS to
change the network options.)
For Enscribe and SQL/MP, you read the variable-length fields from audit records
separately by calling the ARFETCH objectname procedure immediately after using
ARREAD. The seven object names are AFTERIMAGE, AUXPOINTER,
BEFOREIMAGE, CHILDNODELIST, FIELDVALUE, FRAGMENT, and RECORDKEY.
For SQL/MX, you read the variable-length fields from audit records separately by
calling the ARFETCHMXBEFOREDATA, ARFETCHMXBEFOREDATA2,
ARFETCHMXAFTERDATA, or ARFETCHMXAFTERDATA2 procedures.
The before-image, after-image, and record key are copied into your application buffer
byte-for-byte. For audit records that contain variable-length fields, the byte length of
such fields is specified in the record returned by ARREAD. The auxiliary pointer is a
structure specifying a range of audit in an audit trail. The child node list is an array of
32-bit system numbers that starts in the first word of the specified application buffer.
For audit records that include a child node list, the number of elements (child nodes) in
the list is specified in the record returned by ARREAD. Fragment is a pair of before-
and after-image fragments from a compressed Enscribe update record. If you issue a
fetch procedure call for a variable-length field that is not present in the record most
recently returned by ARREAD, the procedure returns an error -17 (ARE-FIELD-NOT-
PRESENT).
To fetch one or more variable-length fields from an audit record, you must first have
read the record by using the ARREAD procedure. ARREAD saves information about
each record it reads and the fetch procedures use that information to retrieve the
associated variable-length fields. Calls to AROPEN, ARCLOSE, or ARPOSITION
erase that information; after such calls, further fetch attempts will fail with an error -9
(ARE-NO-CURRENT-RECORD) until the next successful call to ARREAD.