9Crash-sv

9Crash-sv - CRASH RECOVERY (CHAPTER 15, 17) (Joint...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
09/27/09 1 CRASH RECOVERY (CHAPTER 15, 17) (Joint Collaboration with Prof. Bahram Zartoshty)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
09/27/09 2 TRANSACTION Database management systems (DBMS) have historically been used in banking applications, e.g., transfer some funds from one account to another. The DBMS must ensure the consistency of the database by supporting logical operations that are a collection of instructions A transaction is a collection of operations that performs a single logical function. Each transaction is a unit of atomicity. Example: transfer 50 from John’s account to Jane’s read(A) A=A-50 write(A) read(B) B=B+50 write(B)
Background image of page 2
09/27/09 3 ACID Properties Atomicity. Either all operations of the transaction are properly reflected in the database or none are. Consistency. Execution of a transaction in isolation preserves the consistency of the database. Isolation. Although multiple transactions may execute concurrently, each transaction must be unaware of other concurrently executing transactions. Durability. After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures. A transaction is a unit of program execution that accesses and possibly updates various data items.To preserve the integrity of data the database system must ensure:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
09/27/09 4 A database management system consists of three types of storage: 1. Volatile (main memory, DRAM): contains the buffer pool. Its content disappears in the presence of power failures. 2. Non-volatile (magnetic disk): its contents remains intact in the presence of power failures. It might suffer from a head crash. 3. Stable storage (tape): is assumed not to loose data. There are several types of failures: 1. Logical errors: the internal state of a transaction is inconsistent, e.g., bad input, run out of memory, etc. 2. system errors or undesirable system states: e.g., deadlocks. 3. system crash: hardware malfunctions, e.g., someone pulls the plug. 4. disk failures: disk looses a block of data due to head crashes. This class focuses on the first three types of failures.
Background image of page 4
09/27/09 5 SYSTEM FAILURE EXAMPLE Assume a power failure at Step 4. When the system recovers the database state is inconsistent because: 1) A+B ≠ 1010, and 2) logically B has lost 50. A=1000 B=10 A=1000 A=950 B=10 A=950 B=60 A=950 (1) Read(A ) (2) A=A-50 A=950 B=60 A = 9 5 0 B = 1 0 (3) Write(A) (4) Read(B) (5) B=B+50 (6) Write(B)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
09/27/09 6 Example of Fund Transfer Transaction to transfer $50 from account A to account B: 1. read ( A ) 2. A := A – 50 3. write ( A ) 4. read ( B ) 5. B := B + 50 1. write ( B) Atomicity requirement Consistency requirement Isolation requirement Durability requirement
Background image of page 6
7 TRANSACTIN REQUIREMENTS Each transaction must satisfy the following two requirements: 1. Correctness: Each transaction must be a program that preserves database consistency. Correctness is the responsibility of the programmer who wrote the transaction. 2.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/11/2009 for the course CSCI 485 taught by Professor Ghandeharizadeh during the Fall '08 term at USC.

Page1 / 25

9Crash-sv - CRASH RECOVERY (CHAPTER 15, 17) (Joint...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online