0% found this document useful (0 votes)
4 views12 pages

Presentation 1

A transaction in a DBMS is a sequence of operations treated as a single unit of work, while transaction failure occurs when a transaction cannot complete successfully. Recovery methods include Undo Recovery, Redo Recovery, Undo-Redo Recovery, Checkpoint-Based Recovery, Shadow Paging, and the ARIES algorithm, each designed to restore database consistency after failures. These recovery techniques ensure that uncommitted changes are reversed and committed changes are retained, maintaining the integrity of the database.

Uploaded by

Alstar gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views12 pages

Presentation 1

A transaction in a DBMS is a sequence of operations treated as a single unit of work, while transaction failure occurs when a transaction cannot complete successfully. Recovery methods include Undo Recovery, Redo Recovery, Undo-Redo Recovery, Checkpoint-Based Recovery, Shadow Paging, and the ARIES algorithm, each designed to restore database consistency after failures. These recovery techniques ensure that uncommitted changes are reversed and committed changes are retained, maintaining the integrity of the database.

Uploaded by

Alstar gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

DBMS CONTENT

Transacti DBMS
on
What is transaction?

What is transaction failure?

What are the methods to


recover
Transaction failure?(types of
transaction recovery)
Definition Transacti
on
A transaction is a sequence
of one or more database
operations that are treated
as a single logical unit of
work.
Failure
Transacti
on
Transition failure in a
DBMS occurs when a
transaction cannot
successfully complete its
execution, causing the
database to fail to transition
from one consistent state to
another.
recovery Transacti
on
In a Database Management
System (DBMS),
transaction recovery
involves restoring the
database to a consistent state
after a failure. Recovery
ensures that incomplete
transactions do not corrupt
the database and that
committed changes are
retained.
TYPES:
1. Undo Recovery
recovery
•Purpose: Reverse the effects
of uncommitted (incomplete)
transactions to maintain
consistency.
•How it works:
• Identify all transactions
that were in progress
during the failure.
• Undo their changes using
logs (specifically before
images in the transaction
log).
•Example: A transaction
deducted money from an
account but didn’t complete.
recovery 2. Redo Recovery
•Purpose: Reapply committed
transactions to ensure their
effects are retained.
•How it works:
• Identify transactions
marked as committed in
the log but whose changes
are not yet written to the
database.
• Use logs (specifically after
images) to reapply
changes.
•Example: A transaction adding
money to an account was
committed, but the database
didn’t reflect it due to a crash.
3. Undo-Redo Recovery
•Purpose: Combine both undo and
redo operations when some
recovery
transactions are committed, and
others are incomplete.
•How it works:
• Undo changes of all incomplete
transactions (using before
images).
• Redo changes of all committed
transactions (using after
images).
•Example:
• Transaction T1 is committed:
Redo its changes.
• Transaction T2 is incomplete:
Undo its changes.
recovery 4. Checkpoint-Based
Recovery
•Purpose: Optimize recovery by
using periodic checkpoints that
save the current state of the
database and logs.
•How it works:
• During recovery, only
consider logs generated
after the last checkpoint.
• Reduce the recovery
workload by skipping
transactions already
reflected in the database.
•Example:
• A checkpoint is created at 2
PM.
5. Shadow Paging
•Purpose: Use a copy of the database pages
(shadow pages) for recovery, avoiding the
recovery
need for logs.
•How it works:
• Maintain a shadow copy of the
database.
• Write changes to a new page; commit
the transaction by replacing the old
shadow page with the new one.
• On failure, revert to the shadow pages,
which remain unchanged.
•Example:
• Changes are written to new locations
during a transaction.
• If a crash occurs, the shadow copy is
used as the database's consistent
state.
recovery
6. ARIES (Algorithm for Recovery
and Isolation Exploiting
Semantics)
•Purpose: A robust recovery technique
used in modern DBMSs like IBM DB2.
•How it works:
• Uses a combination of undo,
redo, and checkpointing.
• Maintains fine-grained logs for
efficient recovery.
• Processes recovery in three
phases:
• Analysis: Identifies
transactions active at the time
of failure.
• Redo: Reapplies all changes
from the log starting at the
last checkpoint.
• Undo: Rolls back
uncommitted transactions.
PROJECT

By : Anjal Luitel
Roll:11
Class:10
2081-08-17

You might also like