In DBMS there are several transactions running in a specified schedule. However sometimes these transactions fail due to several reasons. In previous tutorial, we learned how to identify a recoverable schedule. In this guide, we will discuss the types of failures that can occur in DBMS.
Failures in DBMS are classified as follows:
- Transaction failure
- Underlying System crash
- Data transfer fail
1. Transaction Failure
A transaction is a set of statements, if a transaction fails it means there is a statement in the transaction which is not able to execute. This can happen due to various reasons such as:
Logical Error: If the logic used in the statement itself is wrong, it can be fail.
System Error: When the transaction is executing but due to a fault in system, the transaction fails abruptly. For example: Deadlock condition in transaction can result in System error.
2. Underlying System Crash
The system on which the transactions are running can crash and that can result in failure of currently running transactions.
System can crash due to various reasons such as:
- Power supply disruptions
- Software issues such as Operating system issues
- Hardware issues
3. Hard-disk fail
Hard-disk fail can also cause transaction failure. When transactions are reading and writing data into the disk, the failure in an underlying disk can cause failure of currently running transaction. This is because transactions are unable to read and write data in disks due to disk not working properly. This can result in loss of data as well.
There can be several reasons of a disk failure such as: formation of bad sectors in disk, corruption of disk, viruses, not enough resources available on disk.