Checkpoints
When System failure occurs
o We must consult log to determine those transaction that need to be redone and those transaction that need to be undone.
o We need to search entire log to determine this information.
There are two major difficulties with this
o Search process is time consuming
o Most
of transaction that need to be redone have already written their update
into the database. Although redoing them will cause no harm.
- To reduce this type of overhead, we introduced checkpoints.
- During execution system maintains the log, using one of the two techniques Deferred update or Immediate update.
- In addition, System periodically performs checkpoints, which requires following sequence of action to take place
- Output onto stable storage all log records currently residing in main memory.
- Output to the disk all modified buffer blocks
- Output onto stable storage a log record.
- Transactions are not allowed to perform any update actions such as
- Writing to a buffer block or
- Writing to log record
While a checkpoint is in progress.
- Checkpoint can be occur automatically and manually.
- Checkpoints continue to occur whenever the database is shut down (normal or immediate) or when a redo log switch occurs.
- To force a checkpoint, issue the following SQL command:
o alter system switch logfile;
o Alter system checkpoint;
Example : - T1 can be ignored (updates already output to disk due to checkpoint)
- T2 and T3 redone.
0 comments:
Post a Comment