Database failure is a quite common problem of information technology. It can occur even with good database system software. There may be a simple error which can lead to loss of the complete database.
Some of the causes for database failure are as follows −
If a file in the database is corrupted or damaged, it can lead to the database failure. The file can become corrupt due to the following reasons −
When the server or computer is not shut down properly or during a power surge can lead to damage to the operating system. Interruption of the process of writing the files can also damage the operating system.
Software and hardware failure can also cause data system failure. Hardware failure includes wearing out of mechanical parts, poor quality control, memory errors, disk crashes, bad disk sectors.
Software failure includes software and application system failures.
The effects of database systems can be mitigated by keeping the computer hardware and software updated and practising the proper backup process.
File corruption can be mitigated through use of the log files to restore the database. Some corrupt files can be repaired through DBMS software.
The different types of database failures are as follows −
Failure of a transaction or program − If a transaction that is in progress fails due to an internal issue.
Total system failure − If the system crashes or gets damaged.
Failure of hardware − If the hardware fails on which the database is stored.
The recovery techniques that can be used are explained below −
Manual Reprocessing − In this technique, the databases are backed up periodically and transactions that were applied are recorded since last save. In a case of system crash, the latest database saves could be restored to get the database backup to the same state.
Multiple copies − Multiple active copies of each file are maintained during normal operation of the database. In cases of failure, the comparison between the versions can be used to find a consistent version.
Recovery based on Logs − The logs contain the sequence of actions performed by a transaction, thus the most important part before any modification is to write logs and stored in secured stable storage.