2.8 Transaction Logging

Each database can have a transaction log to record all changes to that database. The transaction log file is a special file maintained by the C/Base programs during normal execution. If you have the C/Base Utilities software, you can also write additional programs that perform transaction logging (see C/Base Utilities Manual Chapter 5, Transaction Logging).

Log files can help you restore a database after a system crash. When a system stops unexpectedly, (power failures, hard disk failures, spilt coffee, etc.) the state of the file system is not guaranteed. In this case, the user must restore the last database backup. After doing so, all changes made to the database after the last backup must be redone.

If logging is not enabled, this can mean re-entering a lot of data. When log files are used, you can run the drestore (C-1) program to restore a database from its log file. This program can bring a database back to a state close to where the system stopped.

Even though this is a great help in the event of a system failure, it is not normally enabled. The reason is that it requires a lot of disk storage space. Every time a record is inserted, updated, or deleted, a record image is recorded in the log file. These images add up to a lot of space in a short time. Therefore, this feature is disabled unless explicitly enabled.