2.0 INTRODUCTION
In the previous unit of this block, you have gone through the concepts of Concurrency management. In this unit we will introduce two important issues relating to database management systems. A computer system is an electrochemical device subject to failures of various types. The reliability of the database system is linked to the reliability of the computer system on which it runs. In this unit we will discuss recovery of the data contained in a database system following failure of various types and present the different approaches to database recovery. The types of failures that the computer system is likely to be subjected to include failures of components or subsystems, software failures, power outages, accidents, unforeseen situations and natural or man-made disasters. Database recovery techniques are methods of making the database fault tolerant. The aim of recovery scheme is to allow database operations to be resumed after a failure with minimum loss of information at an economically justifiable cost.
"Database security" is protection of the information contained in the database against unauthorized access, modification or destruction.
"Database integrity" is the mechanism that is applied to ensure that the data in the database is correct and consistent.
Database security and integrity have been discussed in this unit.
2.1 OBJECTIVES |
At the end of this unit, you should be able to:
- describe the term RECOVERY and INTEGRITY
- describe Recovery Techniques
- define Error and Error detection techniques
- describe types of Authorization
2.2 What is Recovery? |
In practice several things might happen to prevent a transaction from completing. Recovery techniques are used to bring database, which does not satisfy consistency requirements, into a consistent state. The inconsistencies may arise due to dissatisfaction of the semantic integrity constraints specified in the schema or may be due to violation of certain implicit constraints that are expected to hold for a database. In other words, if a transaction completes normally then all the changes that it performs on the database are permanently committed. But, if transaction does not complete normally then none of its changes are committed. An abnormal termination may be due to several reasons including:
a) user may decide to abort his transaction
b) there might be a deadlock
c) there might be a system failure.
So the recovery mechanisms must make sure that a consistent state of database can be restored under all circumstances. In case of transaction abort or deadlock the system remains in control but incase of failure the system loses control because computer itself fails or some critical data are lost.
2.2.1 Kinds of Failures
When a transaction/program is made to be executed, a number of difficulties can arise, which leads to its abnormal termination. The failures are mainly of two types:
- Soft failures: In such cases, a CPU or memory or software error abruptly stops the execution of the current transaction (or all transactions), thus lead to losing the state of program execution and the state/contents of the buffers. These can further be subdivided into two types:
a) Statement failure
A Statement of program may cause to abnormal termination if it does not execute completely. If during the execution of a statement, an integrity constraints get violated it leads to abnormal termination of program due to which any updates made already may not got reflected in the database leaving it in an inconsistent state.
b) Program failure
A failure of program can occur if some code in a program leads to its abnormal termination. E.g., a program which goes into an infinite loop. In such case the only way to break the loop is to abort the program. Thus part of program, which is executed before abortion from program may cause some updates in database, and hence the database is, updated only partially which leads to an inconsistent state of database. Also in case of deadlock i.e. if one program enters into a deadlock with some other program, then this program has to be restarted to get out of deadlock and thus the partial updates made by this program in the database makes the database in an inconsistent state.
Thus soft failures can be occurred due to either of statement failure or failure of program. - Hard failure: Hard failures are those failures when some data on disk get damaged and cannot be read anymore. This may be due to many reasons e.g. a voltage fluctuation in the power supply to the computer makes it go off or some bad sectors may come on disk or there is a disk crash. In all these cases, the database gets into an inconsistent state.
In practice soft failures are more common than hard failures. Fortunately, recovery from soft failures is much quicker.
No comments:
Post a Comment