Chapter-2

advertisement
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 1
Chapter 2
Database Concepts and Architecture
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Data Models, Schemas and Instances

A Data Model is:

A collection of concepts that can be used to describe the structure
of a database.


By structure of a database we mean the data-types, relationships and
constraints that should hold on the data.
It provides the means to achieve data abstraction by hiding
unneeded details of data storage.

Most data models include a set of basic operations for specifying
retrieval and updates on the database
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 3
Categories of Data Models

Data models can be categorized according
to the types of concepts they use to
describe the database structure




High Level (Conceptual) data Models provide concepts close to
the way users perceive data
Low Level (Physical) data Models provide concepts that describe
the details of how data is stored in the computer
Between the two extremes is a class of representational data
Models, which provide concepts that may be understood by end
user but not too far removed from the way data is organized within
the computer
It hides some details but can be directly implemented
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 4
Categories of Data Models (continued)

Conceptual data Models use concepts such as entities, attributes
and relationships.
–
–
–
An entity represents a real world object or concept (employee, project).
An attribute represents some property of interest that further describes
an entity (employee name).
A relationship among two entities represents an interaction among them.

Representational Data Models are the models used most
frequently and they include a widely used relational data model,
network and hierarchal models that been widely used in the past.
It represent data by using record structures

Physical Data Models describe how data is stored in the
computer by representing information such as record formats,
record ordering and access path
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 5
Schemas, Instances and Database State

It is important to distinguish between the description of a
database and the database itself:



The description of a database is called the database schema,
which is specified during the database design and is not
expected to change frequently
We call each object in the Schema -Such as Student or
Course- a Schema Construct
Database State:



It is the data in a database at a particular moment
Every time we insert or delete a record we change the state of
a database
Schema change is called Schema Evolution
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 6
DBMS Architecture & Data Independence

A three schema architecture is an architecture
that proposed to help in achieving & visualizing
the three important characteristics of:




program data independence
support of multiple users &
use of catalog to store data description
The goal of the three-schema architecture shown in
Figure 2.2 is to separate the user applications and the
physical database
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 7
The Three-Schema Architecture
Schemas can be defined at the following levels:-


The internal level: describes the physical storage structure
of the database. It uses physical data model.

The conceptual: describes the structure of the whole
database for users. It hides the details of physical storage
structure and concentrate on describing entities, data types,
relationships, user operations and constraints. High level
data model can be used at this level.

The External or View level: includes a number of external
schemas or user views. Each external schema describes the
part that a particular user group is interested in and hides the
rest. High level data model can be used at this level.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 8
Three-Schema Architecture
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 9
Data Independence
Three Schema architecture can be used to explain the
concept of data independence
It is the capacity to change the schema at one level without
having to change it at the next higher level



There are two types of Independence:
Logical data Independence:


Physical Data independence:


the capacity to change the conceptual schema without having to
change external schemas or application programs (expand or
reduce)
the capacity to change the internal schema without having to
change the conceptual or (external) schemas
the two levels of mapping create an overhead during execution of a
query, leading to inefficiencies in the DBMS. Because of this few
DBMS have implemented the full three-schema architecture.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 10
Database Languages

The DBMS must provide appropriate languages and
interfaces for each category of users:







The first step in implementing a database is to specify conceptual and internal
schemas and any mappings between them
In DBMS where no strict levels separation is maintained one language called
(DDL) is used to define both schemas
A DDL compiler is used to process the DDL statements to identify description
of the schema constructs and store them in the DBMS catalog
In a DBMS where separation exists, DDL is used to specify the conceptual
schema only. A Storage Definition Language (SDL) is used to define internal
schema
For true three-schema architecture a third language, the View Definition
Language (VDL) is used to specify user views
Once the database is populated with data a DML is used to manipulate data
In current DBMS all the above languages, are not considered distinct
languages; rather a comprehensive integrated language is used.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 11
DBMS INTERFACES

User friendly interfaces provided by DBMS include the
following:






Menu-Based interfaces for Browsing: They present the user with list of
options, called menus that lead the user through the formulation of a
request.
Forms-based interfaces: it displays a form to each user. Users can fill out
all of the form entries to insert new data or fill out certain entries and the
DBMS will retrieve matching data for the remaining entries.
Graphical user Interface: a GUI displays a schema to the user in a
diagrammatic form. The user can then specify a query by manipulating the
diagram. Most GUI use a pointing device
Natural Language Interfaces: these interfaces accept requests written in
English or any other language and attempt to understand them
Interfaces for Parametric Users: repeated work
Interfaces for the DBAs: privileged commands
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 12
The Database System Environment

DBMS Component Modules:





The database and DBMS catalog are usually stored on disk. Access to the
disk controlled by the operating system (OS).
A higher – level, Stored Data Manager Module (component) controls access
to DBMS information that is stored on disk
If we refer to figure below doted lines and circles marked A,B,C,D and E
shows accesses under the control of this stored manager.
The DDL compiler processes schema definitions, specified in the DDL
statements and stores description of schemas in the catalog including
information about table names, data items, mapping into many schemas and
constraints.
The runtime database processor component handles database accesses at
runtime; it receives retrieval or update operations and carries them out on
the database.
The Query compiler handles high–level queries that are entered
interactively. The pre–compiler extracts DML commands from an
application program written in a host programming language. These
commands are sent to the DML compiler to be compiled into object code for
database to access it. The rest of the program is sent to the host language
compiler.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 13
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 14
Database System Utilities

Most DBMSs have database utilities that help
the DBA in managing the database:

Loading: used to load existing data files into the database (e.g. text files).
The source & target structure are specified to the utility which reformat &
stores data

Backup: backup copy of the database by dumping the entire data onto a
tape/file. It can then be used to restore data in case of disaster (different
types)

File Reorganization: reorganize a database file into a different file
organization to improve performance

Performance Monitoring: It monitors database usage and provide
statistics for decision making
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 15
Tools, Application Environments and
Communication Facilities

Other tools available to database designers,
users and DBAs include:


CASE tools which used in design phase of database
Data Dictionary to store catalog info & other info such as design decisions,
usage standards, application program description and user info.
Application Development tools:
Power Builder, Designer 2000 … etc are becoming quite
Popular because of their features of GUI Development,
Querying & updating, and application program devt.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 16
Classification of Database Management Systems

Several criteria are used to classify DBMS:





Data Model: on which DBMS is based. The two types currently used
are Relational data Model and Object data Model
Number of users: supported by the system. Single user system and
multi-user systems
Number of sites: over which the database is distributed. A DBMS is
centralized if the data is stored at a single computer site. A distributed
DBMS (DDBMS) can have the actual database and DBMS at multiple
sites
The cost of the DBMS.
The type of access path for storing files
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 17
END OF CHAPTER TWO
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 1- 18
Download