Sie sind auf Seite 1von 33

Components of DBMS

Module - 1

Major components of a DBMS


1.
2. 3. 4. 5. 6.

Transaction management:
Concurrency Control: Recovery Management: Security Management: Language Interface: Storage Management:

Page 2

Transaction management
A transaction is a sequence of database operations that represents a logical unit of work and that accesses a database and transforms it from one state to another. For e.g. consider a database that holds information about airline reservations
Several travel agents look up information about available seats on various flights and make new seat reservation When several users access a database concurrently, DBMS must order their requests carefully to avoid conflicts. DBMS must protect users from the effects of system failures by ensuring that all data is restored to a consistent state

Page 3

Concurrency Control
This is the database management activity of coordinating the actions of database manipulation processes that operate concurrently that access shared data and potentially interfere with one another

To schedule concurrent accesses to data so that each user can safely ignore the fact that others are accessing the data concurrently
DBMS allows users to think of their programs as if they were executing in 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
Page 4

Exclusive LOCK - Data item can be both read as well as written.

Recovery Management
This in a database ensures the aborted or failed transactions (system crash) create no adverse effects on the database or the other transactions
DBMS must ensure that the changes made by such incomplete transactions are removed from the database

DBMS maintains a log of all writes to the database. Each write action must be recorded in the log before the corresponding change is reflected in the database itself. Property is called Write-Ahead Log or WAL

Security Management: Refers to the protection of


data against un-authorized access
Page 5

Language Interface: The DBMS provides support


languages for definition and manipulation of data in the database.

Storage Management: The DBMS provides a


mechanism for management of permanent storage of the data.

Page 6

Structure of a DBMS

Page 7

Nave Users (tellers, agents etc.)


Application interfaces Application programs object code

Application programmers
Application Programs Embedded DML pre compiler

Sophisticated Database users Administrator


Database scheme

users

Query DML compiler

DDL interpreter

Query processor

Query Evaluation engine

Transaction manager

Buffer manager

Authorization & Integrity manager File manager

Storage manager

Disk storage

indices Statistical data Data files Data dictionary

Page 8

Overall system structure


DBMS is divided into modules that deals with each of the responsibilities of the overall system.
Functional components of a DBMS are

Query processor components


Storage manager components

Page 9

Query Processor components DML compiler


Embedded DML pre compiler DDL interpreter Query evaluation engine

Storage manager components Authorization and integrity manager


Transaction manager File manager Buffer manager

Page 10

DML compiler
Translates DML statements in a query language into low level instructions that the query evaluation engine understands.

Embedded DML precompiler


Converts DML statements embedded in an application program to normal procedure calls. Interact with the DML compiler to generate the appropriate code

Page 11

DDL interpreter
Interprets DDL statements and records them in a set of tables containing metadata

Query evaluation engine


Executes low-level instructions generated by the DML compiler

Page 12

Authorization & integrity manager


Tests for the satisfaction of integrity constraints and checks the authority of users to access data.

Transaction manager
Ensures that the database remains in a consistent state despite system failures.

Page 13

File manager
Manages the allocation of space on disk storage and the data structures used to represent information stored on disks.

Buffer manager
Responsible for fetching data from disk storage into main memory and deciding what data to cache in memory.

Page 14

Several data structures required for physical 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.

Page 15

Database languages

DDL (Data definition language) DML (Data manipulation language) SDL (Storage Definition Language) VDL (View Definition Language)

Page 16

Data definition language

Database schema is specified by a set of definitions which are expressed by a special language called DDL.
Result of compilation of DDL statements is a set of tables which are stored in a special file called data dictionary.

Page 17

create table branch (branch-name char(15) not null, branch-city char(30), assets integer) DROP TABLE employees; ALTER TABLE sink ADD bubbles INTEGER; ALTER TABLE sink DROP COLUMN bubbles;

Page 18

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 each database, plus additional details, like the type and length of each data element

Page 19

Data manipulation language


DML is a language that enable users to access or manipulate data in database.

select A1, A2, ..., An from r1, r2, ..., rm where P Insert into table tablename values (d1,d2..); Delete from table tablename where condition ; Update command

Page 20

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.

Page 21

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.

Page 22

SDL (Storage Definition Language): is used to specify the internal schema.

VDL (View Definition Language): is used to specify user views and their mappings to the conceptual schema.

Most DBMSs use DDL to specify both conceptual and external schema

Page 23

Query: A statement requesting the retrieval of information

Query language
The portion of a DML that involves information retrieval Data sublanguage: DML & DDL when embedded within a host language (e.g C or COBOL)
Page 24

Database Users & Administrators


People who work with a database can be categorized as database users and database administrators

Page 25

Types of database users


Nave users

unsophisticated users interacting with system by invoking one of the application programs that ve been written previously. e.g bank teller transfers $50 from account A to B by invoking a program called transfer

Page 26

Application programmers computer professionals who write application programs like transfer. Sophisticated users interact without writing programs. They form their requests in query language. Specialized users sophisticated users who write specialized database applications. E.g CAD systems and Expert systems
Page 27

Database Administrator

A person who has a central control over the system is called a DBA

Page 28

Functions of DBA
Schema Definition
DBA creates the original database schema by executing data definition statements in DDL

Page 29

Schema and physical organization modification

DBA makes changes to the schema and physical organization to reflect the changing needs of the organization
To ensure adequate performance as requirements change Also known as database tuning

Page 30

Granting of authorization for data access

DBA is responsible for ensuring that unauthorized data access is not permitted DBA grants different types of authorization by which DBA regulates which parts of the database various users can access.

Page 31

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 normal operations Monitoring jobs running on the database and ensuring its performance

Page 32

END

Page 33

Das könnte Ihnen auch gefallen