Lesson No. 42 - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Lesson No. 42

Description:

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 ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 17
Provided by: Virtu45
Category:

less

Transcript and Presenter's Notes

Title: Lesson No. 42


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
  • ltT, startsgt
  • ltT, commitsgt or ltT, abortsgt
  • 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 ltT, X,
    cgt simplified

15
Log File Entries
Read (X) X X 5 Write (X) Y Y 15 Write
(Y) Commit
  • ltT, startsgt
  • ltT, X, 55gt
  • ltT, Y, 30gt
  • ltT, commitgt

Supposing X 50 Y 10
16
DatabaseManagement System
Lecture - 42
Write a Comment
User Comments (0)
About PowerShow.com