Beruflich Dokumente
Kultur Dokumente
Database
A database is a well organized collection of data that are related in a meaningful way which can be accessed in different logical orders but are stored only once. The data in the database is therefore integrated, structured, and shared. The main features of data in a database therefore are: 1. 2. 3. 4. It is well organized It is related It is accessible in different orders without great difficulty It is stored only once
It is assumed that o erations !u date, insert, retrie"e, etc.# on the database can be carried out in a sim le and fle$ible way.
.e0uirements /ommittee#. The three le"els of the architecture are three different "iews of the data: 1. 1$ternal * indi"idual user "iew 2. /once tual * community user "iew 3. Internal * hysical or storage "iew The "iew at each of this le"el is described by a schema. A schema is a logical database descri tion and is drawn as a chart of the ty es of data that are used. It gi"es the name of the entities and attributes and s ecifies the relationshi between them. It is a framewor% into which the "alues of the data item can be fitted. The schema also defines the way in which entities at one le"el of abstraction can be ma ed to the ne$t le"el.
The Three 2e"el Architecture 3or A &)'( !ternal Level" The e$ternal or user "iew is at the highest le"el of abstraction where only those ortions of the database of concern to a user or a lication rogram are included. The e$ternal le"el is the "iew that the indi"idual user of the database has. This "iew is often a restricted "iew of the database and the same database may ro"ide a number of different "iews for different classes of users. In general, the end users and e"en the a lications rogrammers are only interested in a subset of the database. 3or e$am le, a de artment head may only be interested in the de artmental finances and
student enrolments but not the library information. The librarian would not be e$ ected to ha"e any interest in the information about academic staff. The ayroll office would ha"e no interest in student enrolments. Conceptual or #lobal $ie%" At this le"el of database abstraction all the database entities and the relationshi among them are included. 4ne conce tual "iew re resents the entire database. The conce tual "iew is the information model of the enter rise and contains the "iew of the whole enter rise without any concern for the hysical im lementation. This "iew is normally more stable than the other two "iews. In a database, it may be desirable to change the internal "iew to im ro"e erformance while there has been no change in the conce tual "iew of the database. The conce tual "iew is the o"erall community "iew of the database and it includes all the information that is going to be re resented in the database. The conce tual "iew is defined by the conce tual schema which includes definitions of each of the "arious ty es of data. There is only one conce tual schema er database. &nternal $ie%" This "iew is at the lowest le"el of abstraction, closest to the hysical storage method used. The internal "iew is the "iew about the actual hysical storage of data. It tells us what data is stored in the database and how. The internal "iews is e$ ressed by the internal schema. The following as ects are considered at this le"el: 1. (torage allocation e.g. )*trees, hashing etc. 2. Access aths e.g. s ecification of rimary and secondary %eys, inde$es and ointers and se0uencing. 3. 'iscellaneous e.g. data com ression and encry tion techni0ues, o timization of the internal structures. 1fficiency considerations are the most im ortant at this le"el and the data structures are chosen to ro"ide an efficient database. The internal "iew does not deal with the hysical de"ices directly. Instead it "iews a hysical de"ice as a collection of hysical ages and allocates s ace in terms of logical ages.
Mapping bet%een $ie%s" Two ma ings are re0uired in a database system with
three different "iews. A ma ing between the e$ternal and conce tual "iews gi"es the corres ondence among the records and the relationshi s of the e$ternal and conce tual "iews. The e$ternal "iew is an abstraction of the conce tual "iew, which in its turn is an abstraction of the internal "iew. (imilarly, there is a ma ing from a conce tual record to an internal one.
Data &n'epen'ence" The se aration of the conce tual "iew from the internal "iew
enables us to ro"ide a logical descri tion of the database without the need to s ecify
hysical structures. This is often called hysical data inde endence. (e arating the e$ternal "iews from the conce tual "iew enables us to change the conce tual "iew without affecting the e$ternal "iews. This se aration is sometimes called logical data inde endence.
1# &ata &efinition 2anguage !&&2# 2# &ata 'ani ulation language !&'2 &ata &efinition 2anguage: &&2 is used to define conce tual schema and also gi"e some details about how to im lement this schema in the hysical de"ices used to store the data. This definition includes all the entity sets and their associated attributes as well as the relationshi s the entity sets. The definition also includes any constraints that ha"e to be maintained. These definitions, which can be described as metadata about the data in the database are e$ ressed in the &&2 of the &)'( and maintained in a com iled form. The com iled form of the definitions is %nown as data dictionary, directory or system catalogue. &ata mani ulation 2anguage: &'2 is a language that enables users to access or mani ulate data in the database. &ata mani ulation in"ol"es retrie"al of data from the database, insertion of new data into the database, and deletion or modification of e$isting data. The subset of the &'2 used to ose a 0uery is %nown as a 0uery language. A 0uery is a statement in the &'2 that re0uests the retrie"al of data from the database. The "arious commands ro"ided to insert, u date, select, and delete records could be used in an interacti"e mode or embedded in con"entional rogramming languages.
lements Of A DBMS
The ma5or com onents of a &)'( are: DML )recompiler" It con"erts &'2 statement embedded in an a lication rogram to normal rocedure calls in the host language. The recom iler must interact with the 0uery rocessor in order to generate the a ro riate code. DDL Compiler" It con"erts the data definition statements into a set of tables. These tables contain information concerning the database and are in a form that can be used by other com onents of the &)'(. (ile Manager" .es onsibility for the structure of the files and managing the file s ace rests with the file manager. 3ile manager manages the allocation of s ace on dis% storage and the data structure used re resent information stored on dis%.
Database Manager" A database manager is a rogram module which ro"ides the interface between the low le"el data stored in the database and the a lication rograms and 0ueries submitted to the system. It is res onsible for interfacing with the file system. 4ne of the functions of database manager is to con"ert user6s 0ueries coming directly "ia the 0uery rocessor or indirectly "ia an a lication rogram from the user6s logical "iew to the hysical file system. In addition, the tas% of enforcing constraints and security are also erformed by database manager. (ynchronizing the simultaneous o erations erformed by concurrent users is under the control of the database manager. *uery )rocessor" The 0uery rocessor is used to inter ret the online user 0uery and con"ert it into the efficient series of o erations in a form ca able of being sent to the data manager for e$ecution. The 0uery rocessor uses the data dictionary to find the structure of the rele"ant ortion of the database and uses this information in modifying the 0uery and re aring an o timal lan to access the database. Database A'ministrator" /entralized control of database is e$erted by a erson who is referred as database administrator. They are the users who are res onsible for creating modifying and maintaining its three le"els. The functions of &)A are: 1# (chema definition 2# (torage structure and access method definition 3# (chema and hysical organization modification 4# 7ranting of authorization for data access 8# Integrity /onstraint s ecification 9# &efining rocedures to reco"er the database from failures Data Dictionary" Information ertaining to the structure and usage of data contained in the database, the metadata, is maintained in the data dictionary. A data dictionary would ro"ide the definition of data item, how they fit into the data structure and how they relate to other entities in the database. The &)A uses the data dictionary in e"ery hase of a database life cycle starting from the data gathering hase to the design , im lementation and maintenance hase.
!ai"e #sers
Application Programmers
Query
Application Programs
System Calls
DDL Compiler
D MS
&)'( (tructure
3# &ata inde endence: * &ata inde endence is usually considered from two oints of "iew: hysical data inde endence and logical data inde endence. -hysical data inde endence allows changes in the hysical storage de"ices or organization of the files to be made without re0uiring changes in the conce tual "iew or any of the e$ternal "iews and hence in the a lication rogram using the database. 2ogical data inde endence im lies that the a lication rogram need not be changed if fields are added to an e$isting record nor do they ha"e to be changed if fields not used by a lication rograms are deleted. 4# &ata (ecurity: * &ata is of "ital im ortance to an organization and may be confidential. The &)A who has the ultimate res onsibility for the data in the &)'( can ensure ro er access rocedures are followed, including ro er authentication schemas for access to the &)'( and additional chec%s before ermitting access to sensiti"e data. &ifferent le"el of security could be im lemented for "arious ty es of data and o erations. 8# (haring of data under its control by any number of a lication rograms 9# &ata integrity: * /entralized control can also ensure that ade0uate chec%s are incor orated in the database to ro"ide data integrity. &ata integrity means that the data contained in the database is both accurate and consistent. :# /onflict resolution: * The &)A defines the best file structure and access method to get o timal erformance for the res onse*critical a lications, while ermitting the less critical a lications to continue to use the database, with relati"ely slower res onse. The 'isa'vantages are" 1# -roblems associated with centralization: * /entralization means that the data is accessible from a single source namely the database. This increases the otential se"erity of security breaches and disru tion of the o eration of the organization because of downtimes and failures. 2# /ost of software and hardware: * In addition to the cost of urchasing or de"elo ing the software, the hardware has to be u graded to allow for the e$tensi"e rogram and the wor% s aces re0uired for their e$ecution and storage. The rocessing o"erhead introduced by the &)'( to im lement security, integrity, and sharing of the data causes a degradation of the res onse and the through; ut times. 3# /om le$ity of bac%u and reco"ery o erations.
<<<<<<<<<<<<<<<<<<<