1) Database recovery techniques are used to restore a database to its last consistent state after a failure. The transaction log records before images (BFIM) and after images (AFIM) of data modifications and is used for recovery.
2) There are different types of failures that can occur including transaction failures, system failures, and media failures. The transaction log allows recovery from any type of failure.
3) Database recovery techniques include undo/redo logging, deferred update, shadow paging, and checkpointing to minimize recovery work. Write-ahead logging ensures log is safely written before data updates to allow for undo or redo as needed.
What is Database Backup? The 3 Important Recovery Techniques from transaction...Raj vardhan
What is Database Backup?
What is Database recovery techniques
Why recovery is needed? (What causes a Transaction to fail?)
The 3 Important Recovery Techniques from transaction failures:
The figure below illustrates the use of Shadow paging techniques:
This presentation discusses the following topics:
What is Recovery ?
Database Recovery techniques
System log
Working of Commit and Roll back
Recovery techniques
Backup techniques
What is Database Backup? The 3 Important Recovery Techniques from transaction...Raj vardhan
What is Database Backup?
What is Database recovery techniques
Why recovery is needed? (What causes a Transaction to fail?)
The 3 Important Recovery Techniques from transaction failures:
The figure below illustrates the use of Shadow paging techniques:
This presentation discusses the following topics:
What is Recovery ?
Database Recovery techniques
System log
Working of Commit and Roll back
Recovery techniques
Backup techniques
Adbms 34 transaction processing and recoveryVaibhav Khanna
A transaction is an atomic unit of work that is either completed in its entirety or not done at all.
– For recovery purposes, the system needs to keep track of when the transaction starts, terminates, and commits or aborts.
Transaction states:
– Active state
– Partially committed state
– Committed state
– Failed state
– Terminated State
Introduction to transaction processing concepts and theoryZainab Almugbel
Modified version of Chapter 21 of the book Fundamentals_of_Database_Systems,_6th_Edition with review questions
as part of database management system course
Adbms 34 transaction processing and recoveryVaibhav Khanna
A transaction is an atomic unit of work that is either completed in its entirety or not done at all.
– For recovery purposes, the system needs to keep track of when the transaction starts, terminates, and commits or aborts.
Transaction states:
– Active state
– Partially committed state
– Committed state
– Failed state
– Terminated State
Introduction to transaction processing concepts and theoryZainab Almugbel
Modified version of Chapter 21 of the book Fundamentals_of_Database_Systems,_6th_Edition with review questions
as part of database management system course
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
2. Database Recovery
1 Purpose of Database Recovery
• To bring the database into the last consistent
state, which existed prior to the failure.
• To preserve consistency and durability
property of transactions.
Example: If the system crashes before a
fund transfer transaction completes its
execution, then either one or both accounts
may have incorrect value.
Thus, the database must be restored to the
state before the transaction modified any of
the accounts.
2
3. Cont…
2 Types of Failure
The database may become unavailable
for use due to
• Transaction failure: Transactions may
fail because of incorrect input,
deadlock, incorrect synchronization.
• System failure: System may fail
because of addressing error, application
error, operating system fault, RAM
failure, etc.
• Media failure: Disk head crash, power
disruption, etc.
3
4. Cont…
3 Transaction Log
For recovery from any type of failure, data
values prior to modification (BFIM -
BeFore Image) and the new value after
modification (AFIM – AFter Image) are
required.
These values and other information is
stored in a sequential file called
Transaction log.
Sample log entry
4
Back P Next P Operation Data item BFIM AFIM
0 1
1 4
0 8
2 5
4 7
0 9
5 nil
Begin
Write
W
R
R
End
Begin
X
Y
M
N
X = 200
Y = 100
M = 200
N = 400
X = 100
Y = 50
M = 200
N = 400
T ID Back P Next P Operation Data item BFIM
T1 0 1
T1 1 4
T2 0 8
T1 2 5
T1 4 7
T3 0 9
T1 5 nil
Begin
Write
W
R
R
End
Begin
X
Y
M
N
X = 100
Y = 50
M = 20
N = 400
5. Cont…
4 Data Update
◦ Immediate Update: As soon as a data item is modified
in cache, the disk copy is updated.
◦ Deferred Update: All modified data items in the cache
is written either after a transaction ends its execution or
after a fixed number of transactions have completed
their execution.
◦ Shadow update: The modified version of a data item
does not overwrite its disk copy but is written at a
separate disk location.
◦ In-place update: The disk version of the data item is
overwritten by the cache version.
6. Cont…
5. Caching of disk blocks
The flushing is controlled by dirty and Pin-
Unpin bits associated with each buffer in the
cache
The dirty bits are used to indicate whether or
not the buffer has been modified (1=modified,
0=not modified)
As soon as the buffer is modified, the dirty bits
for the corresponding cache directory entry are
set to 1
When the buffer contents are replaced from
cache, the contents must first be written back to
the corresponding disk page (only if its dirty bit
is 1)
A page in the cache is pinned (bit value 1) if it
can not be written back to disk
6
7. Cont…
• Two main strategies can be employed
when flushing a modified buffer back to
disk
• In-place update:
• Writes the buffer back to the same original disk
location
• The disk version (old value) of any changed data
item is overwritten by the cache version (new value).
• Shadow update: The modified version of a
data item does not overwrite its disk copy but
is written at a separate disk location.
7
8. Cont…
Write-Ahead Logging
•When in-place update is used, then log is
necessary for recovery and it must be available to
recovery manager.
•This is achieved by Write-Ahead Logging (WAL)
protocol.
•WAL states that :
• For Undo: Before a data item’s AFIM is flushed to
the database disk (overwriting the BFIM), its BFIM
must be written to the log and the log must be saved
on a stable store (log disk).
• For Redo: Before a transaction executes its commit
operation, all its AFIMs must be written to the log
and the log must be saved on a stable store.
8
9. Steal/No-Steal and Force/No-Force
Standard DBMS recovery includes the above terminologies for
specifying when a page from the DB can be written to disk
from the cache
◦ Possible ways for flushing database cache to database
disk:
1.Steal: Cache can be flushed before transaction commits.
When a DBMS buffer manager needs a buffer frame for another
transaction
2.No-Steal: Cache cannot be flushed before transaction
commit.
3.Force: Cache is immediately flushed (forced) to disk
when the transaction commits .
4.No-Force: Cache is deferred until transaction commits
◦ These give rise to four different ways for handling recovery:
Steal/No-Force
Steal/Force
No-Steal/No-Force
No-Steal/Force
9
10. Database Recovery (cont…)
6. Checkpointing
Another type of entry in the log is a checkpoint
A check point record is written into the log periodically at the
point when the system flush all DBMS buffers that haven
been modified
Used to minimize the task of recovery
The recovery manager of a DBMS must decide at what
interval to take a checkpoint
The following steps defines a checkpoint operation:
1. Suspend execution of transactions temporarily.
2. Enforce writing of modified buffer data to disk.
3. Write a [checkpoint] record to the log, save the log to
disk.
4. Resume normal transaction execution.
During recovery, redo or undo is required to transactions
appearing after [checkpoint] record.
10
11. Cont…
6 Transaction Roll-back (Undo)
When a transaction fails for what ever
reason after updating the database, it may
be necessary to rollback the transaction
If any data item values have been
changed by the transaction and written to
the database, they must be restored to
their previous values
The undo type log entries are used to
restore the old values of data items that
must be rolled back
11
12. Database Recovery (cont…)
Roll-back
We can see the process of roll-back with the help
of the following three transactions T1, and T2 and
T3.
12
T1 T2 T3
read_item (A) read_item (B) read_item (C)
read_item (D) write_item (B) write_item (B)
write_item (D) read_item (D) read_item (A)
write_item (A) write_item (A)
13. Database Recovery (cont…)
Roll-back: Execution of T1, T2 and T3 as recorded in the log.
A B C D
30 15 40 20
13
[start_transaction, T3]
[read_item, T3, C]
* [write_item, T3, B, 15, 12] 12
[start_transaction,T2]
[read_item, T2, B]
**[write_item, T2, B, 12, 18] 18
[start_transaction,T1]
[read_item, T1, A]
[read_item, T1, D]
[write_item, T1, D, 20, 25] 25
[read_item, T2, D]
**[write_item, T2, D, 25, 26] 26
[read_item, T3, A]
---- system crash ----
* T3 is rolled back because it did not reach its commit point.
** T2 is rolled back because it reads the value of item B written by T3.
14. Database Recovery (cont…)
Deferred Update (No Undo/Redo)
• We can state a typical deferred update
protocol as follows:
• A transaction can not change the database
on disk until it reaches its commit point
• A transaction does not reach its commit
point until all of its update operations are
recorded into the log and the log is written
to disk
14
8 Recovery Scheme
15. Database Recovery (cont…)
1. A set of transactions record their updates in
the log.
2. At commit point under WAL scheme, these
updates are saved on database disk.
• After reboot from a failure the log is used to
redo all the transactions affected by this
failure.
• No undo is required because no AFIM is
flushed to the disk before a transaction
commits.
15
Recovery using Deferred Update
•The data update goes as follows:
16. Database Recovery (cont…)
T1
T3
T4
T5
system crash
Time
T2
t1 t2
checkpoint
16
•Multiuser environment requires some concurrency control
mechanism to guarantee isolation property of transactions.
•In a system recovery, transactions which were recorded in
the log after the last checkpoint were redone.
•The recovery manager may scan some of the transactions
recorded before the checkpoint to get the AFIMs.
Recovery in a concurrent users environment.
17. 17
Recovery using deferred Update
(b) [start_transaction, T1]
[write_item, T1, D, 20]
[commit, T1]
[checkpoint]
[start_transaction, T4]
[write_item, T4, B, 15]
[write_item, T4, A, 20]
[commit, T4]
[start_transaction T2]
[write_item, T2, B, 12]
[start_transaction, T3]
[write_item, T3, A, 30]
[write_item, T2, D, 25] system crash
• T2 and T3 are ignored because they did not reach their commit points
• T4 is redone because its commit point is after the last checkpoint.
(a) T1 T2 T3 T4
read_item (A) read_item (B) read_item (A) read_item (B)
read_item (D) write_item (B) write_item (A) write_item (B)
write_item (D) read_item (D) read_item (C) read_item (A)
write_item (D) write_item (C) write_item (A)
18. Database Recovery (cont…)
18
Recovery Techniques Based on Immediate
Update
•In this algorithm, AFIMs of a transaction are flushed to the
database disk before it commits.
•For this reason, the recovery manager undoes all
transactions during recovery.
•No transaction is redone.
Undo/No-redo Algorithm
19. Database Recovery (cont…)
19
Recovery Techniques Based on Immediate Update
•Recovery schemes of this category apply undo and also redo for recovery.
•In a single-user environment no concurrency control is required
•Note that at any time there will be one transaction in the system and it will
be either in the commit table or in the active table.
•Commit table records transactions to be committed and active
table records active transactions. To minimize the work of the
recovery manager checkpointing is used
•The recovery manager performs:
• Undo of a transaction if it is in the active table
• Redo of a transaction if it is in the commit table.
Undo/Redo Algorithm
20. Database Recovery (cont…)
X Y
Database
X' Y'
20
Shadow Paging
•The AFIM does not overwrite its BFIM but recorded at another place on
the disk.
•Thus, at any time a data item has AFIM and BFIM (Shadow copy of the
data item) at two different places on the disk.
•This recovery scheme does not require the use of a log in a
single user environment
•Multiuser environment may need the log for concurrency
control
X and Y: Shadow copies of data items (old)
X` and Y`: Current copies of data items (new)
21. Database Recovery (cont…)
Page 5 (old)
Page 1
Page 4
Page 2 (old)
Page 3
Page 6
Page 2 (new)
Page 5 (new)
1
2
3
4
5
6
Current Directory
(after updating pages 2, 5)
Shadow Directory
(not updated)
1
2
3
4
5
6
21
Shadow Paging …
•To manage access of data items by concurrent transactions, two
directories (current and shadow) are used.
• The directory arrangement is illustrated below. Here a page is a data
item.
•Example :