SlideShare a Scribd company logo
Prof. Neeraj Bhargava
Pooja Dixit
Department of Computer Science
School of Engineering & System Science
MDS, University Ajmer, Rajasthan, India
1
 Introduction…
 What & Why…
 Types…
Failure…
Recovery…
 Key Features…
 Problems…
 Conclusion…
2
“Recovery” is the process of restoring the database to
the most recent consistent state that exits just before the
Failure.
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.
3
In computing, data recovery is a process of retrieving
inaccessible, lost, corrupted, damaged or formatted data
from secondary storage, removable media or files, when
the data stored in them cannot be accessed in a normal
way.
The most common data recovery scenario involves an
operating system failure, malfunction of a storage device,
logical failure of storage devices, accidental damage or
deletion, etc.
4
After all when data is starting to lost there are some
techniques introduced to retrieve that data back
safely.
There are 3 states of database Recovery:
 Pre-Condition:- At any given point in the time the
database is in consistent state.
 Condition:- Occurs some kind of system failure.
 Post-condition:- Restore the database to the
consistent state that existed before the failure.
Note :-
Before we discuss about Recovery first we need to know about why Recovery is needed ?
It is need because of failure’s.
So we first Understand about failure…
5
In Computer terminology “Failure “ is the state when
any process is being “Interrupted” and cant produce
an desired result’s.
In concern with DBMS Failure can be classified by :–
 Transaction Failure
 System crash
 Disk Failure
6
7
 The transaction failure occurs when it fails to
execute or when it reaches a point from where it
can't go any further. If a few transaction or
process is hurt, then this is called as transaction
failure.
 Reasons for a transaction failure could be -
◦ Logical errors: If a transaction cannot complete due to
some code error or an internal error condition, then the
logical error occurs.
◦ Syntax error: It occurs where the DBMS itself terminates
an active transaction because the database system is not
able to execute it. For example, The system aborts an
active transaction, in case of deadlock or resource
unavailability.
8
Simply we can say that System failure can occur due
to power failure or other hardware or software
failure.
In computing, a crash, or system crash, occurs
when a computer program such as a software
application or an operating system stops
functioning properly and exits.
9
Disk failure occurs due to the formation of bad
sectors, disk head crash, and unreachability to
the disk or any other failure, which destroy all or
part of disk storage.
A hard disk failure may occur in the course of
normal operation, or due to an external factor
such as exposure to fire or water or
high magnetic fields, or suffering a
sharp impact or environmental contamination,
which can lead to a head crash.
10
“Recovery” is the process of restoring the database
to the most recent consistent state that exits just
before the Failure.
11
There are basically 2 types Recovery
techniques
i.e.
1) LOG BASED
2) CONCURRENT TRANSACTION
12
Log is a sequence of records, which maintains
the records of actions performed by a
transaction. In this method LOG of each
transaction is maintain in some Stable
Storage.
In case of any Failure occurs it can be recover
from recover Station.
LOG:- Every log will have an information like
what transaction is being executed , which
value have been modified.
13
Write to a log file before writing to database
 Enter log records
Transaction states:
 Start, Abort, Commit
Example log file
DB(A = 1000,B = 2000)
Transaction Log File
T1 start <T1,Start>
Read(A)
A = A-100
Write(A) <T1,A,1000,900>
T1 end <T1, Commit>
T2 start <T2, Start>
Read(B)
B=B+100
Write(B) <T2, B, 2000, 2100>
T2 end <T2, Commit>
14
When more than one transaction are being execute
parallel the LOG, at Recovery time it would become
hard for recovery system to back track all log’s.
So to prevent this situation we use
“CHECKPOINTS”.
These are like Bookmarks , when transaction is
executed such chckpnt are marked on that
transaction.
15
 Recovery system consults log file when
failure occurs
 Search entries in log file
 Time depends on number of entries
 Why redo transactions already written to
disk?
 Introduce checkpoint records into log file
 Only transactions committed after last
checkpoint
 need to be redone after a failure
16
 The recovery system reads the logs backwards
from the end to the last checkpoint.
 It maintains two lists, an undo-list and a redo-
list.
 If the recovery system sees a log with <Tn, Start>
and <Tn, Commit> or just <Tn, Commit>, it puts
the transaction in the redo-list.
 If the recovery system sees a log with <Tn, Start>
but no commit or abort log found, it puts the
transaction in undo-list.
17
From the above Description about the Failure &
Data Recovery techniques we had focus on
Problem i.e the data can be lost for many
reasons
and sometimes the System cant be helpful for
storing data by which many organization can
face
the data lost , lack of information , corrupt data
and many more similar situation’s.
18
 Recovery is an modern methodology that prevent
user from crucial data loss problem.
 There are several techniques that can help and
stop the Failure at there own level.
 The Checkpoint is a term that ensure your
progress on data by which in a large dataset the
user can start from last “checkpoint”.
19

More Related Content

What's hot

File access methods.54
File access methods.54File access methods.54
File access methods.54
myrajendra
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
koolkampus
 
Data and database administration(database)
Data and database administration(database)Data and database administration(database)
Data and database administration(database)
welcometofacebook
 

What's hot (20)

Components and Advantages of DBMS
Components and Advantages of DBMSComponents and Advantages of DBMS
Components and Advantages of DBMS
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMS
 
Database backup and recovery basics
Database backup and recovery basicsDatabase backup and recovery basics
Database backup and recovery basics
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
File system structure
File system structureFile system structure
File system structure
 
Multiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesMultiversion Concurrency Control Techniques
Multiversion Concurrency Control Techniques
 
Crash recovery in database
Crash recovery in databaseCrash recovery in database
Crash recovery in database
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 
Memory management
Memory managementMemory management
Memory management
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Data and database administration(database)
Data and database administration(database)Data and database administration(database)
Data and database administration(database)
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Disk structure
Disk structureDisk structure
Disk structure
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 

Similar to Recovery Techniques and Need of Recovery

Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning
Kernel Training
 

Similar to Recovery Techniques and Need of Recovery (20)

Db lec 07_new
Db lec 07_newDb lec 07_new
Db lec 07_new
 
Database failure and recovery 1
Database failure and recovery 1Database failure and recovery 1
Database failure and recovery 1
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theory
 
DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdf
 
Dbms
DbmsDbms
Dbms
 
What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...
 
Guide on Raid Data Recovery
Guide on Raid Data RecoveryGuide on Raid Data Recovery
Guide on Raid Data Recovery
 
DBMS unit-5.pdf
DBMS unit-5.pdfDBMS unit-5.pdf
DBMS unit-5.pdf
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdf
 
Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning
 
Why advanced monitoring is key for healthy
Why advanced monitoring is key for healthyWhy advanced monitoring is key for healthy
Why advanced monitoring is key for healthy
 
Six Mistakes of Log Management 2008
Six Mistakes of Log Management 2008Six Mistakes of Log Management 2008
Six Mistakes of Log Management 2008
 
Disaster Management - Technical
Disaster Management - TechnicalDisaster Management - Technical
Disaster Management - Technical
 
Database management
Database managementDatabase management
Database management
 
Database management
Database managementDatabase management
Database management
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2
 
Greske na sapu
Greske na sapuGreske na sapu
Greske na sapu
 
monitor_begin_s.PDF
monitor_begin_s.PDFmonitor_begin_s.PDF
monitor_begin_s.PDF
 
E-Business Information System BBA AVI.pptx
E-Business Information System BBA AVI.pptxE-Business Information System BBA AVI.pptx
E-Business Information System BBA AVI.pptx
 
Fast Start Failover DataGuard
Fast Start Failover DataGuardFast Start Failover DataGuard
Fast Start Failover DataGuard
 

More from Pooja Dixit

More from Pooja Dixit (20)

Combinational circuit.pptx
Combinational circuit.pptxCombinational circuit.pptx
Combinational circuit.pptx
 
number system.pptx
number system.pptxnumber system.pptx
number system.pptx
 
Multiplexer.pptx
Multiplexer.pptxMultiplexer.pptx
Multiplexer.pptx
 
Logic Gates.pptx
Logic Gates.pptxLogic Gates.pptx
Logic Gates.pptx
 
K-Map.pptx
K-Map.pptxK-Map.pptx
K-Map.pptx
 
Karnaugh Map Simplification Rules.pptx
Karnaugh Map Simplification Rules.pptxKarnaugh Map Simplification Rules.pptx
Karnaugh Map Simplification Rules.pptx
 
Half Subtractor.pptx
Half Subtractor.pptxHalf Subtractor.pptx
Half Subtractor.pptx
 
Gray Code.pptx
Gray Code.pptxGray Code.pptx
Gray Code.pptx
 
Flip Flop.pptx
Flip Flop.pptxFlip Flop.pptx
Flip Flop.pptx
 
Encoder.pptx
Encoder.pptxEncoder.pptx
Encoder.pptx
 
De-multiplexer.pptx
De-multiplexer.pptxDe-multiplexer.pptx
De-multiplexer.pptx
 
DeMorgan’s Theory.pptx
DeMorgan’s Theory.pptxDeMorgan’s Theory.pptx
DeMorgan’s Theory.pptx
 
Combinational circuit.pptx
Combinational circuit.pptxCombinational circuit.pptx
Combinational circuit.pptx
 
Boolean Algebra.pptx
Boolean Algebra.pptxBoolean Algebra.pptx
Boolean Algebra.pptx
 
Binary Multiplication & Division.pptx
Binary Multiplication & Division.pptxBinary Multiplication & Division.pptx
Binary Multiplication & Division.pptx
 
Binary addition.pptx
Binary addition.pptxBinary addition.pptx
Binary addition.pptx
 
Basics of Computer Organization.pptx
Basics of Computer Organization.pptxBasics of Computer Organization.pptx
Basics of Computer Organization.pptx
 
Decoders
DecodersDecoders
Decoders
 
Three Address code
Three Address code Three Address code
Three Address code
 
Cyrus beck line clipping algorithm
Cyrus beck line clipping algorithmCyrus beck line clipping algorithm
Cyrus beck line clipping algorithm
 

Recently uploaded

Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
Kamal Acharya
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering Workshop
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
Scaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageScaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltage
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientist
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
 

Recovery Techniques and Need of Recovery

  • 1. Prof. Neeraj Bhargava Pooja Dixit Department of Computer Science School of Engineering & System Science MDS, University Ajmer, Rajasthan, India 1
  • 2.  Introduction…  What & Why…  Types… Failure… Recovery…  Key Features…  Problems…  Conclusion… 2
  • 3. “Recovery” is the process of restoring the database to the most recent consistent state that exits just before the Failure. 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. 3
  • 4. In computing, data recovery is a process of retrieving inaccessible, lost, corrupted, damaged or formatted data from secondary storage, removable media or files, when the data stored in them cannot be accessed in a normal way. The most common data recovery scenario involves an operating system failure, malfunction of a storage device, logical failure of storage devices, accidental damage or deletion, etc. 4
  • 5. After all when data is starting to lost there are some techniques introduced to retrieve that data back safely. There are 3 states of database Recovery:  Pre-Condition:- At any given point in the time the database is in consistent state.  Condition:- Occurs some kind of system failure.  Post-condition:- Restore the database to the consistent state that existed before the failure. Note :- Before we discuss about Recovery first we need to know about why Recovery is needed ? It is need because of failure’s. So we first Understand about failure… 5
  • 6. In Computer terminology “Failure “ is the state when any process is being “Interrupted” and cant produce an desired result’s. In concern with DBMS Failure can be classified by :–  Transaction Failure  System crash  Disk Failure 6
  • 7. 7
  • 8.  The transaction failure occurs when it fails to execute or when it reaches a point from where it can't go any further. If a few transaction or process is hurt, then this is called as transaction failure.  Reasons for a transaction failure could be - ◦ Logical errors: If a transaction cannot complete due to some code error or an internal error condition, then the logical error occurs. ◦ Syntax error: It occurs where the DBMS itself terminates an active transaction because the database system is not able to execute it. For example, The system aborts an active transaction, in case of deadlock or resource unavailability. 8
  • 9. Simply we can say that System failure can occur due to power failure or other hardware or software failure. In computing, a crash, or system crash, occurs when a computer program such as a software application or an operating system stops functioning properly and exits. 9
  • 10. Disk failure occurs due to the formation of bad sectors, disk head crash, and unreachability to the disk or any other failure, which destroy all or part of disk storage. A hard disk failure may occur in the course of normal operation, or due to an external factor such as exposure to fire or water or high magnetic fields, or suffering a sharp impact or environmental contamination, which can lead to a head crash. 10
  • 11. “Recovery” is the process of restoring the database to the most recent consistent state that exits just before the Failure. 11
  • 12. There are basically 2 types Recovery techniques i.e. 1) LOG BASED 2) CONCURRENT TRANSACTION 12
  • 13. Log is a sequence of records, which maintains the records of actions performed by a transaction. In this method LOG of each transaction is maintain in some Stable Storage. In case of any Failure occurs it can be recover from recover Station. LOG:- Every log will have an information like what transaction is being executed , which value have been modified. 13
  • 14. Write to a log file before writing to database  Enter log records Transaction states:  Start, Abort, Commit Example log file DB(A = 1000,B = 2000) Transaction Log File T1 start <T1,Start> Read(A) A = A-100 Write(A) <T1,A,1000,900> T1 end <T1, Commit> T2 start <T2, Start> Read(B) B=B+100 Write(B) <T2, B, 2000, 2100> T2 end <T2, Commit> 14
  • 15. When more than one transaction are being execute parallel the LOG, at Recovery time it would become hard for recovery system to back track all log’s. So to prevent this situation we use “CHECKPOINTS”. These are like Bookmarks , when transaction is executed such chckpnt are marked on that transaction. 15
  • 16.  Recovery system consults log file when failure occurs  Search entries in log file  Time depends on number of entries  Why redo transactions already written to disk?  Introduce checkpoint records into log file  Only transactions committed after last checkpoint  need to be redone after a failure 16
  • 17.  The recovery system reads the logs backwards from the end to the last checkpoint.  It maintains two lists, an undo-list and a redo- list.  If the recovery system sees a log with <Tn, Start> and <Tn, Commit> or just <Tn, Commit>, it puts the transaction in the redo-list.  If the recovery system sees a log with <Tn, Start> but no commit or abort log found, it puts the transaction in undo-list. 17
  • 18. From the above Description about the Failure & Data Recovery techniques we had focus on Problem i.e the data can be lost for many reasons and sometimes the System cant be helpful for storing data by which many organization can face the data lost , lack of information , corrupt data and many more similar situation’s. 18
  • 19.  Recovery is an modern methodology that prevent user from crucial data loss problem.  There are several techniques that can help and stop the Failure at there own level.  The Checkpoint is a term that ensure your progress on data by which in a large dataset the user can start from last “checkpoint”. 19