Sunteți pe pagina 1din 40

Database Systems

LECTURE #:02

Shakra Mehak

FACULTY OF CS & IT
Outline

 The Hierarchy of Data


 What is a database system?
 What is a DBMS?
 When is a database system needed?
 Characteristic of database approach
 Database users
 Advantages of using DBMS approach
The Hierarchy of Data

 Record: a collection of related data fields


 File: a collection of related records
 Database: a collection of integrated and
related files
 Hierarchy of data: bits, characters, fields,
records, files, and databases
The Hierarchy of Data
 Bit (a binary digit): a circuit that is either on
or off
 Byte: eight bits
 Character: basic building block of data
 Each byte represents a character
 Can be an uppercase letter, lowercase letter, numeric digit, or special
symbol

 Field: typically a name, number, or


combination of characters that describes an
aspect of a business object or activity
The Hierarchy of Data
Database System
 A group of interacting, interrelated, or
interdependent elements forming a complex
whole.
 A system of hardware , software , peoples ,
and procedures required to develop , design
and maintain the database applications.
What is a database system?
When is a database system
needed?
Examples

Typical Environment
– Corporate Enterprise
– Data With Large Homogenous Parts (e.g., Formatted Data)
– Data Relevant Over a Long Time
– Data Used by Many Simultaneous Users (Batch and On-line
Users) for Retrieval & Update
Database System Environment

9
Elements of Database System
 Hardware
 Software
 Peoples
 DA
 DBA

 End User

 Procedures
 Business Rules

 Data
Database System Environment

 Hardware
 System’s Physical devices

 Computers

 Peripherals

 Network

11
Database System Environment

 Software
 Operating system:
 manages hardware components
 DBMS: manages database
 MS Access, SQL Server, Oracle, DB2
 Application and utility software:
 support access and manipulate data

12
Database System Environment
 People (five users)
 System administrator: hardware
system support
 Database administrator: manage

DBMS use
 Database designer: design database

structure
 System analysis and programmers:
implement application programs
 End users:
Database System Environment
 Procedures
 Instruction and rule that govern

the design and use of the


database system
 Data
What is a DBMS?
Database Management System is a general
purpose software system that facilitates the
process of
 defining,
 constructing and
 manipulating

database for various applications


DBMS Components
 Storage manager:
 Stores on disk: data, metadata, indexes, logs
 Query processor:
 Parses queries, optimizes by selecting query
plan, executes the plan on the data
 Transaction manager:
 Logs database changes to support recovery
after system crashes
 Supports concurrent execution of transactions
Main functions of DBMS
 Defining a Database:
Specifying Data Types, Structures, and Constraints

 Constructing a Database:
the Process of Storing the Data Itself on Some Storage Medium

 Manipulating a Database:
Function for Querying Specific Data in the Database and Updating the
Database
Additional functions of DBMS
 Interaction with File Manager
 So that Details Related to Data Storage and Access are Removed
From Application Programs
 Integrity Enforcement
 Guarantee Correctness, Validity, Consistency
 Security Enforcement
 Prevent Data From Illegal Uses
 Concurrency Control
 Control the Interference Between Concurrent Programs
 Recovery from Failure
 Restoring the system status
 Query Processing and Optimization
 Manipulation, Interpretation and optimization for resources
File Management
A computer system organizes data in a hierarchy that begins
with bits, and proceeds to bytes, fields, records, files, and
databases.
File Management -
Records can be arranged in several ways on a storage medium,
and the arrangement determines the manner in which
individual records can be accessed
 Sequential file organization data records must be retrieved in the same
physical sequence in which they are stored.
 Direct or random file organization, users can retrieve records in any
sequence, without regard to actual physical order on the storage medium.
 Indexed sequential access method (ISAM) uses an index of key fields to
locate individual records.
 Direct file access method uses the key field to locate the physical address of a
record. This process employs a mathematical formula called a transform
algorithm to translate the key field directly into the record’s storage location on
disk.
Problems in the File
Environment
Storing data in data files that are tightly linked to their
applications eventually led to organizations having hundreds
of applications and data files, with no one knowing what the
applications did or what data they required. There was no
central listing of data files , data elements or definitions of the
data.
Another Example:
Databases Approach
A database is an organized logical grouping of related files. In a
database, data are integrated and related so that one set of
software programs provides access to all the data, minimizing
the problems associated with data file environments
(data redundancy, data isolation, data inconsistency and data sharing).
Problems in the File system
Organizations typically began automating one application at a
time. These systems grew independently, without overall
planning. Requiring its own data organized into unique data
files
 Without proper systems management other problems arose:
.  Data redundancy: as applications and their data files were created by different
programmers over a period of time, the same data could be duplicated in
several files.
 Data inconsistency exist across various copies (the actual values in each file no
longer agree).
 Data isolation. Refers to the difficulty in accessing data from different
applications. Change in file’s data characteristics requires modification of data
access programs.
 Data integrity problems propagate more easily across multiple data files.
Problems with file systems

• Data is Unstructured:
– “Flat” Files

• Data Dependency:
• Change in file structure requires modification of related programs

• High Maintenance Costs:


– Data Dependence
– Ensuring Data Consistency and Controlling Access to Data (Concurrent Access
Problematic)
– Difficult to Understand by New Developers

• Difficulties in Developing New Applications


• Almost Impossible to Evolve with New
Capabilities
Database vs. File Systems

26
Database vs. File System
Coordinates Both Physical Coordinates Only the
and Logical Access to the Physical Access to the
Data Data
Data are Shared by All Data Written by One
Programs Authorized to Program May Not Be
Have Access to It Readable by Another
Program
Flexible Access to Data Pre-determined Access to
(i.e., Queries) Data (I.E., Compiled
Programs)
Multiple Users Accessing No Two Programs Can
the Same Data at Same Concurrently Access the
Time Same File
‘University’ database example

• Has 5 files (‘tables’):


 Student
 Course
 Section
 Grade Report
 Prerequisite
• See how do they relate to each other!
• How do we define, construct & manipulate?
Characteristic of Database
Approach

1. Self-describing nature
2. Insulation between program and data
3. Support of multiple views of data
4. Sharing of data & multiuser transaction
processing
1.Self-describing nature
• As oppose to unstructured data
• Contains not only database itself, but
also a complete definition of database
structure (metadata)
• In traditional file processing, data
definition is part of the application
program
2.Insulation between programs
& data
• Changes to the data structure does not
generally require changing the program
• For example, adding a new field ‘Birthday’
• The ‘data structure’ is not in the program
• We call this program-data independence
• DBMS provides conceptual representation
• User or programmer does not need to know
how the DBMS store the data in the disk /
file.
3.Multiple Views
 Many users, different needs
 Accessing & printing the transcript of each
students
 Checking that students have taken all the
prerequisite course
4.Sharing & Multiuser
• DBMS provides concurrency control to
ensure ‘correct’ behavior when multiple
users access the same database
• Example: airline seat reservation
• It is called On-Line Transaction
Processing (OLTP)
Database users
• Actors on the Scene
• Database administrator
 Authorizing access rights
• Database designers
 Defines the structure of data to be stored
• End users:
 Casual end user
 Naive/parametric user
 Sophisticated users
 Stand-alone users
Database users

• System analyst and Application programmers


(software engineers)
• Workers behind the Scene
• DBMS system designers and implementers
• Tool developers
• Operators and maintenance personnel
Functions of a DBMS
 Data Storage, Retrieval, and Update.
 A User-Accessible Catalog.
 Transaction Support.
 Concurrency Control Services.(multi-user
access of Database)
 Recovery Services.

37
Functions of a DBMS
 Authorization Services.
 Support for Data Communication.
 Integrity Services.
 Services to Promote Data Independence.
 Utility Services.

38
System Catalog
 Repository of information (metadata)
describing the data in the database.
 One of the fundamental components of
DBMS.
 Typically stores:
 names, types, and sizes of data items;
 constraints on the data;
 names of authorized users;
 data items accessible by a user and the type of
access;
 usage statistics. 39
Advantages of Using a DBMS
• Controlling redundancy
• Restricting unauthorized access
• Provides persistent storage for data
structures
• Multiple user interfaces
• Represents complex relations amongst data
• Enforcing integrity constraints
• Provides backup & recovery

S-ar putea să vă placă și