21 Database Recovery
Dr R. Baskaran
- Process of restoring a database to a correct state in the event of failure.(Or)
- Process of restoring the database to the most recent consistent state that existed shortly before the time of system failure.
- Recovery restores a database from a given state, usually inconsistent to a previously consistent state.
- Number of recovery techniques are based on atomicity properties.
- Generally follows a predictable scenario.
- Determines type and extend of the required recovery.
- If entire database needs to be recovered to a consistent to a consistent state, the recovery uses the most recent backup copy.
- Some DBMS provide functions that allow administrator to schedule automatic backup to secondary storage devices on tapes, CDs, disks etc.,
- Levels of database backup:
- Full backup or dump of a database.
- A differential backup of the database in which only the last modifications done to the database, to the previous copy are copied.
- Backup of transaction log only.
- Hardware failures: includes memory errors, disk crashes, bad disk sectors, disk full errors and so on… This can attribute to design errors, inadequate quality control during fabrication, overloading and wear-out of mechanical parts.
- Software Failure: failures related to software such as operating system, DBMS software, application programs and so on.
- System Crashes: due to software and hardware errors, resulting in the loss of main memory.
- there could be situation where system can enter deadlock state.
- Network Failures: occur while using client server configuration or distributed database system. Communication failures or aborted synchronous connections will interrupt the normal operation.
- Media Failures: due to head craches or unreadable media, resulting in the loss of parts of secondary storage.
- Application Software Failures: logical errors that cause one or more transactions to fail.
- Natural Physical Disasters: failure like fire, flood, earthquake or power failures.
- Carelessness: un-intentional destruction of data.
- Sabotage: intentional corruption or destruction of data
- Transaction represent basic unit of recovery in a database system.
- Transaction begins with successful execution of <t, BEGIN> statement.
- Ends with successful execution of a COMMIT statement.
- Forward Recovery
- Backward Recovery
- Also called Roll Forward, is used in the case of physical damage or failure during transferring buffers to secondary storage.
- Intermediate transactions are stored in database buffers.