Dbms Unit II
Dbms Unit II
Syllabus
Database system concepts and architecture: Schema and instances, three schema architecture of
DBMS, Data independence, database languages and interfaces, database system environment,
classification of DBMS.
The diagram displays the structure of each record type but not the actual instances of records. We
call each object in the schema-such as STUDENT or COURSE-a schema construct.
The distinction between database schema and database state is very important.
When we define a new database, we specify its database schema only to the DBMS. At this
point, the corresponding database state is the empty state with no data.
We get the initial state of the database when the database is first populated or loaded with the
initial data.
From then on, every time an update operation is applied to the database, we get another
database state. At any point in time, the database has a current state.
1
UNIT-II
The DBMS is partly responsible for ensuring that every state of the database is a valid state -
that is, a state that satisfies the structure and constraints specified in the schema.
Hence, specifying a correct schema to the DBMS is extremely important, and the schema
must be designed with the utmost care.
The DBMS stores the descriptions of the schema constructs and constraints-also called the
metadata - in the DBMS catalog so that DBMS software can refer to the schema whenever it needs
to.
The schema is sometimes called the intension, and a database state an extension of the schema.
1. The internal level has an internal schema, which describes the physical storage structure of the
database. The internal schema uses a physical data model and describes the complete details of
data storage and access paths for the database.
2. The conceptual level has a conceptual schema, which describes the structure of the whole
database for a community of users. The conceptual schema hides the details of physical storage
structures and concentrates on describing entities, data types, relationships, user operations, and
constraints. Can be described using either high-level or implementational data model.
3. The external or view level includes a number of external schemas or user views. Each
external schema describes the part of the database that a particular user group is interested in
2
UNIT-II
and hides the rest of the database from that user group. Can be described using either high-level
or implementational data model (Usually uses the same data model as the conceptual schema).
Data Independence
Data independence means the internal structure of database should be unaffected by changes
to physical aspects of storage. Because of data independence, the Database administrator can
change the database storage structures without affecting the users view.
Data independence is accomplished because, when the schema is changed at some level, the
schema at the next higher level remains unchanged; only the mapping between the two levels is
changed.
DBMS Languages
Three are basically two types of languages used in DBMS, viz, front-end and back-end languages.
Back-end is used for the design of storage structure whereas, front-end is used for designing user
interface. Examples of front-end languages are Visual Basic, VB .Net, JAVA etc. Examples of back-
end are, MS Access, PL/SQL, Oracle etc. These two types are also referred to as Data Definition
Language (DDL) and Data Manipulation Language (DML)
DDL is used to design the conceptual schema at the conceptual level. DDL can be of two types,
3
UNIT-II
Structure Definition Language (SDL) and
View Definition Language (VDL).
SDL is normally used to design the tables and VDL is used to create views as per the user queries.
Oracle is an example of DDL which is used as both SDL and VDL.
DML is used at the external level. These languages are used to map the user queries to the
database. There are two types of DML.
Low level DML are called record – at – a – time languages and high level DML are set – at – a –time
languages.
Apart from these languages; there also exist high level Query Processing Languages. In most of the
modern DBMS on languages serves all purpose of DBMS, including, designing, interfacing and query
processing.
DBMS Interfaces
1. Menu-based Interfaces: List of options is displayed in the form of drop down menus so that
user can select the required option. It is text based interface. These are popular web based
user interfaces which are also referred to as browsing interfaces. Examples are web search
engines (Google).
2. Forms-based Interfaces: For each module in the DBMS there will be a form. User will have
to fill the information in the text boxes or through the check boxes or option buttons. Form
specific languages may be used to create such type of interfaces ( eg. VB). Examples of form
based interfaces are applications like e-Granthalaya.
3. Graphical User Interfaces (GUI): These are also normally found in web applications. Instead
of drop down menus user will have pictures or graphics displayed for specific option. User will
have to select the desired one. These interfaces are more colorful and easy-to-use type. Many
commercial web sites are GUI based. (Example: web-pages of Amazon, Flipkart etc.).
4. Natural Language Interfaces: These interfaces accept the queries in local languages. The
query processors may work using two different techniques. In first case the database is
maintained in English and a dictionary of words is maintained for the all the local languages. A
local language processor (natural language processor) is used to process the queries. Where
as in the second case the database itself is maintained in local language and local language
queries are directly processed.
5. Speech input and output: These interfaces will have a speech recognition system and
maintain a verbal dictionary. User can literally ask the queries and get the verbal answers with
4
UNIT-II
some extra hardware devices for speech input and output. These interfaces are of great help
for visually challenged users.
6. Interfaces for Parametric users: DBMS used in banks or in supermarkets will have their own
specific interface for specific use. There will be repeated set of operations to be done and the
operator (parametric user) will have easy access to them by a key-press or a mouse-click.
7. Interface for DBA: This may include the commands to create the user accounts, provide the
authorization, change the parameters and schema design if needed etc.
A DBMS is a complex software system. The environment is about the types of software components
that constitute a DBMS and the types of computer system software with which the DBMS interacts.
Typical DBMS components in below figure are divided into two parts. The top part of the figure refers
to the various users of the database environment and their interfaces. The lower part shows the
internals of the DBMS responsible for storage of data and processing of transactions.
The database and the DBMS catalog are usually stored on disk. Access to the disk is
controlled primarily by the operating system (OS), which schedules disk input/output.
A higher-level stored data manager module of the DBMS controls access to DBMS
information that is stored on disk, whether it is part of the database or the catalog.
If we consider the top half of the figure, It shows interfaces to DBA staff, casual users,
application programmers and parametric users.
The DDL compiler processes schema definitions, specified in the DDL, and stores the
description of the schema in the DBMS Catalog. The catalog includes information such as
names and sizes of the sizes of the files, data types of data of data items. Storage details of
each file, mapping information among schemas and constraints.
The runtime database processor handles database accesses at runtime; it receives retrieval
or update operations and carries them out on the database. Access to disk goes through the
stored data manager, and the buffer manager keeps track of the database pages in memory.
The query compiler handles high-level queries that are entered interactively. It parses,
analyzes, and compiles or interprets a query by creating database access code, and then
generates calls to the runtime processor for executing the code.
The pre-compiler extracts DML commands from an application program written in a host
programming language. These commands are sent to the DML compiler for compilation into
object code for database access. The rest of the program is sent to the host language
compiler.
The object codes for the DML commands and the rest of the program are linked, forming a
canned transaction whose executable code includes calls to the runtime database
processor.
5
UNIT-II
It is now common to have the client program that accesses the DBMS running on a separate
computer from the computer on which the database resides. The former is called the client
computer, and the latter is called the database server. In some cases, the client accesses a
middle computer, called the application server, which in turn accesses the database server.
1. Loading. A loading utility is used to load existing data files—such as text files or sequential
files—into the database. Usually, the current (source) format of the data file and the desired
(target) database file structure are specified to the utility, which then automatically reformats
the data and stores it in the database.
2. Backup. A backup utility creates a backup copy of the database, usually by dumping the
entire database onto tape or other mass storage medium. The backup copy can be used to
restore the database in case of catastrophic disk failure.
6
UNIT-II
3. Database storage reorganization. This utility can be used to reorganize a set of database
files into different file organizations, and create new access paths to improve performance.
4. Performance monitoring. Such a utility monitors database usage and provides statistics to
the DBA.
Disadvantages
o When the central site computer or database system goes down, then everyone is blocked
from using the system comes back.
o Communication costs from the terminals to the central site can be expensive.
A server is a system containing both hard-ware and software that can provide services to the
client machines, such as file access, printing, achieving, or database access.
7
UNIT-II
Two main types of basic DBMS architectures were created on this underlying client/server
framework: two-tier and three-tier.
Two-Tier Client/Server Architectures is used for User Interface program and Application Programs
that runs on client side. An interface called ODBC(Open Database Connectivity) provides an API that
allow client side program to call the DBMS. Most DBMS vendors provide ODBC drivers. A client
program may connect to several DBMS's. In this architecture some variation of client is also possible
for example in some DBMS's more functionality is transferred to the client including data dictionary,
optimization etc. Such clients are called Data server.
8
UNIT-II
9
UNIT-II
Special purpose DBMS – designed for a specific application which can be used
by only one type of applications. For example, Banking, Air-line reservation
systems etc.
General purpose DBMS – designed in such a way that, with slight modifications
this software may be used by different applications. Examples are Office
management systems, shopping invoice systems etc.
10