Você está na página 1de 42

DBMS

Lecture 3

History of Database
File System
3 Levels of Abstraction
Types of Databases
Components of DBMS
Zeshan Ahmer
Brief History of Database Systems

 1940's, 50's Initial use of computers as


calculators. Limited data, focus on algorithms.
Science, military applications
 1960's Business uses. Organizational data,
customer data, sales, inventory, accounting, etc.
File system based, high emphasis on
applications programs to extract and assimilate
data. Larger amounts of data, relatively simple
calculations
2
 1970's The relational model. Data separated into
individual tables. Related by keys. Initially
required heavy system resources. Examples:
Oracle, Sybase, Informix, IBM DB2

 1980's Microcomputers - the IBM PC, Apple


Macintosh. Database program such as DBase,
Paradox, FoxPro, MS Access. Individual user
can create, maintain small databases
3
 Late- 1980's Local area networks. Workgroups
sharing resources such as files, printers, e-mail

 Client/Server Database resides on a central


server, applications programs run on client PCs
attached to the server over a LAN
 1990's Internet and World Wide Web make
databases of all kinds available from a single type
of client - the Web Browser
4
Before
Beforewe
wehave
haveDBMS
DBMS

Applications Data Files

Inventory
User
Control

Customer
User
Order

Question: When a customer ordered 10 PC


monitors, how many files do you have to update? Key issues: data sharing,
data redundancy
5
AASimple
SimpleArchitecture
Architecture

SQL

DBMS

C/C++
Programs Shared facilities:
• Backup and recovery
• Data storage and Databases
Applications access modules
• Programming tools,
etc. 6
File Systems

 File System is a collection of


individual files accessed by
applications programs

7
Limitations of a File System
 Separated and Isolated Data - Coordination and
representation of data is difficult
 Data Duplication - Wastes space and can lead to
data integrity (inconsistency) problems
 Application Program Dependencies - Changes to a
single file can require changes to numerous
application programs
 Lack of Data Sharing - Difficult to control access to
files
8
Purpose
Purposeof
ofDatabase
DatabaseSystems
Systems

Database management systems were developed


to handle the difficulties caused by different
people writing different applications independently

9
Purposes
Purposesof
ofDatabase
DatabaseSystems
Systems

 A DBMS attempts to resolve the following


problems:
 Data redundancy and inconsistency by keeping one
copy of a data item in the database
 Difficulty in accessing data by providing query
languages
 Integrity problems by enforcing constraints (age > 0)
 Concurrent access by multiple users
 Security problems

10
Integrated Database Environment

 Byte
 Data-item or field
 Record
 File or Table
 Database
 Database management systems

11
 Unit of measurement of data

 One Byte - 8 bits

 Maximum value in one bit

 Maximum value in one byte

12
Integrated Database Environment Data
Storage Hierarchy

Database
File
Record

Field
Character
(byte)

13
Advantages of Database Approach

 Minimal data redundancy


 Data consistency and Integrity - by
controlling access and minimizing data
duplication
 Enforcement of standards
 Uniform security
14
 Application program independence - by storing
data in a uniform fashion

 Data Sharing - by controlling access to data


items, many users can access data concurrently

 Backup and Recovery

15
Disadvantages of Database Approach

 DBMS has High initial cost


 DBMS has High Overhead - requires
powerful computers
 DBMS are not special purpose software
programs e.g., contrast an accounting
software package like Quicken or
PeachTree with DBMS like MS Access
 Additional expertise required
16
Cost issue
 Related with developing DBMS
 Related with hardware cost
 Related with higher programming cost
/ user’s training
 Related with conversion cost

17
3-level architecture
 User/View Level v1 v2 v3

 Logical Level

 Physical Level

18
3-Level Architecture

 Logical Level:
 e.g. tables
 STUDENT (roll number, name)
 COURSE (roll number, course id, grade)

 Physical Level:
 how are these tables stored, how many bytes,
restrictions etc

19
 User/View Level, e.g.:
 v1: select roll number from student
 v2: select roll number , course id from course

20
Three
ThreeLevels
Levelsof
ofAbstraction
Abstraction

Payroll Inventory Sales


view 1 view 2 ..……... view n

Logical
Company database
view

Physical
Files on disks
view
21
View Level:
Define a subset of the database for a particular
application

Logical Level:
Describes data stored in database, and the
relationships among the data

22
Physical Level:
Describe how a record is stored on disks.
e.g., “Divide the customer records into 3
partitions and store them on disks 1, 2 and
3”

23
Databases
Types & Physical Locations

 Shared Databases
 Shared by users in an organization within one
location
 Typically found on local-area networks

24
Databases
Types & Physical Locations
 Distributed Databases
 Database stored on different computers in
different locations connected by a client / server
type of network

 Two methods are:


 Partitioning
 Duplicating
25
Databases
Types & Physical Locations

 Centralized Databases
 Database stored in one location that can be
accessed by different computers in different
locations via communication networks

26
Database Administrator (DBA)
 The person who co-ordinates all related
activities and needs for an organization’s
database
 Responsibilities include:
 database design, implementation and operation
 user coordination
 system security
 backup and recovery
 performance monitoring
27
 schema definition (‘logical’ level)
 Physical schema (storage structure,
access methods)
 schemas modifications
 granting authorizations

28
Components of DBMS
 Data

 Hardware

 Software

 Users

29
Contents of a Database

 A Database contains:

 User Data
 Metadata

 Indexes

30
User Data
 Data users work with directly by entering,
updating and viewing
 For our purposes, data will be generally
stored in tables with some relationships
between tables
 Each table has one or more columns. A
set of columns forms a database record

31
Meta Data

 Recall that a database is self


describing

 Metadata: Data about data

 Data that describe how user data are stored in


terms of table name, column name, data type,
length, primary keys, etc
32
 Metadata are typically stored in System tables or
System Catalog and are typically only directly
accessible by the DBMS or by the system
administrator. Have a look at the Database
Documenter feature of MS Access (under the tools
menu, choose Analyze and then Documenter)

 This tool queries the system tables to give all kinds


of Metadata for tables, etc. in an MS Access
database
33
Indexes
 In keeping with our desire to provide users with
several different views of data, indexes provide
an alternate means of accessing user data.
Sorting and Searching:
 An index for our new banking example might
include the account numbers in a sorted order
 Indexes allow the database to access a record
without having to search through the entire table
34
 Updating data requires an extra step: The
index must also be updated
 Example:
 Index in a book consists of two things:
1) A Keyword stored in order
2) A pointer to the rest of the information. In the
case of the book, the pointer is a page number

35
Roles Involve In Integrated Database Environment

 Database Administrator

 Application Programmers

 End-users

36
Files Management
Basic File Operations

 The operations possible on a file are:


 Open
 Close
 Save
 Save As
 Print
 Import / Export
 Upload / Download

37
Files Management
File Manipulation Operations
 Some operations are used for file
manipulation:
 Creation of tables
 Insertion of records
 Deletion of records
 Modification of records
 Sorting of records
 ……
38
Files Management
Types Of Files

 Data Files - contain only data

 Master File - contain relatively permanent records


that are periodically updated

 Transaction File - a temporary holding file that holds


all changes to be made to the master file

39
Files Management
Types Of Files

 Table Files
 Table files are permanent files containing
reference data used when processing
transaction files

 Report Files
 These are the collected contents of individual
repots or documents produced by the system

40
Files Management
Data Processing Methods

 Online Processing
 Also called “real-time” processing
 Transactions entered into a computer systems as
they take place, and update the master files as the
transactions occur
 Storage must be online and fast
 May require expensive infrastructure
 Used in financial institutions, airline etc
41
Files Management
Data Processing Methods
 Batch Processing
 Data collected over certain period of time in a
transaction file and then processed against a master
file all at one time
 Less expensive but slow procedure
 Uses “offline” storage method
 Widely used in financial institution’s computerized
system
42

Você também pode gostar