Definition :
Recovery techniques are methods used in an Advanced
Database Management System (ADBMS) to restore the
database after a failure such as:
System crash
Power failure
Hardware failure
Software error
Transaction failure
The main purpose of recovery is to maintain:
Data consistency
Data integrity
Reliability of database
Recovery Techniques
1.Log-Based Recovery (WAL - Write-Ahead Logging)
The most common method, which maintains a log file for every
transaction action. Before a data update occurs, a log record is
written to stable storage, ensuring that the system can undo
changes from uncommitted transactions or redo changes from
committed ones.
,2.Checkpointing
To prevent re-scanning the entire log, the DBMS periodically
performs a checkpoint, forcing all modified buffers (dirty pages)
from memory to stable storage and writing a special record to
the log. Recovery only needs to process logs after the last
checkpoint. Advantages :
Faster recovery
Reduces recovery time
3.Shadow Paging
Maintains two page tables—a current table for active updates
and a shadow table representing the consistent state. On commit,
the shadow table is updated; on failure, the system discards the
current page table and reverts to the shadow.
Advantages
Fast recovery
No log required
Disadvantages
Extra memory required
4.Backup and Recovery
Regular database backups allow restoration to a previous
consistent state followed by applying log files to reach the exact
state at the time of failure.
,Types
Full backup
Incremental backup
Differential backup
If database fails:
Restore latest backup
Importance of Recovery Techniques
Protect data
Maintain ACID properties
Improve reliability
Prevent data loss
Key Recovery Approaches
1. Deferred Update (No-Undo/Redo)
2. Immediate Update (Undo/Redo)
3. ARIES Algorithm (Algorithms for Recovery and Isolation
Exploiting Semantics)
, Query Processing and Optimization in ADBMS
Query processing and optimization are the mechanisms used by
a Database Management System (DBMS) to translate a high-
level user query (like SQL) into an efficient sequence of low-
level operations to retrieve data. The primary goal is to
minimize resource usage—such as disk I/O, CPU time, and
memory—while providing results in the shortest timeframe
1qpossible.
Steps of Query Processing
1. Parsing and Translation
Syntax Check: The DBMS verifies that the query follows
correct SQL grammar.
Semantic Check: It ensures that all referenced tables and
columns actually exist and that the user has proper
permissions.
Relational Algebra Conversion: The high-level query is
translated into an internal representation using Relational
Algebra, which serves as a roadmap for data retrieval.
Example ….
SELECT name FROM Student WHERE marks > 80;