INTRODUCTION TO DBMS
Contents
Definition of data, information, knowledge Definition of database, DBMS
Database vs. File systems.
Three-schema architecture Data independence
Database users
Database Administrator(DBA)
Definition of Data & information
What is data?
Known facts that can be recorded and have some implicit meaning
What is information?
Meaningful data
Definition of knowledge
What is knowledge?
knowledge indicates the information which not only
utilize in current decision making but also store for later use.
What is the difference between knowledge and
information?
Definition of Database, DBMS
What is database?
organized collection of related information presented to
serve a specific purpose
What is database management system (DBMS)? a collection of interrelated data (database)
and a set of programs to access those data and maintain database concurrently and efficiently.
Purpose of Database Systems
Limitations of File Systems
In the early days, database applications were built on top of file
systems
Data is stored in separate files Data is manipulated by a set of application programs
As time goes by, the number of files and application programs
increases
increasing complexity of database application management
Purpose of Database Systems
Limitations of File Systems
Drawbacks of using file systems to store data
Data redundancy and inconsistency
Redundancy: duplication of information in different files Inconsistency: the various copies of the same data may be different
Difficulty in accessing data
Need to write a new program to carry out each new task
Data isolation multiple files and formats
Because data are scattered in various files, and files may be in different formats, writing the appropriate information to retrieve the appropriate data is difficult
Integrity problems
Data values stored in the database must satisfy certain types of consistency constraints Integrity constraints (e.g. account balance > 0) become part of program code Those constraints are forced by the database system developer Hard to add new constraints or change existing ones
Purpose of Database Systems
Limitations of File Systems
Atomicity of updates
Failures may leave database in an inconsistent state with partial updates carried out E.g. transfer of funds from one account to another should either complete or not happen at all
Concurrent access by multiple users
Concurrent accessed needed for performance Uncontrolled concurrent accesses can lead to inconsistencies E.g. two people reading a balance and updating it at the same time
Security problems
Not every user of the database should be able to access all the data
Database systems offer solutions to all previous problems
Schema & Instance
Instance: The collection of information stored in the
database in a particular moment is called instance of database.
Schema: The overall design of the data base is schema.
Difference between them:
Instance of a database changes over time as information is inserted and deleted. Schema changes infrequently.
View of Data in a Database
The Need for Data Abstraction
A major purpose of a database system is to provide users with an
abstract view of data
The system hides certain details of how the data are stored and
maintained
The objective of data abstraction is to simplify the interaction with
the database from the user perspective
Most of database users are not computer trained
However, more complexity from the design perspective Complex data structure to represent data
View of Data in a Database
The levels of Data Abstraction
Physical Level: describes how
the data is actually stored
Describes
low
level
data
What to store
structures.
Block of consecutive storage
locations (e.g. bytes)
How to store
The compiler hides this level
of details from programmers.
View of Data in a Database
The levels of Data Abstraction
Logical Level: describes what data are stored in the database and what relationships exist between data
type customer = record name: string; street: string; city: integer; end;
each record is described by a type definition Programmers work at this level of abstraction Similar to database administrator
View of Data in a Database The levels of Data Abstraction
View Level: describes only part of the entire database.
application programs hide details of data types. Views can also hide information (e.g. salary) for security purposes. computer users only see a set of applications without details on data
types Similar to users of database
Data Abstraction
Each layer need not know how other layers organize data.
Mapping
Mappings among schema levels are needed to transform
requests and data.
Programs refer to an external schema, and are mapped by
the DBMS to the internal schema for execution.
Request for a data
External level
Request against a conceptual schema Conceptual level Request against internal schema Internal level
Data Independence
Logical Data Independence: The capacity to change the
conceptual schema without having to change the external schemas and their application programs.
Physical Data Independence: The capacity to change the
internal schema without having to change the conceptual schema.
Database Users
Users are differentiated by the way they expect to interact with the system :
those who actually use and control the content (called Actors on the Scene) and those who enable the database to be developed and the DBMS software to be designed and implemented (called Workers Behind the Scene).
Database Users
Database administrators: responsible for authorizing access
to the database, for coordinating and monitoring its use, acquiring software, and hardware resources, controlling its use and monitoring efficiency of operations.
Database Designers: responsible to define the content, the
structure, the constraints, and functions or transactions against the database. They must communicate with the end-users and understand their needs.
End-users: they use the data for queries, reports and some of
them actually update the database content.
Application Programmers: System analysts determine the
requirements of end-users and programmers implement programs, test, debug and document.
Database End-Users
1. Casual : access database occasionally when needed
2.
Nave or Parametric : invoke one of the permanent application
programs that have been written previously E.g. Bank cashier, people accessing a database over the web The typical user interface for nave user is a form interface where the user just fill in the appropriate fields of the form
Database End-Users
3. Sophisticated : these include business analysts, scientists,
engineers, others thoroughly familiar with the system capabilities. Many use tools in the form of software packages that work closely with the stored database.
4. Stand-alone : mostly maintain personal databases using ready-touse packaged applications. An example is a tax program user that creates his or her own internal database.
Database Administrators
The Database Administrator (DBA) Coordinates all the activities of the
database system
The DBA has a good understanding of the enterprises information resources
and needs
The DBA has central control over the system
Database Administrators
Database administrator's duties include:
Schema definition, specifying integrity constraints Storage structure and access method definition Schema and physical organization modification Granting user authority to access the database Acting as liaison with users Monitoring
performance
and
responding
to
changes
in
requirements Routine maintenance (DB backup, Ensuring free space for the DB, etc )
Transaction management
A transaction is a collection of operations that performs a single
logical function in a database application
Transaction-management component ensures that the database
remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures.
Concurrency-control manager controls the interaction among the
concurrent transactions, to ensure the consistency of the database.
Storage Management
Storage manager is a program module that provides the interface
between the low-level data stored in the database and the application programs and queries submitted to the system.
The storage manager is responsible to the following tasks:
interaction with the file manager efficient storing, retrieving and updating of data
Data dictionary
Used to store schema descriptions and other information such as data about data (metadata), design decisions, application program descriptions, user information, usage standards, etc. Active data dictionary is accessed by DBMS software and users/DBA.
Passive data dictionary is accessed by users/DBA only.
Data dictionary
A data dictionary should help a user in:
Communication with the users
Controlling data element in a simple and effective
manner Determining the impact of changes to data element on the total database Centralizing the control of a data element.
Database System Applications
Banking: all transactions Airlines: reservations, schedules Universities: registration, grades, student information Sales: customers, products, purchases Manufacturing: production, inventory, orders, supply chain Human resources: employee records, salaries, tax deductions Telecommunications: keeping record of calls made, generating
monthly bills
Architecture
catalog
Databases are self-describing: catalog describes the structure of the data stored in the DB
Client-server Architecture
Two-tier architecture: E.g. client programs using ODBC/JDBC to communicate with a database Three-tier architecture: E.g. web-based applications, and applications built using middleware