Cs4432recovery1 CS4432: Database Systems II Lecture #19 Database Consistency and Violations? Professor Elke A. Rundensteiner.

Slides:



Advertisements
Similar presentations
IDA / ADIT Lecture 10: Database recovery Jose M. Peña
Advertisements

Chapter 15: Transactions Transaction Concept Transaction Concept Concurrent Executions Concurrent Executions Serializability Serializability Testing for.
1 CPS216: Data-intensive Computing Systems Failure Recovery Shivnath Babu.
CS 245Notes 081 CS 245: Database System Principles Notes 08: Failure Recovery Hector Garcia-Molina.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
Cs44321 CS4432: Database Systems II Lecture #19 Database Consistency and Transactions Professor Elke A. Rundensteiner.
Transaction Processing Lecture ACID 2 phase commit.
1 ICS 214A: Database Management Systems Fall 2002 Lecture 16: Crash Recovery Professor Chen Li.
1 Failure Recovery Introduction Undo Logging Redo Logging Source: slides by Hector Garcia-Molina.
CS 277 – Spring 2002Notes 081 CS 277: Database System Implementation Notes 08: Failure Recovery Arthur Keller.
1 Θεμελίωση Βάσεων Δεδομένων Notes 09: Failure Recovery Βασίλης Βασσάλος.
Cs4432recovery1 CS4432: Database Systems II Database Consistency and Violations?
1 Anna Östlin Pagh and Rasmus Pagh IT University of Copenhagen Advanced Database Technology March 25, 2004 SYSTEM FAILURES Lecture based on [GUW ,
Transaction Processing IS698 Min Song. 2 What is a Transaction?  When an event in the real world changes the state of the enterprise, a transaction is.
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
1 ACID Properties of Transactions Chapter Transactions Many enterprises use databases to store information about their state –e.g., Balances of.
1 A Closer Look Chapter 2. 2 Underlying Concepts of Databases and Transaction Processing.
Cs4432recovery1 CS4432: Database Systems II Lecture #20 Failure Recovery Professor Elke A. Rundensteiner.
CS 245Notes 081 CS 245: Database System Principles Notes 08: Failure Recovery Hector Garcia-Molina.
1 The Big Picture of Databases We are particularly interested in relational databases Data is stored in tables.
Transaction Management WXES 2103 Database. Content What is transaction Transaction properties Transaction management with SQL Transaction log DBMS Transaction.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
CS4432: Database Systems II Transaction Management Motivation 1.
1 CPS216: Advanced Database Systems Notes 10: Failure Recovery Shivnath Babu.
INTRODUCTION TO TRANSACTION PROCESSING CHAPTER 21 (6/E) CHAPTER 17 (5/E)
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 16.
1 Chapter 18 ACID Properties of Transactions. 2 Transactions Many enterprises use databases to store information about their state –e.g., Balances of.
Database Integrity and Security HAP 709 – Healthcare Databases George Mason University Janusz Wojtusiak, PhD Fall, 2010.
Introduction. 
1 CSE 480: Database Systems Lecture 23: Transaction Processing and Database Recovery.
Chapter 171 Chapter 17: Coping with System Failures (Slides by Hector Garcia-Molina,
1 Introduction to Database Systems. 2 Database and Database System / A database is a shared collection of logically related data designed to meet the.
© Pearson Education Limited, Chapter 16 Physical Database Design – Step 7 (Monitor and Tune the Operational System) Transparencies.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
02/23/2005Yan Huang - CSCI5330 Database Implementation – Transaction Transaction.
HANDLING FAILURES. Warning This is a first draft I welcome your corrections.
+ Constraints and triggers: maintaining the ACID properties of transactions CSCI 2141 W2013 Slides from:
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
DBMS 2001Notes 7: Crash Recovery1 Principles of Database Management Systems 7: Crash Recovery Pekka Kilpeläinen (after Stanford CS245 slide originals.
1 CSE232A: Database System Principles Notes 08: Failure Recovery.
Chapter 1 Introduction to Databases. 1-2 Chapter Outline   Common uses of database systems   Meaning of basic terms   Database Applications  
Introduction to Database Systems1. 2 Basic Definitions Mini-world Some part of the real world about which data is stored in a database. Data Known facts.
Concurrency Control. Objectives Management of Databases Concurrency Control Database Recovery Database Security Database Administration.
COMP4100: Database System Principles 01: Introduction.
Chapter 10 Recovery System. ACID Properties  Atomicity. Either all operations of the transaction are properly reflected in the database or none are.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Transaction Processing Concepts Muheet Ahmed Butt.
 Distributed Database Concepts  Parallel Vs Distributed Technology  Advantages  Additional Functions  Distribution Database Design  Data Fragmentation.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
1 Ullman et al. : Database System Principles Notes 08: Failure Recovery.
03/30/2005Yan Huang - CSCI5330 Database Implementation – Recovery Recovery.
MULTIUSER DATABASES : Concurrency and Transaction Management.
CS422 Principles of Database Systems Failure Recovery Chengyu Sun California State University, Los Angeles.
Chapter 2 The Big Picture. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 2-2 Databases We are particularly interested in relational databases.
1 Advanced Database Systems: DBS CB, 2 nd Edition Recovery Ch. 17.
CPSC-310 Database Systems
CS422 Principles of Database Systems Failure Recovery
Advanced Database Systems: DBS CB, 2nd Edition
Recovery 6/4/2018.
CS4432: Database Systems II
Database System Principles Notes 08: Failure Recovery
CS 245: Database System Principles Notes 08: Failure Recovery
CS 245: Database System Principles Notes 08: Failure Recovery
CS 4432 Database Systems II Lecture 1: Introduction
Lecture 21: Intro to Transactions & Logging III
Transaction Management Overview
Lecture 20: Intro to Transactions & Logging II
CPSC-608 Database Systems
Concurrency Control.
Presentation transcript:

cs4432recovery1 CS4432: Database Systems II Lecture #19 Database Consistency and Violations? Professor Elke A. Rundensteiner

cs4432recovery2 Transactions, etc. Crash recovery Ch.8 [17] Concurrency control Ch.9 [18] Transaction processing Ch.10 [19]

cs4432recovery3 All about Project 3.

cs4432recovery4 Integrity or correctness of data ? We would like data in our database to be “accurate” ( “correct” ) at all times. EMP How DBMS decides if data is consistent? Name White Green Gray Age

cs4432recovery5 Integrity or consistency constraints Utilize predicates data must satisfy Examples: - x is key of relation R - x  y holds in R - Domain(x) = {Red, Blue, Green}  is valid index for attribute x of R - no employee should make more than twice the average salary

cs4432recovery6 Definitions: Consistent state: satisfies all constraints Consistent DB: DB in consistent state

cs4432recovery7 Such Constraints may not capture “full correctness” Example 1 : Transaction constraints When salary is updated, new salary > old salary When account record is deleted, balance = 0

cs4432recovery8 Example 2 Database should reflect real world DB Reality Constraints ( as we use here) may not capture “full correctness”

cs4432recovery9  in any case, continue with constraints... Observation: DB cannot be consistent always Example: Constraint : a 1 + a 2 +…. a n = TOT Action: Deposit $100 in a 2 : a 2  a TOT  TOT + 100

cs4432recovery10 a 2 TOT Example: a 1 + a 2 +…. a n = TOT ( constraint ) Deposit $100 in a 2 : a 2  a TOT  TOT + 100

cs4432recovery11 Transaction: a collection of actions that preserve consistency Consistent DBConsistent DB’ T

cs4432recovery12 Big assumption: If T starts with consistent state AND T executes in isolation  T leaves consistent state

cs4432recovery13 Correctness (informally) If we stop running transaction(s), DB left consistent Each transaction sees a consistent DB

cs4432recovery14 How can constraints be violated? Transaction bug DBMS bug Hardware failure e.g., disk crash alters balance of account Data sharing e.g.: T1: give 10% raise to programmers T2: change programmers  systems analysts

cs4432recovery15 Will not consider: How to write correct transactions How to write correct DBMS system Constraint checking & repair

cs4432recovery16 How can we prevent/fix violations? Chapter 8[17]: due to failures only Chapter 9[18]: due to data sharing only Chapter 10[19]: due to failures and sharing

cs4432recovery17 Chapter 8 [17]: Recovery First : Failure Model

cs4432recovery18 Events Desired Undesired Expected Unexpected

cs4432recovery19 Our failure model processor memory disk CPU M D

cs4432recovery20 Desired events: see product manuals…. Undesired expected events: System crash - memory lost - cpu halts, resets Undesired Unexpected: Everything else! that’s it!!

cs4432recovery21 Examples: Disk data is lost Memory lost without CPU halt CPU implodes wiping out universe…. You name it … Undesired Unexpected: Everything else!

cs4432recovery22 Is this model reasonable? Approach: Add low level checks + redundancy to increase probability that model holds E.g., Replicate disk storage (stable store) Memory parity CPU checks