SlideShare a Scribd company logo
What is Database Backup?
• Copying and archiving of computer data so it may be used to restore the original after a
data loss event.
• Purpose is to recover data after it is lost from corruption or deletion.
• Second purpose is to recover data from an earlier time.
What is Database recovery techniques
Recovery techniques are used to ensure database consistency and transaction automaticity and
durability despite failures.
Why recovery is needed? (What causes a Transaction to fail?)
There are several reasons that could cause a transaction to fail in the middle of execution
1. A computer failure (system crash): A hardware or software error occurs in the
computer system during transaction execution. If the hardware crashes, the contents of
the computer’s internal memory may be lost.
2. A transaction or system error : Some operation in the transaction may cause it to fail,
such as integer overflow or division by zero. Transaction failure may also occur because
of a logical programming error. In addition, the user may interrupt the transaction during
its execution.
3. Local errors or exception conditions detected by the transaction.
4. Disk failure: Some disk blocks may lose their data because of a disk read/write head
crash. This may happen during a read or a write operation of the transaction.
5. Physical problems and catastrophes: This refers to an endless list of problems that
includes power or air-conditioning failure, fire, theft, sabotage, overwriting disks or tapes
by mistake, and mounting of a wrong tape by the operator.
There are many different approaches to recover a database:
Manual reprocessing & a variety of automated recovery techniques.
1. Manual Reprocessing
The database is periodically backed up (a database save) and all transactions applied since the
last save are recorded. If the system crashes, the latest database save is restored and all of the
transactions are re-applied (by users) to bring the database back up to the point just before the
crash.
Limitations:
• Time required to reapply transactions
• Transactions might have other (physical) potential failures
• Reapplying concurrent transactions is not straight forward.
2. Automated Recovery
There are several types of automated recovery techniques including: Deferred update,
Immediate update, Shadow paging, etc.
1
A transaction can be in one of the following states:
• Active - when the transaction just begins
• Partially Committed - after the last operation has completed (but before the commit
point is reached)
• Failed - Normal operation is prevented (e.g., in the event of a system crash)
• Aborted - Transaction is rolled back. That is, all of its effects are undone
• Committed - Transaction completes all operations and moved the database to the next
consistent state
The System Log
To be able to recover from failures that affect transactions, the system maintains a log to keep
track of all transactions that affect the values of database items. Each transaction writes the
following information to the log:
• Start(T) - the fact that transaction T has started
• Write(T, X, old_value, new_value) - the fact that transaction T has written to item X
with the new_value. old_value is also maintained.
• Read(T,X)-the fact that transaction T has read data item X either:
Commit(T)-transaction T committed or Abort(T) - transaction T was aborted
Recovery techniques use the following operations:
UNDO (Backward Recovery): Similar to rollback except that it applies to a single operation
rather than to a whole transaction.
REDO (Forward Recovery): This specifies that certain transaction operations must be redone
to ensure that all the operations of a committed transaction have been applied successfully to the
database.
The 3 Important Recovery Techniques from transaction failures:
1. Deferred Update Recovery: Also called NO-UNDO, REDO Technique
This technique defers or postpones any actual updates to the database until the transaction
reaches it commit point.
• During transaction execution, the updates are written to the log file.
• After the transaction reaches it commit point, the log file is force-written to disk, then
the updates are recorded in the database.
• If the transaction fails before reaching its commit point, there is no need to UNDO
any operations because the transaction has not affected the database on disk in any
way.
• REDO may be necessary.
A typical deferred update protocol uses the following rules:
2
1. A transaction cannot change the database on disk until it reaches its commit point.
2. A transaction does not reach its commit point until all its update operations are
recorded in the log file and the log file is force-written to disk.
3. Because the database is never updated on disk until after the transactions commits,
there is never the need to UNDO any operations. That’s why a recovery techniques based
on deferred update are therefore known as NO UNDO, REDO techniques.
Example:
T1: Ra Rd Wd C
T2: Rb Wb Rd Wd C
T3: Ra Wa Rc Wc C
T4: Rb Wb Ra Wa C
Log file:
Start(T1)
Write(T1, d, old, new)
Commit(T1)
Start(T4)
Write(T4, b, old, new)
Write(T4, a, old, new)
Commit(T4)
Start(T2)
Write(T2, b, old, new)
Start(T3)
Write(T3, a, old, new)
s y s t e m c r a s h
Since T1 and T4 committed, their changes were written to disk. However, T2 and T3 did not
commit, hence their changes were not written to disk. To recover, we simply ignore those
transactions that did not commit.
Advantages:
• Recovery is made easier.
• Any transaction that reached the commit point (from the log) has its writes applied to the
database.
• All other transactions are ignored.
• Cascading rollback does not occur because no other transaction sees the work of another
until it is committed.
Disadvantages:
Concurrency is limited: Must employ Strict 2PL which limits concurrency.
2. Immediate Update Recovery: also called (UNDO, NO-REDO)
• The database is physically updated before the transaction reaches to its commit point.
• UNDO may be necessary when a transaction fails.
3
• REDO is not needed.
A typical deferred update protocol uses the following rules:
1. In immediate update techniques, although the database can be updated immediately,
update operations must be recorded in the log (on disk) before being applied to the
database.
2. There is never a need to REDO any operations of committed transactions (this is
called the UNDO/NO-REDO recovery algorithm).
3. The effect of all active transactions at the time of failure must be undone.
Advantages:
Immediate update allows higher concurrency because transactions write continuously to the
database rather than waiting until the commit point.
Disadvantages:
Step 2 above can lead to cascading rollbacks - time consuming and may be problematic.
3. Shadow paging
• Is a technique for providing automaticity and durability properties related to transaction
control.
• This technique does not require the use of a log in a single-user environment. In a
multiuser environment, a log may be needed for the concurrency control method.
• Shadow paging considers the database to be made up of a number of fixed size disk pages
(or disk blocks)—say, n—for recovery purposes. A directory(page table) with n entries
is constructed, where the ith
entry points to the ith
database page on disk.
• The idea is to maintain 2 directories (page tables) during the lifetime of a transaction,
Current directory & the Shadow directory.
• The directory is kept in main memory if it is not too large, and all references—reads or
writes—to database pages on disk go through it.
• Initially both the directories are identical. Only current directory is used for data item
accesses during execution of the transaction.
• Whenever any page is about to be written for the first time-a copy of this page is made on
to an unused page.
• When a transaction begins executing, the current directory—whose entries point to the
most recent or current database pages on disk—is copied into a shadow directory. The
4
shadow directory is then saved on disk while the current directory is used by the
transaction.
The figure below illustrates the use of Shadow paging techniques:
Advantages:
• The overhead of maintaining the transaction log file is eliminated.
• Since there is no need for undo or redo operations, recovery is significantly fast.
Disadvantages:
• Copying the entire page table is very expensive.
• Complex storage management strategies.
5
shadow directory is then saved on disk while the current directory is used by the
transaction.
The figure below illustrates the use of Shadow paging techniques:
Advantages:
• The overhead of maintaining the transaction log file is eliminated.
• Since there is no need for undo or redo operations, recovery is significantly fast.
Disadvantages:
• Copying the entire page table is very expensive.
• Complex storage management strategies.
5

More Related Content

What's hot

Topic 4 database recovery
Topic 4 database recoveryTopic 4 database recovery
Topic 4 database recovery
acap paei
 
Database recovery
Database recoveryDatabase recovery
Database recovery
Student
 
Recovery system
Recovery systemRecovery system
Recovery system
lalithambiga kamaraj
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of Recovery
Pooja Dixit
 
recovery system
recovery systemrecovery system
recovery system
shreeuva
 
Recovery system
Recovery systemRecovery system
Recovery system
Rakesh S
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency Control
Ravimuthurajan
 
Operating Systems: Processor Management
Operating Systems: Processor ManagementOperating Systems: Processor Management
Operating Systems: Processor Management
Damian T. Gordon
 
Lesson12 recovery architectures
Lesson12 recovery architecturesLesson12 recovery architectures
Lesson12 recovery architectures
Raval Vijay
 
4 db recovery
4 db recovery4 db recovery
4 db recovery
ashish61_scs
 
Ch17 introduction to transaction processing concepts and theory
Ch17 introduction to transaction processing concepts and theoryCh17 introduction to transaction processing concepts and theory
Ch17 introduction to transaction processing concepts and theorymeenatchi selvaraj
 
Backing Up and Recovery
Backing Up and RecoveryBacking Up and Recovery
Backing Up and Recovery
Maham Huda
 
Real Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded SystemsReal Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded Systems
Aditya Vichare
 
CS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency ControlCS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency ControlJ Singh
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
Anne Lee
 
Dbms
DbmsDbms
Data (1)
Data (1)Data (1)
Data (1)
Ankit Anand
 

What's hot (20)

Topic 4 database recovery
Topic 4 database recoveryTopic 4 database recovery
Topic 4 database recovery
 
Database recovery
Database recoveryDatabase recovery
Database recovery
 
Recovery system
Recovery systemRecovery system
Recovery system
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of Recovery
 
Aries
AriesAries
Aries
 
Unit 07 dbms
Unit 07 dbmsUnit 07 dbms
Unit 07 dbms
 
recovery system
recovery systemrecovery system
recovery system
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency Control
 
Operating Systems: Processor Management
Operating Systems: Processor ManagementOperating Systems: Processor Management
Operating Systems: Processor Management
 
Lesson12 recovery architectures
Lesson12 recovery architecturesLesson12 recovery architectures
Lesson12 recovery architectures
 
4 db recovery
4 db recovery4 db recovery
4 db recovery
 
Ch17 introduction to transaction processing concepts and theory
Ch17 introduction to transaction processing concepts and theoryCh17 introduction to transaction processing concepts and theory
Ch17 introduction to transaction processing concepts and theory
 
Backing Up and Recovery
Backing Up and RecoveryBacking Up and Recovery
Backing Up and Recovery
 
Real Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded SystemsReal Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded Systems
 
CS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency ControlCS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency Control
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
 
Dbms
DbmsDbms
Dbms
 
Data (1)
Data (1)Data (1)
Data (1)
 

Similar to What is Database Backup? The 3 Important Recovery Techniques from transaction failures

DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdf
NithishReddy90
 
Recovery techniques
Recovery techniquesRecovery techniques
Recovery techniques
Dr. C.V. Suresh Babu
 
Databases: Backup and Recovery
Databases: Backup and RecoveryDatabases: Backup and Recovery
Databases: Backup and RecoveryDamian T. Gordon
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.ppt
AdemeCheklie
 
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
Zainab Almugbel
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdf
KavitaShinde26
 
Dbms
DbmsDbms
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptxUnit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
Koteswari Kasireddy
 
Recovery System.pptx
Recovery System.pptxRecovery System.pptx
Recovery System.pptx
ssuserfb9a21
 
DBMS-Recovery techniques dfggrjfchdfhwrshfxbvdgtytdfx.pptx
DBMS-Recovery techniques dfggrjfchdfhwrshfxbvdgtytdfx.pptxDBMS-Recovery techniques dfggrjfchdfhwrshfxbvdgtytdfx.pptx
DBMS-Recovery techniques dfggrjfchdfhwrshfxbvdgtytdfx.pptx
HemaSenthil5
 
DBMS UNIT IV.pptx
DBMS UNIT IV.pptxDBMS UNIT IV.pptx
DBMS UNIT IV.pptx
Janagi Raman S
 
Unit no 5 transation processing DMS 22319
Unit no 5 transation processing DMS 22319Unit no 5 transation processing DMS 22319
Unit no 5 transation processing DMS 22319
ARVIND SARDAR
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
Transactionsmanagement
Sanjeev Gupta
 
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
thejaswini40
 
Presentation on Transaction
Presentation on TransactionPresentation on Transaction
Presentation on Transaction
Rahul Prajapati
 
Assignment#14
Assignment#14Assignment#14
Assignment#14
Sunita Milind Dol
 
Tranasaction management
Tranasaction managementTranasaction management
Tranasaction management
Dr. C.V. Suresh Babu
 
Adbms 34 transaction processing and recovery
Adbms 34 transaction processing and recoveryAdbms 34 transaction processing and recovery
Adbms 34 transaction processing and recovery
Vaibhav Khanna
 

Similar to What is Database Backup? The 3 Important Recovery Techniques from transaction failures (20)

DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdf
 
Recovery techniques
Recovery techniquesRecovery techniques
Recovery techniques
 
Databases: Backup and Recovery
Databases: Backup and RecoveryDatabases: Backup and Recovery
Databases: Backup and Recovery
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.ppt
 
ch-5 advanced db.pdf
ch-5 advanced db.pdfch-5 advanced db.pdf
ch-5 advanced db.pdf
 
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
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdf
 
Dbms
DbmsDbms
Dbms
 
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptxUnit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
 
Recovery System.pptx
Recovery System.pptxRecovery System.pptx
Recovery System.pptx
 
2 recovery
2 recovery2 recovery
2 recovery
 
DBMS-Recovery techniques dfggrjfchdfhwrshfxbvdgtytdfx.pptx
DBMS-Recovery techniques dfggrjfchdfhwrshfxbvdgtytdfx.pptxDBMS-Recovery techniques dfggrjfchdfhwrshfxbvdgtytdfx.pptx
DBMS-Recovery techniques dfggrjfchdfhwrshfxbvdgtytdfx.pptx
 
DBMS UNIT IV.pptx
DBMS UNIT IV.pptxDBMS UNIT IV.pptx
DBMS UNIT IV.pptx
 
Unit no 5 transation processing DMS 22319
Unit no 5 transation processing DMS 22319Unit no 5 transation processing DMS 22319
Unit no 5 transation processing DMS 22319
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
Transactionsmanagement
 
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
 
Presentation on Transaction
Presentation on TransactionPresentation on Transaction
Presentation on Transaction
 
Assignment#14
Assignment#14Assignment#14
Assignment#14
 
Tranasaction management
Tranasaction managementTranasaction management
Tranasaction management
 
Adbms 34 transaction processing and recovery
Adbms 34 transaction processing and recoveryAdbms 34 transaction processing and recovery
Adbms 34 transaction processing and recovery
 

More from Raj vardhan

Software Testing Life Cycle Unit-3
Software Testing Life Cycle Unit-3Software Testing Life Cycle Unit-3
Software Testing Life Cycle Unit-3
Raj vardhan
 
Internet Basics Unit-7
Internet Basics  Unit-7Internet Basics  Unit-7
Internet Basics Unit-7
Raj vardhan
 
Local Area Network – Wired LAN
Local Area Network – Wired LANLocal Area Network – Wired LAN
Local Area Network – Wired LAN
Raj vardhan
 
Network Connecting Devices UNIT 5
Network Connecting Devices UNIT 5Network Connecting Devices UNIT 5
Network Connecting Devices UNIT 5
Raj vardhan
 
UNIT 4-HEADER FILES IN C
UNIT 4-HEADER FILES IN CUNIT 4-HEADER FILES IN C
UNIT 4-HEADER FILES IN C
Raj vardhan
 
Wireless LANs(IEEE802.11) Architecture
Wireless LANs(IEEE802.11) Architecture Wireless LANs(IEEE802.11) Architecture
Wireless LANs(IEEE802.11) Architecture
Raj vardhan
 
UNIT -03 Transmission Media and Connecting Devices
UNIT -03 Transmission Media and Connecting Devices UNIT -03 Transmission Media and Connecting Devices
UNIT -03 Transmission Media and Connecting Devices
Raj vardhan
 
Unit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteUnit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 Complete
Raj vardhan
 
Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2
Raj vardhan
 
Swachh Bharat Abhiyan - Project Report
Swachh Bharat Abhiyan - Project ReportSwachh Bharat Abhiyan - Project Report
Swachh Bharat Abhiyan - Project Report
Raj vardhan
 
Network Topology
Network TopologyNetwork Topology
Network Topology
Raj vardhan
 
Microsoft Office Word Introduction Complete
Microsoft Office Word  Introduction CompleteMicrosoft Office Word  Introduction Complete
Microsoft Office Word Introduction Complete
Raj vardhan
 
Digital money Revolution Introduction
Digital money Revolution IntroductionDigital money Revolution Introduction
Digital money Revolution Introduction
Raj vardhan
 
C Programming
C ProgrammingC Programming
C Programming
Raj vardhan
 
Definition of Business
Definition of BusinessDefinition of Business
Definition of Business
Raj vardhan
 
Business Terms & Concepts
Business Terms & ConceptsBusiness Terms & Concepts
Business Terms & Concepts
Raj vardhan
 
Number System Conversion | BCA
Number System Conversion | BCANumber System Conversion | BCA
Number System Conversion | BCA
Raj vardhan
 
Interaction With Computers FIT
Interaction With Computers FITInteraction With Computers FIT
Interaction With Computers FIT
Raj vardhan
 
FIT-MS-WORD Lab | BCA
FIT-MS-WORD Lab | BCAFIT-MS-WORD Lab | BCA
FIT-MS-WORD Lab | BCA
Raj vardhan
 
Syllabus Front End Design Tool VB.NET | BCA-205
Syllabus Front End Design Tool VB.NET | BCA-205 Syllabus Front End Design Tool VB.NET | BCA-205
Syllabus Front End Design Tool VB.NET | BCA-205
Raj vardhan
 

More from Raj vardhan (20)

Software Testing Life Cycle Unit-3
Software Testing Life Cycle Unit-3Software Testing Life Cycle Unit-3
Software Testing Life Cycle Unit-3
 
Internet Basics Unit-7
Internet Basics  Unit-7Internet Basics  Unit-7
Internet Basics Unit-7
 
Local Area Network – Wired LAN
Local Area Network – Wired LANLocal Area Network – Wired LAN
Local Area Network – Wired LAN
 
Network Connecting Devices UNIT 5
Network Connecting Devices UNIT 5Network Connecting Devices UNIT 5
Network Connecting Devices UNIT 5
 
UNIT 4-HEADER FILES IN C
UNIT 4-HEADER FILES IN CUNIT 4-HEADER FILES IN C
UNIT 4-HEADER FILES IN C
 
Wireless LANs(IEEE802.11) Architecture
Wireless LANs(IEEE802.11) Architecture Wireless LANs(IEEE802.11) Architecture
Wireless LANs(IEEE802.11) Architecture
 
UNIT -03 Transmission Media and Connecting Devices
UNIT -03 Transmission Media and Connecting Devices UNIT -03 Transmission Media and Connecting Devices
UNIT -03 Transmission Media and Connecting Devices
 
Unit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteUnit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 Complete
 
Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2Introduction To Software Concepts Unit 1 & 2
Introduction To Software Concepts Unit 1 & 2
 
Swachh Bharat Abhiyan - Project Report
Swachh Bharat Abhiyan - Project ReportSwachh Bharat Abhiyan - Project Report
Swachh Bharat Abhiyan - Project Report
 
Network Topology
Network TopologyNetwork Topology
Network Topology
 
Microsoft Office Word Introduction Complete
Microsoft Office Word  Introduction CompleteMicrosoft Office Word  Introduction Complete
Microsoft Office Word Introduction Complete
 
Digital money Revolution Introduction
Digital money Revolution IntroductionDigital money Revolution Introduction
Digital money Revolution Introduction
 
C Programming
C ProgrammingC Programming
C Programming
 
Definition of Business
Definition of BusinessDefinition of Business
Definition of Business
 
Business Terms & Concepts
Business Terms & ConceptsBusiness Terms & Concepts
Business Terms & Concepts
 
Number System Conversion | BCA
Number System Conversion | BCANumber System Conversion | BCA
Number System Conversion | BCA
 
Interaction With Computers FIT
Interaction With Computers FITInteraction With Computers FIT
Interaction With Computers FIT
 
FIT-MS-WORD Lab | BCA
FIT-MS-WORD Lab | BCAFIT-MS-WORD Lab | BCA
FIT-MS-WORD Lab | BCA
 
Syllabus Front End Design Tool VB.NET | BCA-205
Syllabus Front End Design Tool VB.NET | BCA-205 Syllabus Front End Design Tool VB.NET | BCA-205
Syllabus Front End Design Tool VB.NET | BCA-205
 

Recently uploaded

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 

Recently uploaded (20)

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 

What is Database Backup? The 3 Important Recovery Techniques from transaction failures

  • 1. What is Database Backup? • Copying and archiving of computer data so it may be used to restore the original after a data loss event. • Purpose is to recover data after it is lost from corruption or deletion. • Second purpose is to recover data from an earlier time. What is Database recovery techniques Recovery techniques are used to ensure database consistency and transaction automaticity and durability despite failures. Why recovery is needed? (What causes a Transaction to fail?) There are several reasons that could cause a transaction to fail in the middle of execution 1. A computer failure (system crash): A hardware or software error occurs in the computer system during transaction execution. If the hardware crashes, the contents of the computer’s internal memory may be lost. 2. A transaction or system error : Some operation in the transaction may cause it to fail, such as integer overflow or division by zero. Transaction failure may also occur because of a logical programming error. In addition, the user may interrupt the transaction during its execution. 3. Local errors or exception conditions detected by the transaction. 4. Disk failure: Some disk blocks may lose their data because of a disk read/write head crash. This may happen during a read or a write operation of the transaction. 5. Physical problems and catastrophes: This refers to an endless list of problems that includes power or air-conditioning failure, fire, theft, sabotage, overwriting disks or tapes by mistake, and mounting of a wrong tape by the operator. There are many different approaches to recover a database: Manual reprocessing & a variety of automated recovery techniques. 1. Manual Reprocessing The database is periodically backed up (a database save) and all transactions applied since the last save are recorded. If the system crashes, the latest database save is restored and all of the transactions are re-applied (by users) to bring the database back up to the point just before the crash. Limitations: • Time required to reapply transactions • Transactions might have other (physical) potential failures • Reapplying concurrent transactions is not straight forward. 2. Automated Recovery There are several types of automated recovery techniques including: Deferred update, Immediate update, Shadow paging, etc. 1
  • 2. A transaction can be in one of the following states: • Active - when the transaction just begins • Partially Committed - after the last operation has completed (but before the commit point is reached) • Failed - Normal operation is prevented (e.g., in the event of a system crash) • Aborted - Transaction is rolled back. That is, all of its effects are undone • Committed - Transaction completes all operations and moved the database to the next consistent state The System Log To be able to recover from failures that affect transactions, the system maintains a log to keep track of all transactions that affect the values of database items. Each transaction writes the following information to the log: • Start(T) - the fact that transaction T has started • Write(T, X, old_value, new_value) - the fact that transaction T has written to item X with the new_value. old_value is also maintained. • Read(T,X)-the fact that transaction T has read data item X either: Commit(T)-transaction T committed or Abort(T) - transaction T was aborted Recovery techniques use the following operations: UNDO (Backward Recovery): Similar to rollback except that it applies to a single operation rather than to a whole transaction. REDO (Forward Recovery): This specifies that certain transaction operations must be redone to ensure that all the operations of a committed transaction have been applied successfully to the database. The 3 Important Recovery Techniques from transaction failures: 1. Deferred Update Recovery: Also called NO-UNDO, REDO Technique This technique defers or postpones any actual updates to the database until the transaction reaches it commit point. • During transaction execution, the updates are written to the log file. • After the transaction reaches it commit point, the log file is force-written to disk, then the updates are recorded in the database. • If the transaction fails before reaching its commit point, there is no need to UNDO any operations because the transaction has not affected the database on disk in any way. • REDO may be necessary. A typical deferred update protocol uses the following rules: 2
  • 3. 1. A transaction cannot change the database on disk until it reaches its commit point. 2. A transaction does not reach its commit point until all its update operations are recorded in the log file and the log file is force-written to disk. 3. Because the database is never updated on disk until after the transactions commits, there is never the need to UNDO any operations. That’s why a recovery techniques based on deferred update are therefore known as NO UNDO, REDO techniques. Example: T1: Ra Rd Wd C T2: Rb Wb Rd Wd C T3: Ra Wa Rc Wc C T4: Rb Wb Ra Wa C Log file: Start(T1) Write(T1, d, old, new) Commit(T1) Start(T4) Write(T4, b, old, new) Write(T4, a, old, new) Commit(T4) Start(T2) Write(T2, b, old, new) Start(T3) Write(T3, a, old, new) s y s t e m c r a s h Since T1 and T4 committed, their changes were written to disk. However, T2 and T3 did not commit, hence their changes were not written to disk. To recover, we simply ignore those transactions that did not commit. Advantages: • Recovery is made easier. • Any transaction that reached the commit point (from the log) has its writes applied to the database. • All other transactions are ignored. • Cascading rollback does not occur because no other transaction sees the work of another until it is committed. Disadvantages: Concurrency is limited: Must employ Strict 2PL which limits concurrency. 2. Immediate Update Recovery: also called (UNDO, NO-REDO) • The database is physically updated before the transaction reaches to its commit point. • UNDO may be necessary when a transaction fails. 3
  • 4. • REDO is not needed. A typical deferred update protocol uses the following rules: 1. In immediate update techniques, although the database can be updated immediately, update operations must be recorded in the log (on disk) before being applied to the database. 2. There is never a need to REDO any operations of committed transactions (this is called the UNDO/NO-REDO recovery algorithm). 3. The effect of all active transactions at the time of failure must be undone. Advantages: Immediate update allows higher concurrency because transactions write continuously to the database rather than waiting until the commit point. Disadvantages: Step 2 above can lead to cascading rollbacks - time consuming and may be problematic. 3. Shadow paging • Is a technique for providing automaticity and durability properties related to transaction control. • This technique does not require the use of a log in a single-user environment. In a multiuser environment, a log may be needed for the concurrency control method. • Shadow paging considers the database to be made up of a number of fixed size disk pages (or disk blocks)—say, n—for recovery purposes. A directory(page table) with n entries is constructed, where the ith entry points to the ith database page on disk. • The idea is to maintain 2 directories (page tables) during the lifetime of a transaction, Current directory & the Shadow directory. • The directory is kept in main memory if it is not too large, and all references—reads or writes—to database pages on disk go through it. • Initially both the directories are identical. Only current directory is used for data item accesses during execution of the transaction. • Whenever any page is about to be written for the first time-a copy of this page is made on to an unused page. • When a transaction begins executing, the current directory—whose entries point to the most recent or current database pages on disk—is copied into a shadow directory. The 4
  • 5. shadow directory is then saved on disk while the current directory is used by the transaction. The figure below illustrates the use of Shadow paging techniques: Advantages: • The overhead of maintaining the transaction log file is eliminated. • Since there is no need for undo or redo operations, recovery is significantly fast. Disadvantages: • Copying the entire page table is very expensive. • Complex storage management strategies. 5
  • 6. shadow directory is then saved on disk while the current directory is used by the transaction. The figure below illustrates the use of Shadow paging techniques: Advantages: • The overhead of maintaining the transaction log file is eliminated. • Since there is no need for undo or redo operations, recovery is significantly fast. Disadvantages: • Copying the entire page table is very expensive. • Complex storage management strategies. 5