structure of DBMS
-
Upload
kavitha-jiji -
Category
Documents
-
view
223 -
download
0
Transcript of structure of DBMS
-
7/28/2019 structure of DBMS
1/33
Components of DBMS
Module - 1
-
7/28/2019 structure of DBMS
2/33
Page 2
Major components of a DBMS
1. Transaction management:2. Concurrency Control:
3. Recovery Management:
4. Security Management:
5. Language Interface:
6. Storage Management:
-
7/28/2019 structure of DBMS
3/33
Page 3
Transaction management
A transaction is a sequence of database operations that
represents a logical unit of work and that accesses adatabase and transforms it from one state to another.
For e.g. consider a database that holds information aboutairline reservations
Several travel agents look up information about available seats onvarious flights and make new seat reservation
When several users access a database concurrently, DBMS must ordertheir requests carefully to avoid conflicts.
DBMS must protect users from the effects of system failures byensuring that all data is restored to a consistent state
-
7/28/2019 structure of DBMS
4/33
Page 4
Concurrency Control
This is the database management activity of coordinating the
actions of database manipulation processes that operateconcurrently that access shared data and potentially interfere
with one another
To schedule concurrent accesses to data so that each usercan safely ignore the fact that others are accessing the dataconcurrently
DBMS allows users to think of their programs as if they were executingin isolation
Locking protocol a set of rules to be followed by each transaction
Lock mechanism used to control access to database objects
Shared LOCK - Data item can only be read
Exclusive LOCK - Data item can be both read as well as written.
-
7/28/2019 structure of DBMS
5/33
Page 5
Recovery Management
This in a database ensures the aborted or failedtransactions (system crash) create no adverseeffects on the database or the other transactions
DBMS must ensure that the changes made by such incomplete
transactions are removed from the databaseDBMS maintains a log of all writes to the database. Each write action must
be recorded in the log before the corresponding change is reflected inthe database itself. Property is called Write-Ahead Log or WAL
Security Management:Refers to the protection ofdata against un-authorized access
-
7/28/2019 structure of DBMS
6/33
Page 6
Language Interface:The DBMS provides supportlanguages for definition and manipulation of data in thedatabase.
Storage Management:The DBMS provides amechanism for management of permanent storage of thedata.
-
7/28/2019 structure of DBMS
7/33
Page 7
Structure of a DBMS
-
7/28/2019 structure of DBMS
8/33
Page 8
Nave Users Application Sophisticated Database(tellers, agents etc.) programmers users Administrator
Applicationinterfaces
ApplicationPrograms Query
Databasescheme
Application programsobject code
DML compiler DDLinterpreter
Query Evaluation engine
Transaction manager Buffer manager
File manager
Embedded DMLpre compiler
indices Statistical data
Data filesData dictionary
users
Disk storage
Query
processor
Storagemanager
Authorization & Integrity manager
-
7/28/2019 structure of DBMS
9/33
Page 9
Overall system structure
DBMS is divided into modules that deals with each of theresponsibilities of the overall system.
Functional components of a DBMS are
Query processor componentsStorage manager components
-
7/28/2019 structure of DBMS
10/33
Page 10
Query Processor
components
DML compiler
Embedded DML precompiler
DDL interpreter
Query evaluation engine
Storage manager
components
Authorization and integritymanager
Transaction manager
File manager
Buffer manager
-
7/28/2019 structure of DBMS
11/33
-
7/28/2019 structure of DBMS
12/33
Page 12
DDL interpreter
Interprets DDL statements andrecords them in a set of tables
containing metadata
Query evaluation engine
Executes low-level instructionsgenerated by the DML compiler
-
7/28/2019 structure of DBMS
13/33
Page 13
Authorization & integrity manager
Tests for the satisfaction of integrityconstraints and checks the
authority of users to access data.
Transaction manager
Ensures that the database remainsin a consistent state despite systemfailures.
-
7/28/2019 structure of DBMS
14/33
Page 14
File manager
Manages the allocation of space ondisk storage and the data
structures used to representinformation stored on disks.
Buffer manager
Responsible for fetching data fromdisk storage into main memory anddeciding what data to cache in
memory.
-
7/28/2019 structure of DBMS
15/33
Page 15
Several data structures required forphysical system implementation
Data files- which store the database itself
Data dictionary- stores metadata about the structure
of the database
Indices- provides fast access to data items that hold
particular values.
Statistical data- stores statistical information about
the data in the database.
-
7/28/2019 structure of DBMS
16/33
Page 16
Database languages
DDL (Data definition language)
DML (Data manipulation language)
SDL (Storage Definition Language)VDL (View Definition Language)
-
7/28/2019 structure of DBMS
17/33
Page 17
Data definition language
Database schema is specified by a set of definitionswhich are expressed by a special language calledDDL.
Result of compilation of DDL statements is a set oftables which are stored in a special file called datadictionary.
-
7/28/2019 structure of DBMS
18/33
Page 18
create table branch
(branch-name char(15) not null,branch-citychar(30),assets integer)
DROPTABLE employees;
ALTERTABLE sink ADD bubbles INTEGER;
ALTERTABLE sink DROPCOLUMN bubbles;
-
7/28/2019 structure of DBMS
19/33
Page 19
Data Dictionary
It is a file that contains metadata.
i.e. data about data
includes the names and descriptions of various tables and fields in eachdatabase, plus additional details, like the type and length of each data
element
-
7/28/2019 structure of DBMS
20/33
Page 20
Data manipulation language
DML is a language that enable users to access or manipulate data indatabase.
selectA1,A2, ...,An
fromr1, r2, ..., rmwhere P
Insert into table tablename values (d1,d2..);
Delete from table tablename where condition ;
Update command
-
7/28/2019 structure of DBMS
21/33
Page 21
Data manipulation means
Retrieval of information stored in the database.
Insertion of information into the database
Deletion of information from the database
Modification of information in database.
-
7/28/2019 structure of DBMS
22/33
Page 22
Two types of DML
Procedural DML
require a user to specify what data are needed and how to get those data.
Non Procedural DML
require a user to specify what data are needed without specifying how to
get those data.
-
7/28/2019 structure of DBMS
23/33
Page 23
SDL (Storage Definition Language): is used to specify theinternal schema.
VDL (View Definition Language): is used to specify userviews and their mappings to the conceptual schema.
Most DBMSs use DDL to specify both conceptual andexternal schema
-
7/28/2019 structure of DBMS
24/33
Page 24
Query: A statement requesting the retrieval ofinformation
Query languageThe portion of a DML that involves informationretrieval
Data sublanguage: DML & DDL when embeddedwithin a host language (e.g C or COBOL)
-
7/28/2019 structure of DBMS
25/33
Page 25
Database Users & Administrators
People who work with a database can becategorized as database users and databaseadministrators
-
7/28/2019 structure of DBMS
26/33
Page 26
Types of database users
Nave users
unsophisticated users interacting with system byinvoking one of the application programs that ve
been written previously.e.g bank teller transfers $50 from account A to B byinvoking a program called transfer
-
7/28/2019 structure of DBMS
27/33
Page 27
Application programmers
computer professionals who write application
programs like transfer.
Sophisticated users
interact without writing programs. They form theirrequests in query language.
Specialized users
sophisticated users who write specializeddatabase applications.
E.g CAD systems and Expert systems
-
7/28/2019 structure of DBMS
28/33
Page 28
Database Administrator
A person who has a central control over the systemis called a DBA
-
7/28/2019 structure of DBMS
29/33
Page 29
Functions of DBA
Schema Definition
DBA creates the original database schema by executing datadefinition statements in DDL
-
7/28/2019 structure of DBMS
30/33
Page 30
Schema and physical organization modification
DBA makes changes to the schema and physicalorganization to reflect the changing needs of the organization
To ensure adequate performance as requirements change
Also known as database tuning
-
7/28/2019 structure of DBMS
31/33
Page 31
Granting of authorization for data access
DBA is responsible for ensuring that unauthorized dataaccess is not permitted
DBA grants different types of authorization by which DBAregulates which parts of the database various users canaccess.
-
7/28/2019 structure of DBMS
32/33
Page 32
Routine maintenance
Periodically backing up the database
Maintains logs of system activity
To facilitate recovery from a crash
Ensuring that enough free disk space is available for normaloperations
Monitoring jobs running on the database and ensuring itsperformance
-
7/28/2019 structure of DBMS
33/33
Page 33
END