Data loss is one of the main critical issues that must be foreseen and prevented while creating a database. Database data can be lost through various means. They include; Hardware failures, accidental use of DELETE and UPDATE buttons, Software bugs, natural disasters such as floods and earthquakes and man-made disasters such as fire and virus attacks. The success of a database management system depends on its architecture, software and hardware involved. If it fails then there is a process that must be followed to recover the data.
In order to identify which technique to use in case of failure, we must identify the type of failure that has occurred. There are failures such as transaction failure; this when a transaction refuses to execute or reaches a stall during execution. This is can be due to logical errors and system errors. Then there is the System Crash; which is caused by external interruptions which cause the system to stop for example electricity power supply interruption, this may lead to system crash. Disk Failure; this is when the disk cannot be read or is damaged. This affects the storage structure which comprises of Volatile storage ie. the cache memory and the non-volatile storage which includes hard disks RAM and flash memory.
In the event, one of the above problems brings down the database, here are some techniques to recover databases.
- Using a salvation program– A salvation program is a software that is used to restore a system to a valid state after a crash. It’s the only technique that does not use recovery data hence the most preferred. It scans the database to assess the damage and use recognizable data to restore it to a valid state.
- Careful replacement– This involves putting altered parts in a copy of the original after which the original is then deleted after the alteration is complete and certified. Its principle is to avoid updating any part of the data structure in place. In this technique, there exist two copies during an update and the original will be available if a crash occurs.
- Backup /current version-Present files from the current version of the database files from the previous version containing values are used as a consistent backup.
- Using checkpoints– In instances when maintaining logs in real time is not possible, checkpoints are used. This involves the removing of all previous logs and storing them in a permanent storage. They declare the point at which the system was stable and when the transactions were performed.
- Multiple copies– This is when multiple copies of each file are kept during the normal database operation so that if a failure occurs the other remaining copies can be used to find a consistent copy
- Log-based recovery– This is the use of a sequence of records (logs) of actions performed by a transaction. The Boston Data Recovery Group has given a presentation on this technique. The logs can be prepared in advance and stored in a failure-proof storage. Logs are used to backtrack and modify what happened before the failure.
- Audit Trail– this is when the sequences of actions on files are recorded in order to be used when there is a crash or to back out particular processes.
- Differential files– This is where a file contains two parts; the main file which is the original and the differential file which records all alterations requested for the main file. The two files are later merged.
- Incremental dumping-This involves copying of updated files onto a storage at regular intervals. This creates backup files in case of a crash and creates checkpoints for updated files.
Those are the 9 most used techniques of recovering databases.