Professional Documents
Culture Documents
Database Environment
Database Environment
(2) A user-accessiblecatalog
stored and which is
in which description of data items
are
A DBMS must furnish catalog
a
of an
feature of the ANSI SPARK architecture is the recognition
accessible by users. A key and s on. The
to hold data about the schemas, users, application
integrated system catalog
accessible to users as well as the DBMS.
A systcm catalog or data
catalog is expected to be
data abrut
of information describing the data in the datahase. It is the
dictionary is a repository with the
information is ued vary
data or meta data. The amount of information and the way the
DBMS.Typically the system catalog stores:
Names, types and sizes of data items.
Names of relationship.
Integrity constraints on the data
who have access to the data
Names of authorized users
centralized
A transaction is a sehes of actions carried out by a single user or application program. which
accesses or changes the contents of the database.
5. Recovery services
6. Authorization services
A DBMs must furnish mechanism to ensure that only authorized users can access
a
the
database. We may want to protect the database from unauthorized
access. The term
refers to the protection of the database secondly
against unauthorized access, either intentionally or
accidental
8. Integrity services
A DBMs must furnish a means to ensure that both data in the database and changes to the data
follow certain rules.
Database integrity refers to the correctness and consistency of stored data. It can be considered as
another type of database protection. While integrity is related to security, it has wider
implications: integrity is concerned with the quality of data itself. Integrity is usually expressed
in terms of constraints which are consistency rules that the database is not permited to violate
independence is easier to achieve there are usually several types of changes that can be made lo
the physical characteristics ofthe database without affecting the views. However, complete
logical data independence is more difficult to achieve the addition of a new entity, attribute, or
relationship can usually be accommodated. but not their removal,. In some systems any type of
change to an existing component in the logical structure is prohibited.
10. Urilityservices
A DBMS should provide a set of utility services. Utility programs help the DBA to administer
the database effectively. Some utilities work at the external level and consequently can be
DBA. Other utilities work at the internal level and can be provided by the
produced by the
DBMs vender. Examples:
External level
View View 2 View 3
Conceptual level
Conceptualschema
Internal level
Internal schema
Physical data
organization
Database
External Level
The user's of these database. This level database that part of the database is relevat to each ser
The external level consists of a number of different external views of the datahase. Each user bas
a view of the real world represented in a form that is familiar for that user. The exterma e .
includes only those entities, attributes and relationships that are not of interest may be pres
in the database, but the user will be unaware of them.
In addition, different views have different representation of the same data For exapie. one
may view dates in the form (day ,month, and year.). while another may view danes (er.
month, and day).
Conceptual Level
The community view of database. This level describes what data is stored in the danahase and
the relationship among the data.
This level contains the logical structure of the entire database as seen by the DBA. It is a
complete view of the data requirements of the organization that is independent of any soage
considerations. The conceptual level represents:
The conceptual level supports each external view, in that any data available to a user must be
contained in, or derivable from, the conceptual level. However this level must Dot contain any
storage dependent details. For instance, the description of an entity should contain only data
type's attributes (for example, INTEGER,REAL. CHARACTER). but not any storage
considerations such as the number of bytes occupied.
Internal Level
The physical representation of the database on the database on the computer. This level descnbes
how the data is stored in the database.
The internal level covers the physical implementation of the database to achieve optional run
time performance and storage space utilization. It covers the data structure and fits organizations
used to store data on storage devices. It interfaces with the operating systems access methois
Phgsheabt
Below the intemal level there is a physical level that may be managed by the operating system
under the direction of the DBMs. However. the function of the DBMs and the operating system
at the physical level are not clear-cut and vary from system to system. Some DBMs take
advantage of many of the operating system access methods, while others use only the most basic
ones to create their own file organizations. The physical level below the DBMs consist of items
only the operating system knows. such as exactly how the sequencing is implemented and
whether the fields of internal records are stored as contiguous bytes on the disk.
ping Independence
ESTeTnehemd
ConCohel sl Physical Data
ConceptuaVlnternal
Mapping Independence
Externat Schema
Finally, each external schema is related to the conceptual mapping. This enables the
DBMs to map names in the user's view on to the relevant part of conceptual schema.
Page 8
Notes Prepared by Ms. Peninah J. Limo
DATA INDEPENDENCE
which means
A major objective for the three-level architecture is a to provide data independence,
kinds of data
that the upper levels are unaffected by changes to lower levels. There are two
independence:
(i) Logical data independence
(i) Physical data independence
attributes,
Changes to the conceptual schema, such as the addition or removal of new entities,
or
schemas or having to
relationships, should be possible without having to change existing external
rewTite application programs. Clearly the user for whom the changes have
been made need to be
aware of them, but what is that other users should not be.
Physical data ind3ependence refers to the immunity of the conceptual schema to changes in the
internal schema.
Changes to the internal schema, such as using different file organizations or storage structures,
using different storage devices, modifying indexes or hasting algorithm; should be posible
without having to change the conceptual or external schemas.
functional components of a database system can be broadly divided into the storage manager
and the query processor components. The Major software components in a DBMS is depicted in
figure below.
compiler and
linker DMLqueries DDL interpreter
application
Program DML compiler
object code and organizer
query evaluation
engine
query processor
storage manager
DDL intcrpreter- interprets DDL statements and records the definitions in the data
dictionary
DML compiler - translates DML statements in a query language into evaluation plan
consisting of low-level instructions that the query evaluation engine understands. A
query can usually be translated into any of a number of alternative evaluation plans that
all give the same result.
The DML compiler performs query optinmization that is it picks the lowest cost
evaluation plan from among the alternatives.
compiler.
The major software components for the database manager are as follows:
Authorization and integrity manager: Authorization module checks that the user has the
necessary authorization to carry out the required operation while Integrity checker
File Manager: The tile manager manipulates the underlying storage liles and manages
the allocation of storage space on disk. It establishes and maintains the list of structures
and indexes defined in the internal schema. If hashed files are used it calls on hashing
funetions to generate record addresses. However, the file manager does not directly
manage the physical input and output of data. Rather it passes the requests on to the
appropriates access methods, which either read data from or wite data into the system
buffer (or cache).
Command Processor: Once the system has checked that the user has authority to carry
out the operation, control is passed to the command
processor
Query Optimizer: This moduledetermines-an optimalstrategy torthequeryCxeculion
.Scheduler: This module is responsible for esuring that concurrent operations on the
database proceed without conflicting with one another. It controls the relative order
in
which transaction operations are executed.
DATA DICTIONARY
A data dictionary also known
as a system
catalog is a centralized store of information about thc
database. It contains information about the tables, the
attributes the tables contain, data types,
primary keys, indexes, the joins which have been established between those tables
integrity, cascades update, cascade delete etc. referential1
INDICES
Indices provide fast access to data
item that hold particular values. An index is
values which give the order of the a list of numerical
records when they are sorted on a particular
of the table. attribute/column
Notes Prepared by Ms. Peninah J. Limo
Page12
STEPS OF QUERY PROCESSING
. When a query is submitted to the database, it is received by the query compiler. It then
scans the query and divides it into individual tokens. Once the tokens are generated, they
are verified for their correctness by the parser.
2. Then the tokenized queries are transformed into different possible relational expressions,
relational trees and relational graphs (Query Plans).
3. Query optimizer then picks them to identify the best query plan to process. It checks in
the system catalog for the constraints and indexes and decides the best query plan. It
generates different execution plans for the query plan.
4. The query execution plan then decides the best and optimized execution plan for
execution.
5. The command processor then uses this execution plan to retrieve the data from the
database and returns the result.