in Databases
3,760 views
3 votes
3 votes
in Databases
by
3.8k views

1 Answer

7 votes
7 votes
Best answer

Checkpoint: Checkpoint is a mechanism where all the previous logs are removed from the system and stored permanently in a storage disk. Checkpoint declares a point before which the DBMS was in consistent state, and all the transactions were committed.

Recovery:When a system with concurrent transactions crashes and recovers, it behaves in the following manner −

  • The recovery system reads the logs backwards from the end to the last checkpoint.
  • It maintains two lists, an undo-list and a redo-list.
  • If the recovery system sees a log with <tn, start=""> and <tn, commit=""> or just  <tn, commit="">, it puts the transaction in the redo-list.
  • If the recovery system sees a log with <tn, start=""> but no commit or abort log found, it puts the transaction in undo-list.

All the transactions in the undo-list are then undone and their logs are removed. All the transactions in the redo-list and their previous logs are removed and then redone before saving their logs

selected by

5 Comments

Suppose this question is given:

  1. T1 start
  2. T1 B old=1200 new=10000
  3. T1 M old=0 new=2000
  4. T1 commit
  5. T2 start
  6. T2 B old=10000 new=10500
  7. T2 commit  

Suppose the database system crashes just before log record 7 is written. When the system is restarted which all transactions undergo undo and redo operations ?

and another question given:

(Start, T4); (write, T4,y,2,3);(Start, T1);( commit,T4);(write, T1,z,5,7);
(checkpoint );
( Start,T2) ; (write, T2,x,1,9) ; (commit,T2) ; (start,T3) , (write,T3,z,7,2)
If a crash happens now and the system tries to recover using both undo and redo operations,
what are the contents of the undo lists and the redo list?

how to solve this type of problems. I'm confused. please help

0
0
Thank you very much.. it helped a lot. I don't know why most of the books are giving option C as answer for the 1st question.
1
1
Doesn't it depend on recovery algorithm we choose:
deffered update or immediate update?
0
0
@skyby it depends
0
0

Related questions

1 vote
1 vote
1 answer
3