Whereas inserts, updates, and deletes may be cached before being written
to disk, log entries tracking all those changes are never cached but always
forced to disk when a transaction commits. If the system or operating system
fails unexpectedly, when next
starts up it can use the log to perform recovery, recovering the "lost" transactions
from the log and rolling back uncommitted transactions. Recovery ensures
that all committed transactions at the time the system failed are applied
to the database, and all transactions that were active are rolled back. Thus
the databases are left in a consistent, valid state.
In normal operation, keeps
the log small through periodic checkpoints. Checkpointing marks the portions
of the log that are no longer useful, writes changed pages to disk, then truncates
the log.
checkpoints the
log file as it fills. It also checkpoints the log when a shutdown command
is issued. Shutting down the JVM in which is
running without issuing the proper shutdown command is equivalent to a system
failure from 's point
of view.
Booting a database means that checks
to see if recovery needs to be run on a database. Recovery can be costly,
so using the proper shutdown command improves connection or startup performance.