SlideShare a Scribd company logo
Presentation Topic:
Backing Up and
Recovery Procedure
1
Contents
• Backup and Recovery
• Checkpoints
• Action performed during checkpoints
• Log -Record Buffering
• Write -Ahead Log Protocol
• Shadow Paging Technique
• Recovery Facilities
• Recovery and Restart Procedures
2
3
Stay Strong
Because
Recovery is Possible
4
Backup and Recovery
Backup and recovery is brought to
mind whenever there is potential
outside threats to a database.
Backup management refers to the
data safety.
5
Checkpoints
• To recover the database after some failure
we must consult the log record to determine
which transaction needs to be undone and
redone. For this we need to search the entire
log to determine this information. There are
two major problems with this approach.
1. The search process is time-consuming.
2. Most of the transactions need to redone
have already written their updates into the
database.
6
Checkpoints
• Although redoing them will cause no harm, but it
will make recovery process more time
consuming.
• To reduce these types of overhead, we introduce
Check points. The system periodically performs
Checkpoints.
• The log file may grow too big to be handled at all.
• Checkpoint is a mechanism where all the
previous logs are removed from the system and
stored permanently in a storage disk.
7
Actions Performed During
Checkpoints
• Output onto stable storage all log records currently residing in
main memory.
• Output on the disk all modified buffer blocks.
• The presence of a <checkpoint> record makes recovery process
more streamline.
• Consider a transaction Ti that committed prior to the
Checkpoint, means that <Ti, Commit> must appear in the log
before the<checkpoint> record.
• Any database modifications made by Ti must have been
written to the database either prior to the checkpoint or as
part of checkpoint itself.
8
Actions Performed During
Checkpoints
• Thus, at recovery time, there is no need to perform a redo
operation on Ti.
• The checkpoint record gives a list of all transactions that
were in progress at the time the checkpoint was taken.
Thus, the checkpoints help the system to provide
information at restart time which transaction to undo and
which to redo.
9
10
Example (contd..)
• A system failure has occurred at time tf
• The most recent checkpoint prior to time tf was taken at time tc
• Transactions of type T1 completed (successfully) prior to time tc
• Transactions of type T2 started prior to time tc and
completed(successfully) after time tc and before time tf
• Transactions of type T3 also started prior to time tc but did not
complete by time tf
• Transactions of type T4 started after time tc and
completed(successfully) before time tf.
• Finally, transactions of type T5 also started after time tc, but did
not complete by time tf
11
Example (contd..)
• It should be clear that, in case of immediate modification
technique those transactions that have <Ti, start> and <Ti,
commit> must be redo and those transactions that have only
<Ti, start> and no <Ti, commit> must be undo.
• Thus, when the system is restarted in case of immediate
database modification, transactions of types T3 and T5 must
be undone, and transactions of types T2 and T4 must be
redone. Note, however that transactions of type T1 do not
enter in the restart process at all, because their updates were
forced to the database at time tc as part of the checkpoint
process.
12
Log-Record Buffering
• As, we assumed earlier that every log record is output to
stable storage at the time it is created. This assumption
imposes a high overhead on system execution for the
following reasons:
• Output to stable storage is performed in units of blocks. In
most cases, a log record is much smaller than a block. Thus,
the output of each log record translates to a much larger
output at the physical level.
13
Log-Record Buffering
• To do so, we write log records to a log buffer in main memory,
where they stay temporarily until they are output to stable
storage.
• Multiple log records can be gathered in the log buffer and
output to stable storage in a single output operation. The
order of log records in the stable storage must be exactly the
same as the order in which they execute.
• The cost of performing the output of a block to storage is
sufficiently high that it is desirable to output multiple log
records at once.
14
Log-Record Buffering
• Due to the use of log buffering a log record may reside in only
main memory (volatile storage) for a considerable time before it
is output to stable storage. Since such log records are lost if the
system crashes, we must impose additional requirements on the
recovery techniques to ensure transaction atomicity.
• Transaction Ti enters the commit state after the <Ti commit> log
record has been output to stable storage.
15
Log-Record Buffering
• Before the <Ti commit> log record can be output to stable
storage, all log records pertaining to transaction Ti must have
been output to stable storage.
• Before a block of data in main memory can be output to the
database (in nonvolatile storage), all log records pertaining to
data in that block must have been output to stable storage.
The latter rule is called the write-ahead logging (WAL) rule.
16
Write-Ahead Log Protocol
• Before writing a transaction to disk, every update log
record that describes a change to this page must be
forced to stable storage.
• This is accomplished by forcing all log records to
stable storage before writing the transaction to disk.
• WAL is the fundamental rule that ensures that a
record of every change to the database is available
while attempting to recover from a crash. 17
Write-Ahead Log Protocol
• In computer science, write-ahead logging (WAL) is
a family of techniques for providing
atomicity and durability (two of
the ACID properties) in database systems. Usually
both redo and undo information is stored in the
log.
• Note that the definition of a committed
transaction is effectively “a transaction whose log
records, including a commit record, have all been
written to stable storage”.
18
page 3
page 2
page 4
page 1
page 5
page 6
Recovery: Shadow Paging
Technique
• The database is considered to be
made up of a number of n fixed-
size disk blocks or pages, for
recovery purposes.
• Current page table points to most
recent current database pages on
disk.
• When transaction starts both page
tables are identical for that
transaction.
2
1
3
4
5
6
Shadow page
table
Current
Page table
19
page 5 (old)
page 1
page 4
page 2 (old)
page 3
page 6
page 2 (new)
page 5 (new)
2
1
3
4
5
6
Currentpage table
(after updating pages
2,6)
Database data pages (blocks)
2
1
3
4
5
6
Shadowpage table
(notupdated)
Shadow Paging Technique
When a transaction
begins executing
– Once the operations(
write or update) are
completed the current
page table is copied into
a shadow page table.
– shadow page table is
then saved
– shadow page table is
never modified during
transaction execution.
– Current page may
changed during
transaction execution.
20
Shadow Paging Technique
• To recover from a failure
– the state of the database before
transaction execution is available
through the shadow page table
– free modified pages
– discard current page table
– that state is recovered by reinstating
the shadow page table to become
the current page table once more
• Committing a transaction
– discard previous shadow page
– free old page tables that it
references
• Garbage collection
page5(old)
page1
page4
page2(old)
page3
page6
page2(new)
page5(new)
2
1
3
4
5
6
Currentpagetable
(afterupdating pages
2,6)
Databasedata pages (blocks)
2
1
3
4
5
6
Shadowpagetable
(notupdated)
21
Shadow paging Technique
• Shadow paging is an alternative to log-based recovery; this
scheme is useful if transactions execute serially
• Idea: maintain two page tables during the lifetime of a
transaction –the current page table, and the shadow page
table.
• Store the shadow page table in nonvolatile storage, such that
state of the database prior to transaction execution may be
recovered.
• writes operations—new copy of page is created and current
page table entry modified to point to new disk page/block.
22
Shadow Paging Technique
Whenever any page is about to be written for the first time
– A copy of this page is made onto an unused page.
– The current page table is then made to point to the copy
– The update is performed on the copy
• If the shadow is stored in nonvolatile memory and a system
crash occurs, then the shadow page table is copied to the
current page table. This guarantees that the shadow page
table will point to the database pages corresponding to the
state of the database prior to any transaction that was active
at the time of the crash, making aborts automatic.
23
Shadow paging Technique
--
Advantages:
-No overhead of writing log records
-Recovery is faster
Disadvantages:
-Copying the entire page table is very expensive
24
Backup Facilities
• The facilities provided by DBMS is to produce a back-up
copy (or save) of the entire database.
• DBMS normally provides a COPY utility for backup
• The back-up facility should create a copy of related
database objects including the database indexes, source
libraries, and so on
Recovery Facilities
25
Backup Facilities
• It should be periodic. and produced a back-up copy at
least once per day.
• The copy should be stored in a secured location where it
is protected from loss or damage.
• The back-up copy is used to restore the database in the
event of hardware failure, catastrophic loss, or damage.
Recovery Facilities
26
Backup Facilities
• Some DBMSs provide back-up utilities for the DBA;
• And some systems assume the DBA will use the operating
system commands, export commands, or SELECT ... INTO
SQL commands to perform backups.
Recovery Facilities
27
Backup Facilities
• Performing the nightly backup for a particular database is
repetitive, creating a script that automates regular backups will
save time.
• In a large databases, regular full backups may be impractical,
because the time required to perform the backup may exceed
that available.
Recovery Facilities
28
Backup Facilities
• Cold backup–database is shut down during backup
• Hot backup–selected portion is shut down and backed up at a
given time
Recovery Facilities
29
Recovery Manager
• It is a module of the DBMS that restores the database to a
correct condition when a failure occurs and then resumes
processing user requests.
• The type of restart used depends on the nature of the failure.
Recovery Facilities
30
Recovery and Restart Procedures
• Disk Mirroring
• Restore/Rerun
• Maintaining Transaction Integrity
• Backward Recovery
• Forward Recovery
Recovery Facilities
31
Recovery and Restart Procedures
Disk Mirroring
• To be able to switch to an existing copy of
the database, the database must be mirrored.
• At least two copies of the database must be
kept and updated simultaneously. When a
media failure occurs, processing is switched to
the duplicate copy of the database.
• This technique allow the faster recovery.
Recovery Facilities
32
Recovery and Restart Procedures
Disk Mirroring
Recovery Facilities
33
Recovery and Restart Procedures
 Restore/Rerun
• It involves reprocessing the day's transactions (up
to the point of failure) against the back-up copy of
the database or portion of the database being
recovered.
• First, the database is shut down, and then the most
recent copy of the database or file to be recovered
(say, from the previous day).
Recovery Facilities
34
Recovery and Restart Procedures
 Restore/Rerun
• Advantages
• Simplicity
• No need to create a database change journal or log
file.
• Disadvantages
• New transaction can not performed until the
recovery is completed.
Recovery Facilities
35
Recovery and Restart Procedures
 Transaction Integrity
• A DBMS provides facility of transaction boundary
for maintaining transaction integrity.
• Transaction boundaries are logical beginning and
end of transactions.
• If the transaction are successful then they are
commits and if transaction fails at any point then
they are aborted.
Recovery Facilities
36
Recovery and Restart Procedures
 Backward Recovery
• It is a recovery technique in which unwanted
changes made to database are undo.
• Rollback: apply before images
• When certain transactions are abnormally
terminated then DBMS recover the database to an
earliest state by applying images records.
Recovery Facilities
37
Recovery and Restart Procedures
 Backward Recovery
Recovery Facilities
38
Recovery and Restart Procedures
 Forward Recovery
(Roll Forward)–apply after images
• Starts with an earlier copy of the database. After-
images (the results of good transactions) are
applied to the database, and the database is
quickly moved forward to a later state.
Recovery Facilities
39
Recovery and Restart Procedures
Forward Recovery
Recovery Facilities
40
41
References
• http://www.scribd.com/doc/52981523/Datab
ase-Recovery
• http://enggedu.com/tamilnadu/university_qu
estions/question_answer/be_nd_2007/5th_se
m/cse/CS1301/part_b/14_b_2.html
• http://www.scribd.com/doc/52981523/Datab
ase-Recover
42
Ad

More Related Content

What's hot (20)

11. operating-systems-part-2
11. operating-systems-part-211. operating-systems-part-2
11. operating-systems-part-2
Muhammad Ahad
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
Ali Broumandnia
 
Data center tier standards
Data center tier standardsData center tier standards
Data center tier standards
Colocation America
 
2.6 backup and recovery
2.6 backup and recovery2.6 backup and recovery
2.6 backup and recovery
mrmwood
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Ahmed El-Arabawy
 
Introduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed ComputingIntroduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed Computing
Sayed Chhattan Shah
 
08. networking-part-2
08. networking-part-208. networking-part-2
08. networking-part-2
Muhammad Ahad
 
Fundamentals of Servers, server storage and server security.
Fundamentals of Servers, server storage and server security.Fundamentals of Servers, server storage and server security.
Fundamentals of Servers, server storage and server security.
Aakash Panchal
 
09. storage-part-1
09. storage-part-109. storage-part-1
09. storage-part-1
Muhammad Ahad
 
Deadlock
DeadlockDeadlock
Deadlock
Sajan Sahu
 
03. non-functional-attributes-introduction-4-slides
03. non-functional-attributes-introduction-4-slides03. non-functional-attributes-introduction-4-slides
03. non-functional-attributes-introduction-4-slides
Muhammad Ahad
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
Gd Goenka University
 
Digital Forensics
Digital ForensicsDigital Forensics
Digital Forensics
Nicholas Davis
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
Wayne Jones Jnr
 
Backup
BackupBackup
Backup
AboubacarAhamadaRouf
 
Chapter10 Server Administration
Chapter10     Server  AdministrationChapter10     Server  Administration
Chapter10 Server Administration
Raja Waseem Akhtar
 
Database security
Database securityDatabase security
Database security
Murchana Borah
 
Windows File Systems
Windows File SystemsWindows File Systems
Windows File Systems
primeteacher32
 
Memory Forensics for IR - Leveraging Volatility to Hunt Advanced Actors
Memory Forensics for IR - Leveraging Volatility to Hunt Advanced ActorsMemory Forensics for IR - Leveraging Volatility to Hunt Advanced Actors
Memory Forensics for IR - Leveraging Volatility to Hunt Advanced Actors
Jared Greenhill
 
File system Os
File system OsFile system Os
File system Os
Nehal Naik
 
11. operating-systems-part-2
11. operating-systems-part-211. operating-systems-part-2
11. operating-systems-part-2
Muhammad Ahad
 
2.6 backup and recovery
2.6 backup and recovery2.6 backup and recovery
2.6 backup and recovery
mrmwood
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Ahmed El-Arabawy
 
Introduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed ComputingIntroduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed Computing
Sayed Chhattan Shah
 
08. networking-part-2
08. networking-part-208. networking-part-2
08. networking-part-2
Muhammad Ahad
 
Fundamentals of Servers, server storage and server security.
Fundamentals of Servers, server storage and server security.Fundamentals of Servers, server storage and server security.
Fundamentals of Servers, server storage and server security.
Aakash Panchal
 
03. non-functional-attributes-introduction-4-slides
03. non-functional-attributes-introduction-4-slides03. non-functional-attributes-introduction-4-slides
03. non-functional-attributes-introduction-4-slides
Muhammad Ahad
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
Wayne Jones Jnr
 
Chapter10 Server Administration
Chapter10     Server  AdministrationChapter10     Server  Administration
Chapter10 Server Administration
Raja Waseem Akhtar
 
Memory Forensics for IR - Leveraging Volatility to Hunt Advanced Actors
Memory Forensics for IR - Leveraging Volatility to Hunt Advanced ActorsMemory Forensics for IR - Leveraging Volatility to Hunt Advanced Actors
Memory Forensics for IR - Leveraging Volatility to Hunt Advanced Actors
Jared Greenhill
 
File system Os
File system OsFile system Os
File system Os
Nehal Naik
 

Viewers also liked (20)

Module5 utility software
Module5 utility softwareModule5 utility software
Module5 utility software
Shanmugam Thiagoo
 
Backup procedures
Backup proceduresBackup procedures
Backup procedures
INFOCHIEF institute
 
Utility software
Utility softwareUtility software
Utility software
Jimmy Edwards
 
Take Care of Your Computer Part 2 -- Backup, Clone Your System Disk Feb-16-2012
Take Care of Your Computer Part 2 -- Backup, Clone Your System Disk Feb-16-2012Take Care of Your Computer Part 2 -- Backup, Clone Your System Disk Feb-16-2012
Take Care of Your Computer Part 2 -- Backup, Clone Your System Disk Feb-16-2012
Ted Whittemore
 
iGCSE Theory Unit 3 - backing up data
iGCSE Theory Unit 3 - backing up dataiGCSE Theory Unit 3 - backing up data
iGCSE Theory Unit 3 - backing up data
jonspav
 
Estudio clínico de MOWOOT
Estudio clínico de MOWOOT Estudio clínico de MOWOOT
Estudio clínico de MOWOOT
usMIMA
 
Clinical research training - Dr Blanaid Mee - Dec 7th 2016
Clinical research training - Dr Blanaid Mee - Dec 7th 2016Clinical research training - Dr Blanaid Mee - Dec 7th 2016
Clinical research training - Dr Blanaid Mee - Dec 7th 2016
ipposi
 
how to sell
how to sellhow to sell
how to sell
dkhsurvey
 
BMGT 464 WEEK 1 ASSIGNMENT
BMGT 464 WEEK 1 ASSIGNMENTBMGT 464 WEEK 1 ASSIGNMENT
BMGT 464 WEEK 1 ASSIGNMENT
JanuMorandy
 
Revista 2º mco
Revista 2º mcoRevista 2º mco
Revista 2º mco
IES Polígono Sur
 
Institute Brochure of ePravesh
Institute Brochure of ePraveshInstitute Brochure of ePravesh
Institute Brochure of ePravesh
Samir Kamat
 
Utility software teaching
Utility software teaching Utility software teaching
Utility software teaching
mrmurphy3
 
Innovative clinical research_institute_in_pune
Innovative clinical research_institute_in_puneInnovative clinical research_institute_in_pune
Innovative clinical research_institute_in_pune
sushant deshmukh
 
Von Nathaniel Z. Getes
Von Nathaniel Z. GetesVon Nathaniel Z. Getes
Von Nathaniel Z. Getes
Von Nathaniel Getes
 
Clinical correlation hyperlipidemia
Clinical correlation  hyperlipidemiaClinical correlation  hyperlipidemia
Clinical correlation hyperlipidemia
Mario Sanchez
 
Utility Program
Utility ProgramUtility Program
Utility Program
Umar Daraz
 
La influencia de los estereotipos sobre los niños
La influencia de los estereotipos sobre los niñosLa influencia de los estereotipos sobre los niños
La influencia de los estereotipos sobre los niños
Alejandra Galdeano
 
La vida en Suecia
La vida en SueciaLa vida en Suecia
La vida en Suecia
Great Ayuda
 
COOP training-Bokhari
COOP training-BokhariCOOP training-Bokhari
COOP training-Bokhari
Assad Bokhari
 
Mediación Cultural. Enfermería.
Mediación Cultural. Enfermería.Mediación Cultural. Enfermería.
Mediación Cultural. Enfermería.
Brenda L. García Lebrón
 
Take Care of Your Computer Part 2 -- Backup, Clone Your System Disk Feb-16-2012
Take Care of Your Computer Part 2 -- Backup, Clone Your System Disk Feb-16-2012Take Care of Your Computer Part 2 -- Backup, Clone Your System Disk Feb-16-2012
Take Care of Your Computer Part 2 -- Backup, Clone Your System Disk Feb-16-2012
Ted Whittemore
 
iGCSE Theory Unit 3 - backing up data
iGCSE Theory Unit 3 - backing up dataiGCSE Theory Unit 3 - backing up data
iGCSE Theory Unit 3 - backing up data
jonspav
 
Estudio clínico de MOWOOT
Estudio clínico de MOWOOT Estudio clínico de MOWOOT
Estudio clínico de MOWOOT
usMIMA
 
Clinical research training - Dr Blanaid Mee - Dec 7th 2016
Clinical research training - Dr Blanaid Mee - Dec 7th 2016Clinical research training - Dr Blanaid Mee - Dec 7th 2016
Clinical research training - Dr Blanaid Mee - Dec 7th 2016
ipposi
 
BMGT 464 WEEK 1 ASSIGNMENT
BMGT 464 WEEK 1 ASSIGNMENTBMGT 464 WEEK 1 ASSIGNMENT
BMGT 464 WEEK 1 ASSIGNMENT
JanuMorandy
 
Institute Brochure of ePravesh
Institute Brochure of ePraveshInstitute Brochure of ePravesh
Institute Brochure of ePravesh
Samir Kamat
 
Utility software teaching
Utility software teaching Utility software teaching
Utility software teaching
mrmurphy3
 
Innovative clinical research_institute_in_pune
Innovative clinical research_institute_in_puneInnovative clinical research_institute_in_pune
Innovative clinical research_institute_in_pune
sushant deshmukh
 
Clinical correlation hyperlipidemia
Clinical correlation  hyperlipidemiaClinical correlation  hyperlipidemia
Clinical correlation hyperlipidemia
Mario Sanchez
 
Utility Program
Utility ProgramUtility Program
Utility Program
Umar Daraz
 
La influencia de los estereotipos sobre los niños
La influencia de los estereotipos sobre los niñosLa influencia de los estereotipos sobre los niños
La influencia de los estereotipos sobre los niños
Alejandra Galdeano
 
La vida en Suecia
La vida en SueciaLa vida en Suecia
La vida en Suecia
Great Ayuda
 
COOP training-Bokhari
COOP training-BokhariCOOP training-Bokhari
COOP training-Bokhari
Assad Bokhari
 
Ad

Similar to Backing Up and Recovery (20)

Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
pusp220
 
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...
Raj vardhan
 
DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdf
NithishReddy90
 
ch-5 advanced db.pdf
ch-5 advanced db.pdfch-5 advanced db.pdf
ch-5 advanced db.pdf
haymanot taddesse
 
Unit-V Recovery software wngineering should learn software
Unit-V Recovery software wngineering should learn softwareUnit-V Recovery software wngineering should learn software
Unit-V Recovery software wngineering should learn software
giriinduri
 
Recovery
RecoveryRecovery
Recovery
Ram Sekhar
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.ppt
AdemeCheklie
 
Advanced database chapter three PowerPoint
Advanced database chapter three PowerPointAdvanced database chapter three PowerPoint
Advanced database chapter three PowerPoint
afendimohammed288
 
Lec 4 Recovery in database management system.pptx
Lec 4 Recovery in database management system.pptxLec 4 Recovery in database management system.pptx
Lec 4 Recovery in database management system.pptx
hacker01gt
 
Chapter 3 - Recogfytru6y5tfvery Techniques.pptx
Chapter 3 - Recogfytru6y5tfvery Techniques.pptxChapter 3 - Recogfytru6y5tfvery Techniques.pptx
Chapter 3 - Recogfytru6y5tfvery Techniques.pptx
ahmed518927
 
gyuftfChapter 1- Recovery Techniques.pptx
gyuftfChapter 1- Recovery Techniques.pptxgyuftfChapter 1- Recovery Techniques.pptx
gyuftfChapter 1- Recovery Techniques.pptx
ahmed518927
 
fffffffChapter 1- Recovery Techniques.pptx
fffffffChapter 1- Recovery Techniques.pptxfffffffChapter 1- Recovery Techniques.pptx
fffffffChapter 1- Recovery Techniques.pptx
ahmed518927
 
recovery system
recovery systemrecovery system
recovery system
shreeuva
 
DBMS UNIT 5 CHAPTER 3.ppt
DBMS UNIT 5 CHAPTER 3.pptDBMS UNIT 5 CHAPTER 3.ppt
DBMS UNIT 5 CHAPTER 3.ppt
HemakanisiriA3124
 
4 db recovery
4 db recovery4 db recovery
4 db recovery
ashish61_scs
 
Chapter 7. Database Recovery Techniques.pdf
Chapter 7. Database Recovery Techniques.pdfChapter 7. Database Recovery Techniques.pdf
Chapter 7. Database Recovery Techniques.pdf
SwarnimBajra
 
DBMS CIIT Ch8.pptasddddddddddddddddddddd
DBMS CIIT Ch8.pptasdddddddddddddddddddddDBMS CIIT Ch8.pptasddddddddddddddddddddd
DBMS CIIT Ch8.pptasddddddddddddddddddddd
Bishnuramghimire1
 
DBMS CIIT Ch8.pptasddddddddddddddddddddd
DBMS CIIT Ch8.pptasdddddddddddddddddddddDBMS CIIT Ch8.pptasddddddddddddddddddddd
DBMS CIIT Ch8.pptasddddddddddddddddddddd
Bishnuramghimire1
 
DBMS Unit-5.5. Recovery System.pptx it is PPT
DBMS Unit-5.5. Recovery System.pptx it is PPTDBMS Unit-5.5. Recovery System.pptx it is PPT
DBMS Unit-5.5. Recovery System.pptx it is PPT
hpoluju
 
Metropolis GIS System for Rishikesh City
Metropolis GIS System for Rishikesh CityMetropolis GIS System for Rishikesh City
Metropolis GIS System for Rishikesh City
rastogisatvik123
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
pusp220
 
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...
Raj vardhan
 
Unit-V Recovery software wngineering should learn software
Unit-V Recovery software wngineering should learn softwareUnit-V Recovery software wngineering should learn software
Unit-V Recovery software wngineering should learn software
giriinduri
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.ppt
AdemeCheklie
 
Advanced database chapter three PowerPoint
Advanced database chapter three PowerPointAdvanced database chapter three PowerPoint
Advanced database chapter three PowerPoint
afendimohammed288
 
Lec 4 Recovery in database management system.pptx
Lec 4 Recovery in database management system.pptxLec 4 Recovery in database management system.pptx
Lec 4 Recovery in database management system.pptx
hacker01gt
 
Chapter 3 - Recogfytru6y5tfvery Techniques.pptx
Chapter 3 - Recogfytru6y5tfvery Techniques.pptxChapter 3 - Recogfytru6y5tfvery Techniques.pptx
Chapter 3 - Recogfytru6y5tfvery Techniques.pptx
ahmed518927
 
gyuftfChapter 1- Recovery Techniques.pptx
gyuftfChapter 1- Recovery Techniques.pptxgyuftfChapter 1- Recovery Techniques.pptx
gyuftfChapter 1- Recovery Techniques.pptx
ahmed518927
 
fffffffChapter 1- Recovery Techniques.pptx
fffffffChapter 1- Recovery Techniques.pptxfffffffChapter 1- Recovery Techniques.pptx
fffffffChapter 1- Recovery Techniques.pptx
ahmed518927
 
recovery system
recovery systemrecovery system
recovery system
shreeuva
 
Chapter 7. Database Recovery Techniques.pdf
Chapter 7. Database Recovery Techniques.pdfChapter 7. Database Recovery Techniques.pdf
Chapter 7. Database Recovery Techniques.pdf
SwarnimBajra
 
DBMS CIIT Ch8.pptasddddddddddddddddddddd
DBMS CIIT Ch8.pptasdddddddddddddddddddddDBMS CIIT Ch8.pptasddddddddddddddddddddd
DBMS CIIT Ch8.pptasddddddddddddddddddddd
Bishnuramghimire1
 
DBMS CIIT Ch8.pptasddddddddddddddddddddd
DBMS CIIT Ch8.pptasdddddddddddddddddddddDBMS CIIT Ch8.pptasddddddddddddddddddddd
DBMS CIIT Ch8.pptasddddddddddddddddddddd
Bishnuramghimire1
 
DBMS Unit-5.5. Recovery System.pptx it is PPT
DBMS Unit-5.5. Recovery System.pptx it is PPTDBMS Unit-5.5. Recovery System.pptx it is PPT
DBMS Unit-5.5. Recovery System.pptx it is PPT
hpoluju
 
Metropolis GIS System for Rishikesh City
Metropolis GIS System for Rishikesh CityMetropolis GIS System for Rishikesh City
Metropolis GIS System for Rishikesh City
rastogisatvik123
 
Ad

Recently uploaded (20)

How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 

Backing Up and Recovery

  • 1. Presentation Topic: Backing Up and Recovery Procedure 1
  • 2. Contents • Backup and Recovery • Checkpoints • Action performed during checkpoints • Log -Record Buffering • Write -Ahead Log Protocol • Shadow Paging Technique • Recovery Facilities • Recovery and Restart Procedures 2
  • 3. 3
  • 5. Backup and Recovery Backup and recovery is brought to mind whenever there is potential outside threats to a database. Backup management refers to the data safety. 5
  • 6. Checkpoints • To recover the database after some failure we must consult the log record to determine which transaction needs to be undone and redone. For this we need to search the entire log to determine this information. There are two major problems with this approach. 1. The search process is time-consuming. 2. Most of the transactions need to redone have already written their updates into the database. 6
  • 7. Checkpoints • Although redoing them will cause no harm, but it will make recovery process more time consuming. • To reduce these types of overhead, we introduce Check points. The system periodically performs Checkpoints. • The log file may grow too big to be handled at all. • Checkpoint is a mechanism where all the previous logs are removed from the system and stored permanently in a storage disk. 7
  • 8. Actions Performed During Checkpoints • Output onto stable storage all log records currently residing in main memory. • Output on the disk all modified buffer blocks. • The presence of a <checkpoint> record makes recovery process more streamline. • Consider a transaction Ti that committed prior to the Checkpoint, means that <Ti, Commit> must appear in the log before the<checkpoint> record. • Any database modifications made by Ti must have been written to the database either prior to the checkpoint or as part of checkpoint itself. 8
  • 9. Actions Performed During Checkpoints • Thus, at recovery time, there is no need to perform a redo operation on Ti. • The checkpoint record gives a list of all transactions that were in progress at the time the checkpoint was taken. Thus, the checkpoints help the system to provide information at restart time which transaction to undo and which to redo. 9
  • 10. 10
  • 11. Example (contd..) • A system failure has occurred at time tf • The most recent checkpoint prior to time tf was taken at time tc • Transactions of type T1 completed (successfully) prior to time tc • Transactions of type T2 started prior to time tc and completed(successfully) after time tc and before time tf • Transactions of type T3 also started prior to time tc but did not complete by time tf • Transactions of type T4 started after time tc and completed(successfully) before time tf. • Finally, transactions of type T5 also started after time tc, but did not complete by time tf 11
  • 12. Example (contd..) • It should be clear that, in case of immediate modification technique those transactions that have <Ti, start> and <Ti, commit> must be redo and those transactions that have only <Ti, start> and no <Ti, commit> must be undo. • Thus, when the system is restarted in case of immediate database modification, transactions of types T3 and T5 must be undone, and transactions of types T2 and T4 must be redone. Note, however that transactions of type T1 do not enter in the restart process at all, because their updates were forced to the database at time tc as part of the checkpoint process. 12
  • 13. Log-Record Buffering • As, we assumed earlier that every log record is output to stable storage at the time it is created. This assumption imposes a high overhead on system execution for the following reasons: • Output to stable storage is performed in units of blocks. In most cases, a log record is much smaller than a block. Thus, the output of each log record translates to a much larger output at the physical level. 13
  • 14. Log-Record Buffering • To do so, we write log records to a log buffer in main memory, where they stay temporarily until they are output to stable storage. • Multiple log records can be gathered in the log buffer and output to stable storage in a single output operation. The order of log records in the stable storage must be exactly the same as the order in which they execute. • The cost of performing the output of a block to storage is sufficiently high that it is desirable to output multiple log records at once. 14
  • 15. Log-Record Buffering • Due to the use of log buffering a log record may reside in only main memory (volatile storage) for a considerable time before it is output to stable storage. Since such log records are lost if the system crashes, we must impose additional requirements on the recovery techniques to ensure transaction atomicity. • Transaction Ti enters the commit state after the <Ti commit> log record has been output to stable storage. 15
  • 16. Log-Record Buffering • Before the <Ti commit> log record can be output to stable storage, all log records pertaining to transaction Ti must have been output to stable storage. • Before a block of data in main memory can be output to the database (in nonvolatile storage), all log records pertaining to data in that block must have been output to stable storage. The latter rule is called the write-ahead logging (WAL) rule. 16
  • 17. Write-Ahead Log Protocol • Before writing a transaction to disk, every update log record that describes a change to this page must be forced to stable storage. • This is accomplished by forcing all log records to stable storage before writing the transaction to disk. • WAL is the fundamental rule that ensures that a record of every change to the database is available while attempting to recover from a crash. 17
  • 18. Write-Ahead Log Protocol • In computer science, write-ahead logging (WAL) is a family of techniques for providing atomicity and durability (two of the ACID properties) in database systems. Usually both redo and undo information is stored in the log. • Note that the definition of a committed transaction is effectively “a transaction whose log records, including a commit record, have all been written to stable storage”. 18
  • 19. page 3 page 2 page 4 page 1 page 5 page 6 Recovery: Shadow Paging Technique • The database is considered to be made up of a number of n fixed- size disk blocks or pages, for recovery purposes. • Current page table points to most recent current database pages on disk. • When transaction starts both page tables are identical for that transaction. 2 1 3 4 5 6 Shadow page table Current Page table 19
  • 20. page 5 (old) page 1 page 4 page 2 (old) page 3 page 6 page 2 (new) page 5 (new) 2 1 3 4 5 6 Currentpage table (after updating pages 2,6) Database data pages (blocks) 2 1 3 4 5 6 Shadowpage table (notupdated) Shadow Paging Technique When a transaction begins executing – Once the operations( write or update) are completed the current page table is copied into a shadow page table. – shadow page table is then saved – shadow page table is never modified during transaction execution. – Current page may changed during transaction execution. 20
  • 21. Shadow Paging Technique • To recover from a failure – the state of the database before transaction execution is available through the shadow page table – free modified pages – discard current page table – that state is recovered by reinstating the shadow page table to become the current page table once more • Committing a transaction – discard previous shadow page – free old page tables that it references • Garbage collection page5(old) page1 page4 page2(old) page3 page6 page2(new) page5(new) 2 1 3 4 5 6 Currentpagetable (afterupdating pages 2,6) Databasedata pages (blocks) 2 1 3 4 5 6 Shadowpagetable (notupdated) 21
  • 22. Shadow paging Technique • Shadow paging is an alternative to log-based recovery; this scheme is useful if transactions execute serially • Idea: maintain two page tables during the lifetime of a transaction –the current page table, and the shadow page table. • Store the shadow page table in nonvolatile storage, such that state of the database prior to transaction execution may be recovered. • writes operations—new copy of page is created and current page table entry modified to point to new disk page/block. 22
  • 23. Shadow Paging Technique Whenever any page is about to be written for the first time – A copy of this page is made onto an unused page. – The current page table is then made to point to the copy – The update is performed on the copy • If the shadow is stored in nonvolatile memory and a system crash occurs, then the shadow page table is copied to the current page table. This guarantees that the shadow page table will point to the database pages corresponding to the state of the database prior to any transaction that was active at the time of the crash, making aborts automatic. 23
  • 24. Shadow paging Technique -- Advantages: -No overhead of writing log records -Recovery is faster Disadvantages: -Copying the entire page table is very expensive 24
  • 25. Backup Facilities • The facilities provided by DBMS is to produce a back-up copy (or save) of the entire database. • DBMS normally provides a COPY utility for backup • The back-up facility should create a copy of related database objects including the database indexes, source libraries, and so on Recovery Facilities 25
  • 26. Backup Facilities • It should be periodic. and produced a back-up copy at least once per day. • The copy should be stored in a secured location where it is protected from loss or damage. • The back-up copy is used to restore the database in the event of hardware failure, catastrophic loss, or damage. Recovery Facilities 26
  • 27. Backup Facilities • Some DBMSs provide back-up utilities for the DBA; • And some systems assume the DBA will use the operating system commands, export commands, or SELECT ... INTO SQL commands to perform backups. Recovery Facilities 27
  • 28. Backup Facilities • Performing the nightly backup for a particular database is repetitive, creating a script that automates regular backups will save time. • In a large databases, regular full backups may be impractical, because the time required to perform the backup may exceed that available. Recovery Facilities 28
  • 29. Backup Facilities • Cold backup–database is shut down during backup • Hot backup–selected portion is shut down and backed up at a given time Recovery Facilities 29
  • 30. Recovery Manager • It is a module of the DBMS that restores the database to a correct condition when a failure occurs and then resumes processing user requests. • The type of restart used depends on the nature of the failure. Recovery Facilities 30
  • 31. Recovery and Restart Procedures • Disk Mirroring • Restore/Rerun • Maintaining Transaction Integrity • Backward Recovery • Forward Recovery Recovery Facilities 31
  • 32. Recovery and Restart Procedures Disk Mirroring • To be able to switch to an existing copy of the database, the database must be mirrored. • At least two copies of the database must be kept and updated simultaneously. When a media failure occurs, processing is switched to the duplicate copy of the database. • This technique allow the faster recovery. Recovery Facilities 32
  • 33. Recovery and Restart Procedures Disk Mirroring Recovery Facilities 33
  • 34. Recovery and Restart Procedures  Restore/Rerun • It involves reprocessing the day's transactions (up to the point of failure) against the back-up copy of the database or portion of the database being recovered. • First, the database is shut down, and then the most recent copy of the database or file to be recovered (say, from the previous day). Recovery Facilities 34
  • 35. Recovery and Restart Procedures  Restore/Rerun • Advantages • Simplicity • No need to create a database change journal or log file. • Disadvantages • New transaction can not performed until the recovery is completed. Recovery Facilities 35
  • 36. Recovery and Restart Procedures  Transaction Integrity • A DBMS provides facility of transaction boundary for maintaining transaction integrity. • Transaction boundaries are logical beginning and end of transactions. • If the transaction are successful then they are commits and if transaction fails at any point then they are aborted. Recovery Facilities 36
  • 37. Recovery and Restart Procedures  Backward Recovery • It is a recovery technique in which unwanted changes made to database are undo. • Rollback: apply before images • When certain transactions are abnormally terminated then DBMS recover the database to an earliest state by applying images records. Recovery Facilities 37
  • 38. Recovery and Restart Procedures  Backward Recovery Recovery Facilities 38
  • 39. Recovery and Restart Procedures  Forward Recovery (Roll Forward)–apply after images • Starts with an earlier copy of the database. After- images (the results of good transactions) are applied to the database, and the database is quickly moved forward to a later state. Recovery Facilities 39
  • 40. Recovery and Restart Procedures Forward Recovery Recovery Facilities 40
  • 41. 41