HPlogo ALLBASE/SQL Performance and Monitoring Guidelines: HP 9000 Computer Systems > Chapter 1 Basic Concepts in ALLBASE/SQL Performance

Log File Organization

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The ALLBASE/SQL log is organized as a series of 512-byte pages. Logs are written and read in page-size blocks. Within ALLBASE/SQL, information that is logged is written out as a series of log records, which contain enough information to reconstruct the state of the database that existed before a user's transaction started. In general, only data change (write) operations are logged, since read operations do not affect the structure of the database. Changes to data, index, and system catalog pages all are logged. A log record may span many log pages.

A log may be used in archive or nonarchive mode. In nonarchive mode, the log maintains a record of all data change operations by transactions that were uncommitted at the time of the last checkpoint; and it maintains a record of all data change operations since the last checkpoint. In archive mode, the log maintains a record of all data change operations, whether from committed or uncommitted transactions. Both nonarchive and archive logs allow transactions to be rolled back. An archive log also allows you to reapply transactions after restoring a DBEnvironment following a hard crash.

Log records from all concurrent transactions are stored in sequential log records in the log buffer. When you issue a COMMIT WORK, when the log buffer becomes full, or when a CHECKPOINT statement is issued, the contents of the log buffer are written to a disk file. (Changed data buffer pages are also written to disk at checkpoint time.) In the case of nonarchive logging, a checkpoint may make log file space available for use by new log records.

The log itself consists of one or more files of different sizes. Initially, a log is configured in the START DBE NEW or START DBE NEWLOG statement as a single or dual file. Subsequently, you can add additional files (two at a time in dual logging) with the SQLUtil ADDLOG command. Adding log files allows log switching. When one log fills up, ALLBASE/SQL can immediately switch to the next file with no pause except to close the first file and open the second. If no file is available for log switching, and if no space can be reclaimed with a checkpoint, a LOG FULL condition will occur when the end of the log file is reached. LOG FULL causes your transaction to be rolled back.

A directory of log files is kept in the DBECon file; you can view this directory by using the SQLUtil SHOWLOG command. To examine the current capacity of the log files, invoke the Overview screen in SQLMON.

Feedback to webmaster