1 / 16

Database Management System

Database Management System. Lecture - 42. Transaction. Generally reflects the activities in the real world system One transaction in our exam system may be computing gpa of a student, Operations involved….. More complex transactions. Consistent State of DB. Consistent state of the database

jeffreye
Download Presentation

Database Management System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DatabaseManagement System Lecture - 42

  2. Transaction • Generally reflects the activities in the real world system • One transaction in our exam system may be computing gpa of a student, Operations involved….. • More complex transactions

  3. Consistent State of DB • Consistent state of the database • Duplicated data does not conflict • DB properly reflect the real-world system, i.e. follows the business rules • A transaction should transform database from one consistent state to another consistent state, may be inconsistent temp

  4. Transaction Termination • Two ways a transaction terminates or ends • It may Commit or Abort • If executed successfully, brings the database in a new consistent state, said to be committed

  5. Transaction Termination • If otherwise, database has to be brought in prior consistent state • Such transaction is rolled back or undone • A committed transaction cannot be undone; compensating transaction

  6. Transaction Boundaries • Means being and end of Tr • Generally responsibility of programmer • Otherwise approach varies from DBMS to DBMS

  7. ACID Properties • Atomicity: all or none • Consistency: maintains consistency of the DB • Isolation: Tr should be protected form the effect of other Trs • Durability: changes by Tr are permanent

  8. Database Updates • Updates are first made in the buffers in RAM, then transferred to database • There may be some delay between the two

  9. Database Recovery • If a crash occurs during this delay then the database is in in consistent state • On restart DBMS has to identify it and recover DB into a consistent state

  10. Reasons of Failure • Natural disaster • Sabotage • Carelessness • Disk crash • System software errors • Generally, improper shut down of DBMS

  11. Recovery Techniques • System crashes, buffers are lost but the disk copy is safe • Need to determine the transactions that need to redone or undone

  12. Log File • Tool used for database recovery • Transaction Record • <T, starts> • <T, commits> or <T, aborts> • Data entries?

  13. Transaction Operations Read (X) X = X + 5 Write (X) Y = Y * 3 Write (Y) Commit • Operations of DBMS concern • Concern of Recovery Manager • So log file contains entries only for write operations

  14. Deferred Updates • Called incremental log with deferred updates • Updates are not performed until commit is encountered • Data entries in the log file of the form <T, X, c>; simplified

  15. Log File Entries <T, starts> <T, X, 55> <T, Y, 30> <T, commit> Read (X) X = X + 5 Write (X) Y = Y * 15 Write (Y) Commit Supposing X = 50 Y = 10

  16. DatabaseManagement System Lecture - 42

More Related