Download IT 244 Database Management System

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Oracle Database wikipedia , lookup

IMDb wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Concurrency control wikipedia , lookup

Database wikipedia , lookup

ContactPoint wikipedia , lookup

Relational model wikipedia , lookup

Clusterpoint wikipedia , lookup

Database model wikipedia , lookup

Transcript
IT 244
Database Management System
Lecture 1 – 14 / 02 /07
Course Information
&
Introduction to Database & DBMS
Topic 1 – Introduction
• Evolution of Database Systems:
– Data >> Database vs Database Management
– Compare ways DATA is organized:
• Word processor (document production)
• Spreadsheets (numerical analysis)
• Traditional File Management (mini computers storage
& retrieval)
• Database (data management)
– Advantages and Disadvantages
Ways data is organized in…
Word Processor
Characters in
group of words
Spreadsheet
Data are placed in
unique cells
Words in group of
line
Cells arranged in
rows and columns
Lines in group of
paragraph
R & C in different
worksheet in one
spreadsheet
Paragraph in group
of pages ,, in files
Data items have
data types like $,
text etc.
Free format
Unstructured
More uniformity
&
Structured,
progress
Traditional FS
Information about
one entity on one
file
Each file is
accessed by its
own specially
written program
Improvement over
spreadsheets
Database
Data is stored physically
in one location –
database
Special DBM is used to
manage the storage and
access to the data
Data are all in one
database but kept in
separate logical units or
tables.
DBMS then provides
users with one interface
to access the database
with presentable
information as preferred.
Spreadsheet Format – Store data in rows and columns :
Patient
Adm. Date
Disc. Date
Bed
No.
Ward Doctor
No.
Contacts
John Smith
Jim Words
James Cola
Richard Sam
Judy Parson
Lezek Mash
12-03-98
12-03-98
12-03-98
15-03-98
20-04-98
25-05-98
17-03-98
22-03-98
22-03-98
30-03-98
25-04-98
30-05-98
21
22
23
12
14
3
2
2
3
1
3
4
23432
23432
56783
56765
67876
56789
Black
Black
Price
Carey
Samson
Price
Several things to note about the above table:
Data to be stored has uniform format. Same kind of information
about each patient
1. File size will increase as the number of patient records
increases
2. Frequently accessing the table for new or existing patients
3. Table will be useful for all like the doctor or administrators
Potential problems that can arise:
• Patients increase – file size too so access
to the table will become slower and slow
when access concurrently;
• Takes time to manipulate the table ie. Get
specific information, correct an error,
repetition of data will have to be dealt with.
Traditional File Systems
• Information system specialist became aware of the
problems
• So they devised ways of managing them.
• Rather then keeping data in a single large file,
• Data was separated into many different files according to
the nature of the information to be stored.
• Then special software programs were written to manage
the files.
• These programs could perform tasks such as:
–
–
–
–
add new records
update old ones;
search for selected data within files
and deleted unwanted records.
Traditional File System
• Thus: The data about the Hospital patients in the
spreadsheet can be separated into the following
files under the traditional file system.
File
Patients
Doctor
Ward
Room
Information Stored
- Surname, First name, age, date
admitted, date discharged
- Surname, First name, Phone contact
- Ward number, number of rooms
- Room number, beds, ward number
Traditional method of file management
Patients
Patients program
Users
Doctors
Doctors program
Users
Wards
Wards program
Users
Rooms
Rooms program
Users
Traditional method of file management
• Although this is an improvement over the spreadsheet
method of storing and accessing data, there are still
some problems.
• For instance, information about the wards is closely
related to the information about rooms but they are in
different files. How do you link them ? Often extra
programming effort.
• Not every organization can afford to have a programmer
• Getting access to the required information often takes a
number of steps.
• To speed up the retrieval of information you can create
indexes for the file and/or split it up to avoid repetition of
information and reduce the total size of the file.
Disadvantages of TFM
Since data is stored in many related files you can
end up with:
• Data redundancy – keeping many copies of the same
type of data
• Data inconsistency – updating some of the copies but not
the others
• Data Dependency – data access is tied to the program so
change in data will also change in programs
• Excessive maintenance and upgrade costs – Modifying
the programs and structure of the data files require a lot
of effort.
The Evolution of Database
System
• What is a database:- is nothing more than
a collection of information that exists over
a long period of time.
• The term database refers to a collection
of data that is managed by a DBMS
DATABASE
A collection of data that is managed and organized
by a DBMS. Not all collection of data are
databases. Databases have the following
characteristics:
1. They represent some aspects of the real world
•
Hospital patients
2. They are logically coherent and have some meaning
•
Related in some way
•
Information has some meaning.
3. They are created for specific purposes.
•
Information for a specific purposes.
Database Approach
User 1
User 3
Patients
Doctors
Ward
Room
Database
Management
System
User 6
User 9
User 12
Data are all in one database but kept in a separate logical units or tables.
The DBMS provides users with one interface to access the database and
present the database information to each users according to preferences.
Advantages of Database approach
1. Data independence – data items no longer tied to the
programs
2. Reduction of data redundancy and inconsistency – Only one
copy of each data item is stored
3. Consolidation of data management – Just one software
program DBMS to manage access to the database
4. Can be used in multi-user environment – More people can
used at once
5. Security restrictions can be applied. – Security features can
be build into the DBMS to restrict and protect the data.
6. The integrity of the data can be maintained – accuracy and
reliability of the data
7. Standard can be enforced – adhere to organizational policies
What is a Database Management
System (DBMS)
• A Database Management System (DBMS)
is a software system designed to store,
manage, and facilitate access to
databases.
In other words:
A collection of programs that enables you
to store, modify, and extract information
from a database. (Webopedia Computer Dictionary)
DBMS
• DBMS is a powerful tool for creating and
managing large amounts of data
efficiently and allowing it to keep over long
periods of time safely
• These systems are among the most
complex types of software available.
Capabilities that a DBMS
provides
• Persistent Storage – like a file system –
support very large amounts of data that
exists independently of any processes that
are using the data.
- DBMS goes far beyond the file system in
providing flexibility, such as data structures
that support efficient access to very large
amounts of data
Capabilities that a DBMS
provides
• Programming Interface :- DBMS allows the
user or an application program to access
and modify data through a powerful query
language
- Again the advantage of a DBMS over a
file system is the flexibility to manipulate
stored data in much more complex
ways than the reading and writing of
files.
Capabilities that a DBMS
provides
• Transaction Management :- DBMS support
concurrent access to data –i.e.
simultaneous access by many distinct
processes (called transactions) at once
DBMS was expected to:• Allow user to create new database and
specify schema
• Give users the ability to query the data
• Support the storage of very large amount
of data
• Control access to data from many users at
once
Early Database Management
System
• First commercial database management
systems appeared in the late 1960’s
• These systems evolved from file system
(File systems store data over a long period
of time and they allow the storage of large
amounts of data)
Application of DBMS
• Airline Reservation Systems
In this type of System, the item of data
include:- Reservations by customers
- Information about flights – (airports they fly
from and to, departure and arrival time,
aircraft flown etc)
- Information about tickets (such as prices,
requirements and availability)
Application of DBMS
• Banking Systems
- Include names and addresses of
customers, accounts, loans etc.
- as with airlines reservation system, we
expect many tellers and staff or customers
querying and modifying the bank’s data at
once
Summary
• Course administrative matters
• How the concept of Database approach
developed
• Files structure
• Users
• Database
• DBMS
• End of Lecture
Problems EDBMS
• File systems do not generally guarantee
that data can not be lost if it is not backed
up
• They do not support efficient access to
data items whose location in a particular
file is not known
• File systems do not directly support a
query language for the data files
Problems EDBMS
• Their support for a schema for the data is
limited to the creation of directory
structures for files
• File system do not satisfy concurrent
access to files by several users or
processes
Simultaneous access
• Avoiding consequences of simultaneous
access DBMS support
i) isolation: - the appearance that
transactions execute one at a
time
ii) atomicity:- the requirement that
transactions either completely or
not at all
iii) durability:- the ability to recover from
failure or errors of many types
Application of DBMS
• The first important applications of DBMS
were one where:- Data was composed of many small items
- Many queries or modifications were
made
Application of DBMS
• IT IS VITAL THAT SIMULTANEOUS
ACCESSES TO AN ACCOUNT NOT
CAUSE THE EFFECT OF A
TRANSACTION TO BE LOST.
• FAILURE CANNOT BE TOLERATED.
Relational Database Systems
• Following a famous paper written by Ted
Codd in 1970’s
• Database system changed significantly
• Codd proposed that database systems
should present the user with a view of data
organized as tables called relations
Relational Database Systems
• Behind the scenes, there might be a
complex data structure that allow rapid
response to a variety of queries. But unlike
the user of earlier database systems, the
user of a relational system would not be
concern with the storage structure.
Queries could be expressed in a very
high-level language, which greatly
increased the efficiency of database
programmers
Relational Database Systems
• Relations and Tables
- Columns are
headed by attributes
which describe the
entries in the column
Eg. A relation named
Accounts recording
Bank Account,
Balance and Type
might look like:
Acc
No
Balance Type
123
100.00
456
2000.00 Check
…
…
Sav
…
Relational Database Systems
• Heading the columns are the attributes
- Account No
- Balance
-Type
Relational Database Systems
• Below the attributes are the Rows or
Tuples
• The table show two tuples of the relation
explicitly, and the dots below them suggest
that there would be many more tuples.
Relational Database Systems
• Suppose we want to know the balance of
account 456. We could ask this query in
SQL as follows
SELECT account No
FROM Accounts
WHERE accountNo = 456
Relational Database Systems
• Do NOT expect that this example is
enough to make you an expert SQL
programmer, but it should convey the highlevel nature of the SQL “Select-FromWhere” statement
Relational Database Systems
• In principle, they ask the DBMS to:
1. Examine all the tuples of the Relation
Accounts mentioned in the FROM clause
2. Pick out those tuples that satisfy some
criterion indicated in the WHERE clause and
3. Produce as an answer certain attributes of
those tuples as indicated in the SELECT
clause
In practice, the system must “optimize” the query and
find an efficient way to answer the query, even though
the relations involved in the query may be very large.
Smaller and Smaller Systems
• Originally, DBMS were large, expensive
software running on large computers
• Size was necessary because to store
large amount of data require large
computer system
• To day many gigabytes fit on a single disk
• Size Decrease, Capacity and power
increases.
Bigger and Bigger Systems
• On the other hand, a gigabyte isn’t much data.
• Corporate database often occupy hundreds of
gigabyte
• As storage become cheaper people find new
reasons to store greater amount of data
• Database no longer focus on storing simple data
item (integer or short string of characters) – but
can store images, audio and video and many
other kind of data.
Bigger and Bigger Systems
• Handling such large database require
technological advances
eg. Database of modest size are today stored on arrays
of disks which are called secondary storage device.
(compared to main memory which is primary storage)
• The fact that database systems routinely
assume data is too big to fit in main
memory and must be located primarily on
disk at all times
Bigger and Bigger Systems
• Trends that allow database systems to
deal with large amounts of data faster:
- Tertiary Storage:- tertiary storage devices perhaps storing a tera-byte
each.
- require much more time to access a given item
than does a disk
- involve transporting an object, upon which the
desired data item is stored to a reading device
Bigger and Bigger Systems
- Parallel Computing
- the ability to store enormous volumes of data is
important but it would be of little use if we could not
access large amounts of data quickly
- thus very large databases also require speed
enhancers.
- parallel Computing handle such problem
Client Server and Multi-Tier
Architectures
• Client – server architecture (Two-Tier) – a
request by one process (the client) are
send to another process (the server) for
execution
• N-Tier –DBMS continues to act as a
server, but its client is typically an
application server.
Client Server and Multi-Tier
Architectures
• Application server in a N-Tier manage
connections to the database, transactions,
authorization and other aspects.
• Application Servers in turn have clients
such as Web servers, which support endusers or other application.
Summary
•
•
•
•
•
•
•
The worlds of Database Systems
The evolution of Database Systems
Early Database Management Systems
Relational Database System
Smaller and Smaller Systems
Bigger and Bigger Systems
Client Server and Multi-Tier Architecture