Database Management System
Dr . Venkatesulu Dondeti
Professor
Department of CSE, VFSTR.
Department of Computer Science & Engineering 1
Database Schema and Instance
Database schema describes entities, attributes,
relationships, constraints, storage structure
and access methods
It undergoes changes infrequently
Database instance or database state represents
the data present in the database at a given
instant in time.
It undergoes changes very frequently
Department of Computer Science & Engineering 2
Architecture of a Database system
Is there any database system architecture that
helps to achieve and visualize the following
characteristics of database approach ?
1. Self describing nature of a database system
2. Insulation between programs and Data
3. Support for multiple user views
ANSI-SPARC Architecture
Department of Computer Science & Engineering 3
ANSI/SPARC Architecture
ANSI/SPARC proposed a three level or
3 - schema Architecture to a database system
Separates the user applications from the
physical database.
Describes database system at 3 - levels
Internal level - Internal Schema
Conceptual level - Conceptual Schema
External level - External Schema
Department of Computer Science & Engineering 4
Three-Level/Schema Architecture
Department of Computer Science & Engineering 5
Internal Schema
Internal schema describes the details of
data storage and access paths.
E.g. Multi-level indexing, B-Trees, B+ Trees
Department of Computer Science & Engineering 6
Conceptual Schema
Conceptual schema describes entities, data types of
Attributes, Relationships, User operations and
Constraints
It describes the representational data models
(relational, network and hierarchical models)
It changes whenever database expands or reduces or
constraints changes
It hides the details of storage structure and access
methods
Department of Computer Science & Engineering 7
External Schema
External level has one or more external schemas
or user views
Each external schema describes a part of the
database that a particular user-group is interested
It hides remaining part of the database from that
user group
Underlying representational model in the external
schema may be the one used in conceptual schema
or different
.
Department of Computer Science & Engineering 8
Database System Architecture
Architecture hides the details of how data
is physically stored on a computer system
and accessed.
Hides constraints, structure of data.
relationships from end-users
Hides some part of the entire database
from each-user group.
Architecture enables a database admin to
change the storage structure of the
database, logical structure and external
view of database without affecting the
current users of the system
Department of Computer Science & Engineering 9
Data Independence
In traditional file processing:
Structure of data in a file is embedded in the
application programs
Changes to the structure of a data makes all
the application programs that access the file
to undergo a change.
E.g. Program is written in a such a way that
it accesses only STUDENT records
Department of Computer Science & Engineering 10
Data Independence
Addition of new attribute to the Student
record such as, date of birth, makes the
structure different
Existing application programs becomes
invalid.
All programs that accesses student records
need to be modified
New structure need to be embedded in the
programs that accesses
No Data Independence
Department of Computer Science & Engineering 11
Data Independence
DBMS separates structure of data
from access programs.
DBMS stores structure of data
in a special file called, catalog or
data dictionary.
Database access programs do not
include the structure of data.
Database access programs are
independent of changes to the
structure of data.
Department of Computer Science & Engineering 12
Data Independence – 3 Schema Architecture
How Data independence is achieved
in Three-schema architecture
Three Schema Architecture supports
two types of data independence
Physical data independence
Logical data independence.
Department of Computer Science & Engineering 13
Physical data independence
What is physical data
independence?
Ability to change the physical
storage structures, access methods or
devices with out any change in the
conceptual schema.
Department of Computer Science & Engineering 14
Physical data independence
Changes to internal schema:
Using a new storage device to store
database
Changes in the data organization
and access method in the database.
Department of Computer Science & Engineering 15
Logical data independence
What is logical data independence ?
Ability to change the conceptual
schema
without changing
External schema
User Programs
Changes made will be reflected in
the mappings between external and
conceptual levels.
Department of Computer Science & Engineering 16
Logical data independence
Conceptual schema undergoes a
change:
Addition of a new attribute
Modify an existing attribute
Removal of an existing attribute
Addition of a new entity
Removal of an existing entity
Department of Computer Science & Engineering 17
Logical data independence
Addition of a new constraint
Removal of an existing constraint
Modify an existing constraint
Without affecting External schema
or Programs
Department of Computer Science & Engineering 18
Department of Computer Science & Engineering 19
Database System
Department of Computer Science & Engineering 20
DBMS Architecture
Department of Computer Science & Engineering 21
Query Processor Component
Query Processor components include:
DDL interpreter:
It interprets DDL statements and
converts them in to a set of tables.
Stores definitions of tables in the data
dictionary
DML compiler:
It translates DML statements into low-
level instructions.
Low-level instructions will be understood
by the Query Evaluation Engine.
Department of Computer Science & Engineering 22
Query Processor
Optimizes the DML statements for
efficient execution by the Query
Evaluation Engine.
Query evaluation engine
It executes low-level instructions
generated by the DML compiler and
produces results.
Department of Computer Science & Engineering 23
Storage Manager component
It includes :
Authorization and integrity manager
• It tests for the fulfilment of integrity
constraints and checks the authority of
users to access data.
Transaction manager
• Thiscomponent ensures that concurrent
transactions proceed without conflict and
the database remains in a consistent
(correct) state despite system failures.
Department of Computer Science & Engineering 24
Storage Manager
File manager:
• It allocates or de-allocates disk-space for
the storage of database files.
Buffer manager
• Fetches data from disk storage into main
memory buffers for processing, and then
writes the updated data back onto the
disk.
Department of Computer Science & Engineering 25
Disk Storage Component
The Disk storage component includes:
Data file
• Stores the database files.
Data dictionary
It is a metadata file,
It stores the database schema.
Department of Computer Science & Engineering 26
Disk Storage
Indices
Index enables to access data items faster
e.g. Index page in a textbook contains keyword
and the page number
Database index provides pointers(addresses) to the
blocks that contains the required data item.
Statistical data:
Stores the statistical information about processing
of previous queries.
Department of Computer Science & Engineering 27
Database System Environment
Department of Computer Science & Engineering 28
Department of Computer Science & Engineering 29