Serial Schedule Non-Serial Schedule: Checkpoints
Serial Schedule Non-Serial Schedule: Checkpoints
Checkpoints
Checkpoints
o We must consult log to determine those transaction that need to be redone and
those transaction that need to be undone.
o Most of transaction that need to be redone have already written their update into
the database. Although redoing them will cause no harm.
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.
Example :
T2 and T3 redone.
T4 undone
o The shadow page table is never changed over the duration of the transaction.
o The current page table may be changed when a transaction performs a write
operation.
o All input and output operations use the current page table to locate database
pages on disk.
Advantages
Disadvantages
Data gets fragmented or scattered.
After every transaction completion database pages containing old version of modified
data need to be garbage collected.
Hard to extend algorithm to allow transaction to run concurrently.
The most widely used structure for recording database modification is the log.
The log is a sequence of log records, recording all the update activities in the
database.
In short Transaction log is a journal, which contains history of all transaction
performed.
Log contains Start of transaction, trans-id, record-id, type of operation (insert, update,
delete), old value, new value, End of transaction that is commit or aborted.
o Deferred update
o Immediate update
o Checkpoints
Shadow Paging
Q.3. State whether the following statements are true or false. Justify. No
Justification, no marks.
1. Level 1 transaction is the minimum consistency requirement that allows a transaction to be
recovered in the event of system failure.
2. There is no deadlock in the timestamp method of concurrency control.
3. Level 0 transactions are recoverable.
4. The objective of concurrency control is to schedule or arrange the transactions in such a
way as to avoid any interference.
5. In a shrinking phase, a transaction release all locks and can not obtain any new locks.
Do not physically update the database on disk until after a transaction reaches its
commit point;
Then updates are recorded persistently in the log and the written to the database.
Before reaching commit point, the transaction updates are recorded in the local
transaction workspace (buffers)
During commit, the updates are first recorded persistently in log and then write to
the database.
Transaction fail
o If transaction fails before reaching commit point, it will not have changed the
database. (no need undo)
This technique postpone any actual update to the database until the transaction
complete and reached check point.
o After transaction reaches it commit point and the log file is forced to write to
disk, the update are record to database.
no need undo.
Simplify recovery,
Can not use in practice because unless transaction are short and each transaction
change few times.
May running out of buffer space because transaction change must be held in buffer
until commit.
State
A transaction can not change the database on disk until it reaches it commit point.
A transaction does not reach its commit point until all its update operations are
recorded in the log and the log is force written to disk.
Example :