Database Reference
In-Depth Information
Although shadow paging is simple and straightforward, and avoids the overhead
associated with log-based recovery, it has a few disadvantages as listed below:
The simple version of shadow paging does not work in database environments
with concurrent transaction processing. In such environments, the technique
must be augmented by logs and checkpoints.
The shadow paging technique scatters around the updated database pages and
changes page locations. If pages contained related data that must be kept
together in a particular database system, then shadow paging is not the proper
technique for that system.
When a transaction commits, the old pages must be released and added to
the pool of unused pages. In a volatile environment with numerous updates,
constant reorganization becomes necessary to collect the dispersed free blocks
and keep them together.
The process of migration between current and shadow directories itself may be
vulnerable to failures.
A Recovery Example
We have reviewed the types of failures that can cause problems in a database envi-
ronment—some serious enough to damage the entire database and some resulting
in database inconsistencies for a few data items. Serious failures take a lot of effort
and time to recover and restore the database. We examined a few major techniques
for recovery from failures. You have understood the use of logging and how log-
based recovery techniques work. You now know the significance of taking check-
points and the purpose of the checkpoint records on a log file. You have learned
the role and importance of database backups.
Let us look at an example of how to recover and restore a database to the latest
consistent state after a system crash that has damaged the database contents on disk.
You have to begin the recovery from the latest available full backup of the data-
base and do forward recovery. Figure 15-31 presents a comprehensive example of
the process.
Observe the timeline in the top half of the figure and note the backup and logging
activities shown. Note the points on the timeline when different events take place.
The bottom half of the figure indicates how the various log files are used to recover
from the crash. Observe how each file is used to bring the status of the database
forward up to the point of the crash.
CHAPTER SUMMARY
Data integrity in a database includes data consistency, correctness, and
validity.
A database system is prone to two kinds of problems: Concurrent transactions
may cause data inconsistency, and hardware or software failures may ruin its
contents.
Search WWH ::




Custom Search