Documente Academic
Documente Profesional
Documente Cultură
LECTURE #:02
Shakra Mehak
FACULTY OF CS & IT
Outline
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
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
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
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
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