Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Serializability wikipedia , lookup
Oracle Database wikipedia , lookup
Microsoft Access wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Concurrency control wikipedia , lookup
Relational model wikipedia , lookup
ContactPoint wikipedia , lookup
GCSE Computing A451 Unit 5.2 – DBMS www.mrfraser.org Unit 5.2 – Database Management System (DBMS) Candidates should be able to: a. Describe how a DBMS allows the separation of data from applications and why this is desirable. b. Describe the principal features of a DBMS and how they can be used to create customised data handling applications. The DBMS The database management system (DBMS) is a software application that sits between the data in the database and the applications that an organisation uses to access that data. Its key roles are: • • • • • Control creation, maintenance and use of a database Control access to data Maintain data security Enforce data integrity DB recovery after failure Database Integrity Database integrity ensures that data entered into the database is accurate, valid, and consistent. Any applicable integrity constraints and data validation rules must be satisfied before permitting a change to the database. Integrity can be compromised if unintended changes take place by accident or by malicious individuals. Three basic types of database integrity constraints are: • • • Entity integrity – Each row in a table must have a unique identifier Domain integrity – Data must be of a predefined type (e.g. String, date, integer) Referential integrity – Every value of one attribute (column) of a table must exist as a value of another attribute in another table. Some changes to a database might not make sense. For example, if you delete songs from your music library, but they are still referred to in a playlist... the playlist will not be able to locate the songs to play them. Or, in a school, there might be information about which pupils are taking which exams. If someone deleted an exam subject and there were pupils entered for it, this would make it impossible to do the entry processing. DBMSs allow the database designer to enforce referential integrity which prevents inconsistent changes from being carried out. 1 GCSE Computing A451 Unit 5.2 – DBMS www.mrfraser.org Database Security There is a wide range of security controls employed to protect databases against compromises of their confidentiality, integrity and availability. Security risks to database systems include: • • • • • • • Unauthorised access to database Unintended activity or misuse by authorised database users Malware infections – e.g. causing leakage or disclosure of personal data Overloads – Database cannot be used due to performance constraints & capacity issues Physical damage – Fire, flood, overheating, lightning, accidental liquid spills etc. Design flaws and programming bugs in databases – resulting in security vulnerabilities Data corruption Data Access In order to ensure data integrity, only one copy of the data is held in a database. It is necessary, therefore, for the DBMS to control access to specified data within the database at any given time. Multiple, different applications must be able to access the same database simultaneously, but not edit the same data at the same time (whilst one user/application edits a record, other users/applications will be restricted to read-only access to that record.) The DBMS is also responsible for maintaining the different external views of the database available to different users (see notes from Unit 5.1 – Database Concept). Different people need different subsets to work on. They must all, however, be able to see the one and only up-to-date copy of the data, so that there are no inconsistencies. The DBMS must: • • • • • • Allow data sharing Allow multiple user access Allow multiple applications to work on the same database Hold a single copy of data for all to access to prevent inconsistent updates Allow data to be changed without having to change the applications using it Provide multiple views of the same data. 2 GCSE Computing A451 Unit 5.2 – DBMS www.mrfraser.org ACID There is a set of rules that databases should always be subjected to so that inconsistent changes are not made. These are known as the ACID rules. They refer to transactions (actions that bring about a change to the data). Atomic – a change is either completely performed or not at all. It must not be possible to abandon a transaction and save it in a half completed state. For example, in a bank, if one account is debited, another must be credited or the money just disappears. Consistent – a transaction must take a database from one consistent state to another. Again, in a banking situation, the total amount of debits in the complete system must equal the total credits. Isolated – a transaction should not be visible to any other transaction or user until it is irrevocably committed. Imagine if several theatre booking offices had access to a particular seat in a particular theatre on a particular day, all at the same time: double bookings could easily occur. It is necessary to lock a record while a transaction is taking place and not release it until it has been committed. Durable – once a change has been made, it must not be lost due to any subsequent failure Applications DBMSs allow the creation of applications. The DBMS makes sure that any applications related are not able to damage the underlying data. Applications can be created by the language provided or often by using a visual interface. This allows the designer to create objects such as: • • • • • Tables Forms Queries Reports Modules It is often possible to create the database objects using a wizard. This asks questions about what is required and then constructs the component automatically. 3 GCSE Computing A451 Unit 5.2 – DBMS www.mrfraser.org Tables These are the essential data stores of the database. The fields can be created manually or a wizard can suggest fields for you. It is important to make the right decisions about which data goes into which table. Also, data types have to be chosen so that they can help in the validation of data input and ensure the database performs in the way intended. Forms These are the interface between the user and the underlying application. They can accept data as well as display it. They can have controls added, such as buttons and combo boxes, in order to provide interaction and validation capability. Queries These are used to extract a subset of the data. They can be applied to more than one table in order to provide the user with exactly the right data to work on. Queries can be constructed visually as in the screenshot on the next page. The tables and fields are inserted where required. The conditions can be added by filling in boxes. Alternatively, SQL can be used to construct a query (see notes from Unit 5.1 – Database Concepts). Reports These are printed lists of selected data from a database. They can be set to present data in all sorts of ways. They can be based on tables or queries in order to select exactly the data that is needed. Modules These are units of program code. Most DBMSs have a programming language built in so that a developer can have total control over the performance of the applications. For example, Microsoft® Access has the language VBA (Visual Basic® for Applications) built into it. Here is a short example of VBA code. Sub RunMyList() Dim MyDB As Database, MyRecs As Recordset, MyName As String Set MyDB = CurrentDb() Set MyRecs = MyDB.OpenRecordset("MyList") MyName = InputBox("Enter your name") MyRecs.MoveFirst End Sub 4