Posts

UNIT III TRANSACTIONS

3.14 ARIES ALGORITHM   ARIES Algorithm •  ARIES is a recovery algorithm. •  It stands for Algorithm for Recovery and Isolation Exploiting Semantics. •  It is based on Write Ahead Log (WAL) protocol. •  When database crashes during some transaction processing, we have the logs that got saved to the disk. •  ARIES has 3 phases that occur in the following order - 1) Analysis: •  Scan the log from start to reconstruct the transaction and dirty page table. Dirtypages contain data that has been changed but not yet written to disk. •  The active transactions which were present at the time of crash are identified. •  During analysis phase the log is scanned forward from the checkpoint record to construct snapshot of what system looks like at the time of crash. 2) Redo : •  This phase is started only after completion of analysis phase. •  The log is read forward and each update is redone. 3) Undo : •  This phase is started after redo ph...

UNIT III TRANSACTIONS

 3.13 RECOVERY CONCEPTS Recovery Concepts •  An integral part of a database system is a recovery scheme that can restore the database to the consistent state that existed before the failure. •  The recovery scheme must also provide high availability; that means, it must minimize the time for which the database is not usable after a failure. Failure Classification Various types of failures are - 1. Transaction Failure:  Following are two types of errors due to which the transaction gets failed. •  Logical Error: i) This error is caused due to internal conditions such as bad input, data not found,overflow of resource limit and so on. ii) Due to logical error the transaction can not be continued. •  System Error: i) When the system enters in an undesired state and then the transaction can not   be continued then this type of error is called as system error. 2) System Crash:  The situation in which there is a hardware malfunction, or a bug in the data...

UNIT III TRANSACTIONS

Image
 3.12 DEADLOCK HANDLING Deadlock Handling   Deadlock is a specific concurrency problem in which two transactions depend on each other for something. For example- Consider that transaction T1 holds a lock on some rows of table A and needs to update some rows in the B table. Simultaneously, transaction T2 holds locks on some rows in the B table and needs to update the rows in the A table held by Transaction T1. Now, the main problem arises. Now Transaction T1 is waiting for T2 to release its lock and similarly, transaction T2 is waiting for T1 to release its lock. All activities come to a halt state and remain at a standstill. This situation is called deadlock in DBMS. Definition:  Deadlock can be formally defined as - " A system is in deadlock state if there exists a set of transactions such that every transaction in the set is waiting for another transaction in the set. " There are four conditions for a deadlock to occur A deadlock may occur if all the following condition...