COBOL Manual for TNS and TNS/R Programs
Fault-Tolerant Processes
HP COBOL Manual for TNS and TNS/R Programs—522555-006
32-17
Concepts
Audit Trails
An audit trail is a set of disk files in which a record is kept of before-images and after-
images of all records changed by each transaction that occurs in a certain file. A file is
described as audited when it has an audit trail. In TMF, every disk file in which records
are to be changed can be audited. If a disk is involved in transactions whose failure
could leave the database in an inconsistent state, that disk file should be audited.
On NonStop systems, under DP2 (Disk Process 2), all disks permit TMF auditing. To
instruct TMF to audit a file, use the attribute AUDITED, which you set with the FUP
command SET or ALTER. The AUDITED attribute is an attribute of the disk file itself;
an HP COBOL program is unaware of and cannot affect this attribute.
Every disk operation that changes the contents of a database protected by TMF is
recorded in an audit trail. The before and after values of the information are both
recorded, and the database is changed. If the transaction does not complete, TMF
backs out the transaction—replaces the changed value with the previous value.
You can specify that some files in a transaction are audited and some are not audited;
however, this practice is risky. If a server updates an unaudited file having alternate
keys, a single-component failure can interrupt a transaction between the updating of
the prime key and alternate keys. In this case, the prime and alternate keys are
inconsistent. If you do not protect such a file with auditing, you must code the server as
a process pair to protect the consistency of the keys.
The TMF subsystem requires audit trails for both transaction backout and roll-forward
recovery. Eventually, the space required for audit trails can exceed available resources.
For this reason, the audit trails must periodically be dumped to tape and their disk
space thereby reclaimed. The system manager can configure TMF to automatically
dump the audit trails.
Even after a transaction is committed and its audit trail is no longer needed for
backout, you might need the audit trail for a roll-forward recovery; therefore, tapes
containing the dumped audit trails should be stored until you are certain that they are
no longer needed.
Online Dump and Roll-Forward Recovery
The TMF subsystem can perform an online dump of the database periodically. The
system manager is responsible for configuring TMF to do this at appropriate intervals.
In the event of a total system failure, the operator directs TMF to restore the database
from dump files. Then the operator directs TMF to conduct a roll-forward recovery to
repeat the transactions that have occurred since the last online dump. A roll-forward
recovery is the action of repeating each transaction that occurred to the database
between the time of the last online dump and the time of the system failure.