
- DBMS Tutorial
- DBMS - Home
- DBMS - Overview
- DBMS - Architecture
- DBMS - Data Models
- DBMS - Data Schemas
- DBMS - Data Independence
- Entity Relationship Model
- DBMS - ER Model Basic Concepts
- DBMS - ER Diagram Representation
- DBMS - Generalization, Aggregation
- Relational Model
- DBMS - Codd's Rules
- DBMS - Relational Data Model
- DBMS - Relational Algebra
- DBMS - ER to Relational Model
- DBMS- SQL Overview
- Relational Database Design
- DBMS - Database Normalization
- DBMS - Database Joins
- Storage and File Structure
- DBMS - Storage System
- DBMS - File Structure
- Indexing and Hashing
- DBMS - Indexing
- DBMS - Hashing
- Transaction And Concurrency
- DBMS - Transaction
- DBMS - Concurrency Control
- DBMS - Deadlock
- Backup and Recovery
- DBMS - Data Backup
- DBMS - Data Recovery
- DBMS Useful Resources
- DBMS - Quick Guide
- DBMS - Useful Resources
- DBMS - Discussion
What is shadow paging in DBMS?
Shadow paging is one of the techniques that is used to recover from failure. We all know that recovery means to get back the information, which is lost. It helps to maintain database consistency in case of failure.
Concept of shadow paging
Now let see the concept of shadow paging step by step −
Step 1 − Page is a segment of memory. Page table is an index of pages. Each table entry points to a page on the disk.
Step 2 − Two page tables are used during the life of a transaction: the current page table and the shadow page table. Shadow page table is a copy of the current page table.
Step 3 − When a transaction starts, both the tables look identical, the current table is updated for each write operation.
Step 4 − The shadow page is never changed during the life of the transaction.
Step 5 − When the current transaction is committed, the shadow page entry becomes a copy of the current page table entry and the disk block with the old data is released.
Step 6 − The shadow page table is stored in non-volatile memory. If the system crash occurs, then the shadow page table is copied to the current page table.
The shadow paging is represented diagrammatically as follows −
Advantages
The advantages of shadow paging are as follows −
- No need for log records.
- No undo/ Redo algorithm.
- Recovery is faster.
Disadvantages
The disadvantages of shadow paging are as follows −
Data is fragmented or scattered.
Garbage collection problem. Database pages containing old versions of modified data need to be garbage collected after every transaction.
Concurrent transactions are difficult to execute.
- Related Articles
- What is paging?
- What is a Shadow?
- What is Shadow IT?
- What is Decomposition in DBMS?
- What is 4NF in DBMS?
- What is RAID in DBMS?
- What is Light and Shadow?
- What is functional dependency in DBMS?
- What is Transitive dependency in DBMS?
- What is an instance in DBMS?
- What is Hierarchical model in DBMS?
- What is Data Independence in DBMS?
- What is multivalued dependency in DBMS?
- What is heuristic optimization in DBMS?
- What is concurrency control in DBMS?
