SlideShare a Scribd company logo
4
Most read
9
Most read
10
Most read
Department of Information Technology 1Data base Technologies (ITB4201)
Recovery Techniques in DBMS
Dr. C.V. Suresh Babu
Professor
Department of IT
Hindustan Institute of Science & Technology
Department of Information Technology 2Data base Technologies (ITB4201)
Action Plan
• What is Recovery ?
• Database Recovery techniques
• System log
• Working of Commit and Roll back
• Recovery techniques
• Backup techniques
• Quiz
Department of Information Technology 3Data base Technologies (ITB4201)
What is Recovery ?
• In Database systems, like any other computer system, are
subject to failures but the data stored in it must be available as
and when required.
• When a database fails it must possess the facilities for fast
recovery.
• It must also have atomicity i.e. either transactions are
completed successfully and committed (the effect is recorded
permanently in the database) or the transaction should have
no effect on the database.
Department of Information Technology 4Data base Technologies (ITB4201)
Database Recovery techniques
• There are both automatic and non-automatic ways for both,
backing up of data and recovery from any failure situations.
• The techniques used to recover the lost data due to system
crash, transaction errors, viruses, catastrophic failure, incorrect
commands execution etc. are database recovery techniques.
• So to prevent data loss recovery techniques based on deferred
update and immediate update or backing up data can be used.
Department of Information Technology 5Data base Technologies (ITB4201)
System log
• Recovery techniques are heavily dependent upon the existence
of a special file known as a system log.
• It contains information about the start and end of each
transaction and any updates which occur in the transaction.
• The log keeps track of all transaction operations that affect the
values of database items.
• This information is needed to recover from transaction failure
Department of Information Technology 6Data base Technologies (ITB4201)
System Logs Description
disk start_transaction(T) This log entry records that transaction T starts the execution
read_item(T, X) This log entry records that transaction T reads the value of database
item X
write_item(T, X,
old_value, new_value)
This log entry records that transaction T changes the value of the
database item X from old_value to new_value. The old value is
sometimes known as a before an image of X, and the new value is
known as an afterimage of X.
commit(T) This log entry records that transaction T has completed all accesses to
the database successfully and its effect can be committed (recorded
permanently) to the database
abort(T) This records that transaction T has been aborted
checkpoint Checkpoint is a mechanism where all the previous logs are removed
from the system and stored permanently in a storage disk. Checkpoint
declares a point before which the DBMS was in consistent state, and
all the transactions were committed.
Department of Information Technology 7Data base Technologies (ITB4201)
Working of Commit and Roll back
• A transaction T reaches its commit point when all its operations that
access the database have been executed successfully i.e. the transaction
has reached the point at which it will not abort (terminate without
completing).
• Once committed, the transaction is permanently recorded in the database.
• Commitment always involves writing a commit entry to the log and writing
the log to disk.
• At the time of a system crash, item is searched back in the log for all
transactions T that have written a start_transaction(T) entry into the log
but have not written a commit(T) entry yet; these transactions may have
to be rolled back to undo their effect on the database during the recovery
process
Department of Information Technology 8Data base Technologies (ITB4201)
Recovery techniques
• Undoing – If a transaction crashes, then the recovery manager
may undo transactions i.e. reverse the operations of a
transaction. This involves examining a transaction for the log
entry write_item(T, x, old_value, new_value) and setting the
value of item x in the database to old-value. There are two
major techniques for recovery from non-catastrophic
transaction failures: deferred updates and immediate updates.
Department of Information Technology 9Data base Technologies (ITB4201)
Recovery techniques (cont..)
• Deferred update – This technique does not physically update the database on disk until a
transaction has reached its commit point. Before reaching commit, all transaction updates
are recorded in the local transaction workspace. If a transaction fails before reaching its
commit point, it will not have changed the database in any way so UNDO is not needed. It
may be necessary to REDO the effect of the operations that are recorded in the local
transaction workspace, because their effect may not yet have been written in the database.
Hence, a deferred update is also known as the No-undo/redo algorithm
• Immediate update – In the immediate update, the database may be updated by some
operations of a transaction before the transaction reaches its commit point. However, these
operations are recorded in a log on disk before they are applied to the database, making
recovery still possible. If a transaction fails to reach its commit point, the effect of its
operation must be undone i.e. the transaction must be rolled back hence we require both
undo and redo. This technique is known as undo/redo algorithm.
Department of Information Technology 10Data base Technologies (ITB4201)
Recovery techniques (cont..)
• Caching/Buffering – In this one or more disk pages that include data items to be
updated are cached into main memory buffers and then updated in memory
before being written back to disk. A collection of in-memory buffers called the
DBMS cache is kept under control of DBMS for holding these buffers. A directory
is used to keep track of which database items are in the buffer. A dirty bit is
associated with each buffer, which is 0 if the buffer is not modified else 1 if
modified.
• Shadow paging – It provides atomicity and durability. A directory with n entries
is constructed, where the ith entry points to the ith database page on the link.
When a transaction began executing the current directory is copied into a
shadow directory. When a page is to be modified, a shadow page is allocated in
which changes are made and when it is ready to become durable, all pages that
refer to original are updated to refer new replacement page.
Department of Information Technology 11Data base Technologies (ITB4201)
Backup techniques
• Full database backup – In this full database including data and database, Meta
information needed to restore the whole database, including full-text catalogs
are backed up in a predefined time series.
• Differential backup – It stores only the data changes that have occurred since
last full database backup. When same data has changed many times since last
full database backup, a differential backup stores the most recent version of
changed data. For this first, we need to restore a full database backup.
• Transaction log backup – In this, all events that have occurred in the database,
like a record of every single statement executed is backed up. It is the backup of
transaction log entries and contains all transaction that had happened to the
database. Through this, the database can be recovered to a specific point in
time. It is even possible to perform a backup from a transaction log if the data
files are destroyed and not even a single committed transaction is lost.
Department of Information Technology 12Data base Technologies (ITB4201)
Test Yourself
1. Which of the following is not a recovery technique?
A. Deferred update
B. Immediate update
C. Two-phase commit
D. Recovery management
2. Checkpoints are a part of
A. Recovery measures
B. Security measures
C. Concurrency measures
D. Authorization measures
3. .......... is an alternative of log based recovery.
A. Disk recovery
B. Shadow paging
C. Dish shadowing
D. Crash recovery
4. In the ___________ scheme, a transaction that wants to update the database first creates a complete copy of the database.
A. Shadow copy
B. Shadow Paging
C. Update log records
D. All of the mentioned
5. If a transaction does not modify the database until it has committed, it is said to use the ___________ technique.
A. Deferred-modification
B. Late-modification
C. Immediate-modification
D. Undo
Department of Information Technology 13Data base Technologies (ITB4201)
1. Which of the following is not a recovery technique?
A. Deferred update
B. Immediate update
C. Two-phase commit
D. Recovery management
2. Checkpoints are a part of
A. Recovery measures
B. Security measures
C. Concurrency measures
D. Authorization measures
3. .......... is an alternative of log based recovery.
A. Disk recovery
B. Shadow paging
C. Dish shadowing
D. Crash recovery
4. In the ___________ scheme, a transaction that wants to update the database first creates a complete copy of the database.
A. Shadow copy
B. Shadow Paging
C. Update log records
D. All of the mentioned
5. If a transaction does not modify the database until it has committed, it is said to use the ___________ technique.
A. Deferred-modification
B. Late-modification
C. Immediate-modification
D. Undo
Answers

More Related Content

PPTX
Database recovery
PPTX
database recovery techniques
PPTX
Recovery Techniques and Need of Recovery
PPTX
View of data DBMS
PDF
Chapter 5 Database Transaction Management
PPT
20. Parallel Databases in DBMS
PDF
8 query processing and optimization
Database recovery
database recovery techniques
Recovery Techniques and Need of Recovery
View of data DBMS
Chapter 5 Database Transaction Management
20. Parallel Databases in DBMS
8 query processing and optimization

What's hot (20)

PPTX
Concurrency Control in Database Management System
PPSX
Parallel Database
PPTX
Segmentation in operating systems
PPTX
Deadlock dbms
PDF
Memory management
PPT
11. Storage and File Structure in DBMS
PPT
15. Transactions in DBMS
PDF
Database recovery techniques
PPTX
Concurrency control
DOCX
Concurrency Control Techniques
PPTX
Concurrency control
PPT
Database recovery
PPTX
Transaction management in DBMS
PPTX
Concurrency control
PPT
Distributed Database System
PPT
Data models
PPTX
2 phase locking protocol DBMS
PPTX
Transaction management DBMS
PPT
Data independence
PDF
NOSQL- Presentation on NoSQL
Concurrency Control in Database Management System
Parallel Database
Segmentation in operating systems
Deadlock dbms
Memory management
11. Storage and File Structure in DBMS
15. Transactions in DBMS
Database recovery techniques
Concurrency control
Concurrency Control Techniques
Concurrency control
Database recovery
Transaction management in DBMS
Concurrency control
Distributed Database System
Data models
2 phase locking protocol DBMS
Transaction management DBMS
Data independence
NOSQL- Presentation on NoSQL
Ad

Similar to Recovery techniques (20)

DOC
What is Database Backup? The 3 Important Recovery Techniques from transaction...
PPTX
Lec 4 Recovery in database management system.pptx
PPTX
BCT 2312 - Chapter 4 - Database Recovery.pptx
PDF
Chapter 7. Database Recovery Techniques.pdf
PPTX
Backing Up and Recovery
PDF
DBMS Vardhaman.pdf
PPTX
Recovery system
PPTX
recovery system
PPTX
Metropolis GIS System for Rishikesh City
PPTX
PPTX
Recovery System.pptx
PPTX
BACKUP & RECOVERY IN DBMS
PPTX
Chapter22 database security in dbms.pptx
PPT
ch 5 Daatabase Recovery.ppt
PPTX
DatabaseRecoveryDurinvFailures_Mgmt.pptx
PPTX
Unit_V_C_Recovery_ManagementAppkications.pptx
PDF
Recovery
PPT
DBMS UNIT 5 CHAPTER 3.ppt
PPT
01-Description of the Transport Layer.ppt
PDF
Data base recovery
What is Database Backup? The 3 Important Recovery Techniques from transaction...
Lec 4 Recovery in database management system.pptx
BCT 2312 - Chapter 4 - Database Recovery.pptx
Chapter 7. Database Recovery Techniques.pdf
Backing Up and Recovery
DBMS Vardhaman.pdf
Recovery system
recovery system
Metropolis GIS System for Rishikesh City
Recovery System.pptx
BACKUP & RECOVERY IN DBMS
Chapter22 database security in dbms.pptx
ch 5 Daatabase Recovery.ppt
DatabaseRecoveryDurinvFailures_Mgmt.pptx
Unit_V_C_Recovery_ManagementAppkications.pptx
Recovery
DBMS UNIT 5 CHAPTER 3.ppt
01-Description of the Transport Layer.ppt
Data base recovery
Ad

More from Dr. C.V. Suresh Babu (20)

PPTX
Data analytics with R
PPTX
Association rules
PPTX
PPTX
Classification
PPTX
Blue property assumptions.
PPTX
Introduction to regression
PPTX
Expert systems
PPTX
Dempster shafer theory
PPTX
Bayes network
PPTX
Bayes' theorem
PPTX
Knowledge based agents
PPTX
Rule based system
PPTX
Formal Logic in AI
PPTX
Production based system
PPTX
Game playing in AI
PPTX
Diagnosis test of diabetics and hypertension by AI
PPTX
A study on “impact of artificial intelligence in covid19 diagnosis”
PDF
A study on “impact of artificial intelligence in covid19 diagnosis”
Data analytics with R
Association rules
Classification
Blue property assumptions.
Introduction to regression
Expert systems
Dempster shafer theory
Bayes network
Bayes' theorem
Knowledge based agents
Rule based system
Formal Logic in AI
Production based system
Game playing in AI
Diagnosis test of diabetics and hypertension by AI
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”

Recently uploaded (20)

PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Empowerment Technology for Senior High School Guide
PDF
1_English_Language_Set_2.pdf probationary
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
advance database management system book.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PPTX
Lesson notes of climatology university.
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Computing-Curriculum for Schools in Ghana
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Empowerment Technology for Senior High School Guide
1_English_Language_Set_2.pdf probationary
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
advance database management system book.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Weekly quiz Compilation Jan -July 25.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
Digestion and Absorption of Carbohydrates, Proteina and Fats
Lesson notes of climatology university.
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Orientation - ARALprogram of Deped to the Parents.pptx
History, Philosophy and sociology of education (1).pptx
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Computing-Curriculum for Schools in Ghana

Recovery techniques

  • 1. Department of Information Technology 1Data base Technologies (ITB4201) Recovery Techniques in DBMS Dr. C.V. Suresh Babu Professor Department of IT Hindustan Institute of Science & Technology
  • 2. Department of Information Technology 2Data base Technologies (ITB4201) Action Plan • What is Recovery ? • Database Recovery techniques • System log • Working of Commit and Roll back • Recovery techniques • Backup techniques • Quiz
  • 3. Department of Information Technology 3Data base Technologies (ITB4201) What is Recovery ? • In Database systems, like any other computer system, are subject to failures but the data stored in it must be available as and when required. • When a database fails it must possess the facilities for fast recovery. • It must also have atomicity i.e. either transactions are completed successfully and committed (the effect is recorded permanently in the database) or the transaction should have no effect on the database.
  • 4. Department of Information Technology 4Data base Technologies (ITB4201) Database Recovery techniques • There are both automatic and non-automatic ways for both, backing up of data and recovery from any failure situations. • The techniques used to recover the lost data due to system crash, transaction errors, viruses, catastrophic failure, incorrect commands execution etc. are database recovery techniques. • So to prevent data loss recovery techniques based on deferred update and immediate update or backing up data can be used.
  • 5. Department of Information Technology 5Data base Technologies (ITB4201) System log • Recovery techniques are heavily dependent upon the existence of a special file known as a system log. • It contains information about the start and end of each transaction and any updates which occur in the transaction. • The log keeps track of all transaction operations that affect the values of database items. • This information is needed to recover from transaction failure
  • 6. Department of Information Technology 6Data base Technologies (ITB4201) System Logs Description disk start_transaction(T) This log entry records that transaction T starts the execution read_item(T, X) This log entry records that transaction T reads the value of database item X write_item(T, X, old_value, new_value) This log entry records that transaction T changes the value of the database item X from old_value to new_value. The old value is sometimes known as a before an image of X, and the new value is known as an afterimage of X. commit(T) This log entry records that transaction T has completed all accesses to the database successfully and its effect can be committed (recorded permanently) to the database abort(T) This records that transaction T has been aborted checkpoint Checkpoint is a mechanism where all the previous logs are removed from the system and stored permanently in a storage disk. Checkpoint declares a point before which the DBMS was in consistent state, and all the transactions were committed.
  • 7. Department of Information Technology 7Data base Technologies (ITB4201) Working of Commit and Roll back • A transaction T reaches its commit point when all its operations that access the database have been executed successfully i.e. the transaction has reached the point at which it will not abort (terminate without completing). • Once committed, the transaction is permanently recorded in the database. • Commitment always involves writing a commit entry to the log and writing the log to disk. • At the time of a system crash, item is searched back in the log for all transactions T that have written a start_transaction(T) entry into the log but have not written a commit(T) entry yet; these transactions may have to be rolled back to undo their effect on the database during the recovery process
  • 8. Department of Information Technology 8Data base Technologies (ITB4201) Recovery techniques • Undoing – If a transaction crashes, then the recovery manager may undo transactions i.e. reverse the operations of a transaction. This involves examining a transaction for the log entry write_item(T, x, old_value, new_value) and setting the value of item x in the database to old-value. There are two major techniques for recovery from non-catastrophic transaction failures: deferred updates and immediate updates.
  • 9. Department of Information Technology 9Data base Technologies (ITB4201) Recovery techniques (cont..) • Deferred update – This technique does not physically update the database on disk until a transaction has reached its commit point. Before reaching commit, all transaction updates are recorded in the local transaction workspace. If a transaction fails before reaching its commit point, it will not have changed the database in any way so UNDO is not needed. It may be necessary to REDO the effect of the operations that are recorded in the local transaction workspace, because their effect may not yet have been written in the database. Hence, a deferred update is also known as the No-undo/redo algorithm • Immediate update – In the immediate update, the database may be updated by some operations of a transaction before the transaction reaches its commit point. However, these operations are recorded in a log on disk before they are applied to the database, making recovery still possible. If a transaction fails to reach its commit point, the effect of its operation must be undone i.e. the transaction must be rolled back hence we require both undo and redo. This technique is known as undo/redo algorithm.
  • 10. Department of Information Technology 10Data base Technologies (ITB4201) Recovery techniques (cont..) • Caching/Buffering – In this one or more disk pages that include data items to be updated are cached into main memory buffers and then updated in memory before being written back to disk. A collection of in-memory buffers called the DBMS cache is kept under control of DBMS for holding these buffers. A directory is used to keep track of which database items are in the buffer. A dirty bit is associated with each buffer, which is 0 if the buffer is not modified else 1 if modified. • Shadow paging – It provides atomicity and durability. A directory with n entries is constructed, where the ith entry points to the ith database page on the link. When a transaction began executing the current directory is copied into a shadow directory. When a page is to be modified, a shadow page is allocated in which changes are made and when it is ready to become durable, all pages that refer to original are updated to refer new replacement page.
  • 11. Department of Information Technology 11Data base Technologies (ITB4201) Backup techniques • Full database backup – In this full database including data and database, Meta information needed to restore the whole database, including full-text catalogs are backed up in a predefined time series. • Differential backup – It stores only the data changes that have occurred since last full database backup. When same data has changed many times since last full database backup, a differential backup stores the most recent version of changed data. For this first, we need to restore a full database backup. • Transaction log backup – In this, all events that have occurred in the database, like a record of every single statement executed is backed up. It is the backup of transaction log entries and contains all transaction that had happened to the database. Through this, the database can be recovered to a specific point in time. It is even possible to perform a backup from a transaction log if the data files are destroyed and not even a single committed transaction is lost.
  • 12. Department of Information Technology 12Data base Technologies (ITB4201) Test Yourself 1. Which of the following is not a recovery technique? A. Deferred update B. Immediate update C. Two-phase commit D. Recovery management 2. Checkpoints are a part of A. Recovery measures B. Security measures C. Concurrency measures D. Authorization measures 3. .......... is an alternative of log based recovery. A. Disk recovery B. Shadow paging C. Dish shadowing D. Crash recovery 4. In the ___________ scheme, a transaction that wants to update the database first creates a complete copy of the database. A. Shadow copy B. Shadow Paging C. Update log records D. All of the mentioned 5. If a transaction does not modify the database until it has committed, it is said to use the ___________ technique. A. Deferred-modification B. Late-modification C. Immediate-modification D. Undo
  • 13. Department of Information Technology 13Data base Technologies (ITB4201) 1. Which of the following is not a recovery technique? A. Deferred update B. Immediate update C. Two-phase commit D. Recovery management 2. Checkpoints are a part of A. Recovery measures B. Security measures C. Concurrency measures D. Authorization measures 3. .......... is an alternative of log based recovery. A. Disk recovery B. Shadow paging C. Dish shadowing D. Crash recovery 4. In the ___________ scheme, a transaction that wants to update the database first creates a complete copy of the database. A. Shadow copy B. Shadow Paging C. Update log records D. All of the mentioned 5. If a transaction does not modify the database until it has committed, it is said to use the ___________ technique. A. Deferred-modification B. Late-modification C. Immediate-modification D. Undo Answers