Solutions for Exercise no. 13

From "Database System Concepts"

15.1 See the text in the book
Answer:
Volatile storage is storage which fails when there is a power failure. Cache, main memory, and registers are examples of volatile storage. Non-volatile storage is storage which retains its content despite power failures. An example is magnetic disk. Stable storage is storage which theoretically survives any kind of failure. This type of storage can only be approximated by replicating data.

In terms of I/O, volatile memory is the fastest and non-volatile storage is typically several times slower. Stable storage is slower than non-volatile storage because of the cost of replication.

In terms of cost, volatile storage is expensive, and non-volatile storage is cheap. Stable storage is more expensive than non-volatile storage due to replication.

15.3 See the text in the book
Answer:

15.5 See the text in the book
Answer:
Checkpointing is done with log based recovery schemes to reduce the time required for recovery after a crash. If there is no checkpointing, then the entire log must be searched after a crash, and all transactions undone/redone from the log. If check pointing had been performed, then most of the log records prior to the checkpoint can be ignored at the time of recovery.

Another reason to perform checkpoints is to clear log records from stable storage as it gets full.

Since checkpoints cause some loss in performance while they are being taken, their frequency should be reduced if fast recovery is not critical. If we need fast recovery checkpointing frequency should be increase. If the amount of stable storage available is less, frequency check pointing is unavoidable. Checkpoints have no effect on recovery from disk crashes.
 

15.10 See the text in the book
Answer:
After a disk crash, all data item values need to be restored to a consistent state. First, the database is restored to the state of the most recent dump, that is, all data item values are copied to the disk from the dump. If the dump was taken when there were no active transaction , the log is consulted and all transaction that committed after the dump was taken, are redone. If there are active transactions when then dump was taken, some transactions might need to be undone and others redone. The procedures is similar to the one adobted during recovery from a system crash.

15.12 See the text in the book
Answer:
Interactive transactions are more difficult to recover from than batch transactions because some actions may be irrecoverable. For example, an output (write) statement may have fired a missile, ore caused a bank machine to give money to a customer. The best way to deal with this is to try to do all output statements at the end of the transaction. That way if the transaction aborts in the middle, no harm will have been done.


Best regards,
Kristian Torp