Beruflich Dokumente
Kultur Dokumente
block of A A = 1000
A = 1000 B = 2000
block of A A = 900
A = 1000 B = 2000
block of A A = 900
A = 1000 B = 2000
block of B B = 2100
디스크에 저장되었다는 보장 없다
7-9 7. Recovery and Transaction
Banking Example (cont'd)
block of A A = 900
A = 900 B = 2000
block of B B = 2100
Main Memory
Disk
< After execution of Output(B) >
이때 발생하는 모든 문제는 log 책임
7 - 10 7. Recovery and Transaction
Transaction States
• Active :
execution transaction operations
• Partially Committed :
after the last statement has been executed.
(Output 수행 전 )
• Failed :
normal execution can no longer proceed.
• Aborted : after the transaction has been rolled back and database
restored to its state prior to the start of the transaction.
• Committed :
after "successful" completion.
( 로그에 변경된 부분이 저장 )
transaction error
system error Failed Aborted
Rollback
• Undo(Ti)
which restores the value of all data items updated by transaction
Ti to the old values.
7 - 22 7. Recovery and Transaction
Immediate Database Modification (Example)
• State of log and database
- A result of the execution T1 and T2, Note that the value of A is
changed in database before partially committed :
Log Database
<T1, start>
<T1, A , 1000, 900>
A = 900
<T1, B , 2000, 2100>
B = 2100 uncommitted update,
<T1, commit> if transaction is aborted,
<T2, start> new values must be recovered
<T1, C , 3000, 2800> old values.
C = 2800
<T2, commit>
7 - 23 7. Recovery and Transaction
Immediate Database Modification (Example)
• Two Recovery Schemes :
(1) Undo(Ti) :
If the log contains the record <Ti, start > but does not contain
the record < Ti, commit >.
This transaction is crashed during execution. Thus transaction Ti
needs to be undone.
(2) Redo(Ti) :
If the log contains both the record <Ti, start > and the record
< Ti, commit >.
This transaction is crashed just after partially committed.
Thus transaction Ti needs to be undone.
3. 검사점 기법이란 ?