Sie sind auf Seite 1von 72

ChapterOne

Introductionto
DatabaseSystems

Chapter1Objectives
Somecommonusesofdatabasesystems.
Characteristicsoffilebasedsystems.
Problemswithfilebasedapproach.
Meaningofthetermdatabase.
MeaningofthetermDatabaseManagementSystem(DBMS).
TypicalfunctionsofaDBMS.
MajorcomponentsoftheDBMSenvironment.
PersonnelinvolvedintheDBMSenvironment.
HistoryofthedevelopmentofDBMSs.
AdvantagesanddisadvantagesofDBMSs.

Fundamentals of Database Systems (INSY


321)

12/14/15

Chapter1ObjectivesContd
PurposeofthreelevelANSISPARCdatabasearchitecture.
Contentsofexternal,conceptual,andinternallevels.
Purposeofexternal/conceptualandconceptual/internal

mappings.
Meaningoflogicalandphysicaldataindependence.
DistinctionbetweenDDLandDML.
Aclassificationofdatamodels.
ArchitectureforMultiUserDatabaseSystem

Fundamentals of Database Systems (INSY


321)

12/14/15

Database systems
Today, Databases are essential to

every business. They are used to


maintain internal records, to
present data to customers and
clients on the World-Wide-Web,
and to support many other
commercial processes.
Databases are likewise found at
the core of many modern
organizations.
4

Fundamentals of Database Systems (INSY


321)

12/14/15

ExamplesofDatabaseApplications
Purchasesfromthesupermarket
Purchasesusingyourcreditcard
Bookingaholidayatthetravelagents
Usingthelocallibrary
Takingoutinsurance
Rentingavideo
ECommerce
Banking
Socialmedia(ingeneraltheWWW)
5

Fundamentals of Database Systems (INSY


321)

12/14/15

Approaches in
Organizations
Data management passes through the different

levels of development along with the


development in technology and services. These
levels could best be described by categorizing
the levels into three levels of development.
Even though there is an advantage and a
problem to overcome at each new level, all
methods of data handling are in use even
today to some extent. The major three levels
are;
Manual Approach
Traditional File Based Approach
Database Approach
6

Fundamentals of Database Systems (INSY


321)

12/14/15

Manual Approach
Cards and paper are used for the purpose
Files for as many event and objects as the organization has are used to

store information.
Each of the files containing various kinds of information is labelled and
stored in one or more cabinets.
The cabinets could be kept in safe places for security purpose based on
the sensitivity of the information contained in it ( Cabinet Lockers).
Insertion and retrieval is done by searching first for the right cabinet
then for the right file then the information.
One could have an indexing system to facilitate access to the data
Limitations of the Manual approach
Prone to error
Difficult to update, retrieve, integrate
You

have the data but it is difficult to compile the information

Limited to small size information


Cross

referencing is difficult

Fundamentals of Database Systems (INSY


321)

12/14/15

FileBasedSystems
Collectionofapplicationprogramsthatperform

servicesfortheendusers(e.g.reports).

Eachprogramdefinesandmanagesitsowndata.

Fundamentals of Database Systems (INSY


321)

12/14/15

FileBasedProcessing

Fundamentals of Database Systems (INSY


321)

12/14/15

LimitationsofFileBasedApproach
Separationandisolationofdata
Eachprogrammaintainsitsownsetofdata.
Usersofoneprogrammaybeunawareof

potentiallyusefuldataheldbyotherprograms.

Duplicationofdata
Samedataisheldbydifferentprograms.
Wastedspaceandpotentiallydifferentvalues

and/ordifferentformatsforthesameitem.

10

Fundamentals of Database Systems (INSY


321)

12/14/15

LimitationsofFileBasedApproach
Datadependence(ProgramDataDependence)

Filestructureisdefinedintheprogramcode.
Anychangeinthedatastructurenecessitatesachangeinthe

programaswell

Incompatiblefileformats

Programsarewrittenindifferentlanguages,andsocannot

easilyaccesseachothersfiles.(C,COBOL)DataStructures
aredifferentfordifferentLanguages

FixedQueries/Proliferationofapplicationprograms
Programsarewrittentosatisfyparticularfunctions.
Anynewrequirementneedsanewprogram.

11

Fundamentals of Database Systems (INSY


321)

12/14/15

DatabaseApproach
Problemsoffileapproacharosebecause:

Definitionofdatawasembeddedinapplicationprograms,

ratherthanbeingstoredseparatelyandindependentofthe
applications.
Nocontroloveraccessandmanipulationofdatabeyond
thatimposedbyapplicationprograms.
Solution(Result):

ThedatabaseandDatabaseManagementSystem(DBMS).
ThisapproachsolvestheproblemsoftheFilebased

Approach

12

Fundamentals of Database Systems (INSY


321)

12/14/15

Database
Sharedcollectionoflogicallyrelateddata(anda

descriptionofthisdata),designedtomeetthe
informationneedsofanorganization.

Systemcatalogue(metadata)providesdescription

ofdatatoenableprogramdataindependence.

Logicallyrelateddatacomprisesentities,

attributes,andrelationshipsofanorganizations
information.

13

Fundamentals of Database Systems (INSY


321)

12/14/15

DatabaseManagementSystem(DBMS)
Asoftwaresystemthatenablesuserstodefine,

create,maintain,andcontrolaccesstothe
database.

(Database)applicationprogram:acomputer

programthatinteractswithdatabasebyissuingan
appropriaterequest(SQLstatement)totheDBMS.

14

Fundamentals of Database Systems (INSY


321)

12/14/15

DatabaseManagementSystem(DBMS)

15

Fundamentals of Database Systems (INSY


321)

12/14/15

DatabaseApproachContd..
Datadefinitionlanguage(DDL).
Permitsspecificationofdatatypes,structuresandany

dataconstraints.
Allspecificationsarestoredinthedatabase.
EnablestheCreation,AlterationandRemovalofa
DatabaseObject
Datamanipulationlanguage(DML).

Generalenquiryfacility(querylanguageretrieval)ofthe

data.
Inadditiontoquerying,wecanalsohavemanipulationof
Data(AddingNewinfo,Updatinginfo,Deletinginfo)
16

Fundamentals of Database Systems (INSY


321)

12/14/15

DatabaseApproachAccessControl
Controlledaccesstodatabasemay

include:(User/Roledefinition,Privilege
Assignment/Revocation,Access
Enforcement)
asecuritysystem
anintegritysystem
aconcurrencycontrolsystem
arecoverycontrolsystem
auseraccessiblecatalogue.

17

Fundamentals of Database Systems (INSY


321)

12/14/15

DatabaseViews
TheDatabaseApproachintroducesalittle

complexityonthepartoftheenduser.
AlthoughtheDatabaseisasharedcollection,users
areinterestedintheirspecificdataneeds
Aviewallowseachusertohavehisorherown
viewofthedatabase.
Aviewisessentiallysomesubsetofthedatabase.
DataIrrelevanttoauserisnotatallvisible

18

Fundamentals of Database Systems (INSY


321)

12/14/15

ViewsBenefits
Reducecomplexity
Providealevelofsecurity
Provideamechanismtocustomizetheappearance

ofthedatabase
Presentaconsistent,unchangingpictureofthe
structureofthedatabase,eveniftheunderlying
databasestructureischanged

19

Fundamentals of Database Systems (INSY


321)

12/14/15

ComponentsofDBMSEnvironment

20

In A DBMS Environment there are Five basic


Components
Hardware
Software
Data
Procedure
People
Fundamentals of Database Systems (INSY
12/14/15
321)

ComponentsofDBMSEnvironment
Hardware
CanrangefromaPCtoanetworkofcomputers.
Includesallthenecessaryinput,output,storage

andbackupdevices
Software
DBMS,operatingsystem,networksoftware(if
necessary)andalsotheapplicationprograms.
Data
Datausedbytheorganizationandadescriptionof

thisdatacalledtheschema.

21

Fundamentals of Database Systems (INSY


321)

12/14/15

ComponentsofDBMSEnvironment
Procedures
Instructionsandrulesthatshouldbeappliedto

thedesignanduseofthedatabaseandDBMS.
People

DifferentRolestakenbypeoplewhiledesigningand

usingaDatabasesystems

22

Fundamentals of Database Systems (INSY


321)

12/14/15

RolesintheDatabaseEnvironment
DataAdministrator(DA)
Responsible on management of data resources.

This involves in database planning, development,


maintenance of standards policies and procedures
at the conceptual and logical design phases.
DatabaseAdministrator(DBA)
This is more technically oriented role. DBA is

responsible for the physical realization of the


database. It is involved in physical design,
implementation, security and integrity control of
the database.
AlsodealswithOptimizingtheperformanceofthesystem

23

Fundamentals of Database Systems (INSY


321)

12/14/15

Database Designers
DatabaseDesigners(LogicalandPhysical)
Identifies the data to be stored and choose the

appropriate structures to represent and store the


data.
Should understand the user requirement and
should choose how the user views the database.
Involve on the design phase before the
implementation of the database system.
We have two distinctions of database

designers, one involving in the logical


&conceptual design and another
involving in physical design.
24

Fundamentals of Database Systems (INSY


321)

12/14/15

Database DesignersContd
Logical and Conceptual DBD
Identifies data (entity, attributes and relationship) relevant to the
organization
Identifies constraints on each data
Understands data and business rules in the organization
Sees the database independent of any data model at conceptual
level and considers one specific data model at logical design
phase.
Physical DBD
Takes logical design specification as input and decide how it

should be physically realized.


Maps the logical data model on the specified DBMS with respect
to tables and integrity constraints. (DBMS dependent designing)
Selects specific storage structure and access path to the
database
Designs security measures required on the database
25

Fundamentals of Database Systems (INSY


321)

12/14/15

Application Programmers
System analyst determines the user

requirement and how the user wants to


view the database.
The application programmer implements
these specifications as programs; code,
test, debug, document and maintain the
application program.
The application programmer
determines the interface on how to
retrieve, insert, update and delete
data in the database.
26

Fundamentals of Database Systems (INSY


321)

12/14/15

EndUsers(naiveandsophisticated)
Nave Users:
Sizable proportion of users
Unaware of the DBMS
Only access the database based on their access
level and demand
Use standard and pre-specified types of queries.
Sophisticated Users
Users familiar with the structure of the Database

and facilities of the DBMS.


Have complex requirements
Have higher level queries

27

Fundamentals of Database Systems (INSY


321)

12/14/15

HistoryofDatabaseSystems
Firstgeneration

HierarchicalandNetwork

Secondgeneration
Relational

Thirdgeneration

ObjectRelational
ObjectOriented

28

Fundamentals of Database Systems (INSY


321)

12/14/15

AdvantagesofDBMSs
Controlofdataredundancy
Dataconsistency
Moreinformationfromthesameamountofdata
Sharingofdata

Improveddataintegrity
Improvedsecurity
Enforcementofstandards
Economyofscale

29

Fundamentals of Database Systems (INSY


321)

12/14/15

AdvantagesofDBMSs
Balanceconflictingrequirements
Improveddataaccessibilityandresponsiveness
Increasedproductivity
Improvedmaintenancethroughdataindependence
Increasedconcurrency
Improvedbackupandrecoveryservices

30

Fundamentals of Database Systems (INSY


321)

12/14/15

DisadvantagesofDBMSs
Complexity
Size
CostofDBMS
Additionalhardwarecosts
Costofconversion
Performance
Higherimpactofafailure

31

Fundamentals of Database Systems (INSY


321)

12/14/15

ObjectivesofThreeLevelANSISPARC
Architecture
Allusersshouldbeabletoaccesssamedata.
Ausersviewisimmunetochangesmadeinother

usersviews.

Usersshouldnotneedtoknowphysicaldatabase

storagedetails.

32

Fundamentals of Database Systems (INSY


321)

12/14/15

ObjectivesofThreeLevelANSISPARC
Architecture
DBAshouldbeabletochangedatabasestorage

structureswithoutaffectingtheusersviews.

Internalstructureofdatabaseshouldbeunaffected

bychangestophysicalaspectsofstorage.

DBAshouldbeabletochangeconceptualstructure

ofdatabasewithoutaffectingallusers.

33

Fundamentals of Database Systems (INSY


321)

12/14/15

ANSISPARCThreeLevelArchitecture

34

Fundamentals of Database Systems (INSY


321)

12/14/15

ANSISPARCThreeLevelArchitecture
ExternalLevel

Usersviewofthedatabase.
Describesthatpartofdatabasethatisrelevanttoa

particularuser.

ConceptualLevel

Communityviewofthedatabase.
Describeswhatdataisstoredindatabaseand

relationshipsamongthedata.

35

Fundamentals of Database Systems (INSY


321)

12/14/15

ANSISPARCThreeLevelArchitecture
InternalLevel
Physicalrepresentationofthedatabaseonthe

computer.
Describeshowthedataisstoredinthedatabase.
ThisishowtheOSandDBMSviewData

36

Fundamentals of Database Systems (INSY


321)

12/14/15

DifferencesbetweenThreeLevelsof
ANSISPARCArchitecture

37

Fundamentals of Database Systems (INSY


321)

12/14/15

DataIndependence
MainConceptisUpperlayersareimmuneto

changesinthelowerlayers
LogicalDataIndependence

Referstoimmunityofexternalschemastochangesin

conceptualschema.
Conceptualschemachanges(e.g.addition/removalof
entities)shouldnotrequirechangestoexternal
schemaorrewritesofapplicationprograms.
Obviouslyparticularuserswillbeaffectedbutnotall
users
38

Fundamentals of Database Systems (INSY


321)

12/14/15

DataIndependence
PhysicalDataIndependence
Referstoimmunityofconceptualschematochangesin

theinternalschema.
Internalschemachanges(e.g.usingdifferentfile
organizations,storagestructures/devices)shouldnot
requirechangetoconceptualorexternalschemas.

39

Fundamentals of Database Systems (INSY


321)

12/14/15

Schema Mapping- Provision for


Data Independence
ANSI-SPARC has three Layers of Describing

Organizational Data
The DBMS is responsible for mapping between these

three types of schema.


External/Conceptual Mapping
This enables the DBMS to map names in the users

view on to the relevant part of the conceptual schema.


Conceptual/Internal Mapping
This enables the DBMS to find the actual record or

combination of records in physical storage that


constitute a logical record in the conceptual schema,
together with any constraints to be enforced on the
operations for that logical record.
40

Fundamentals of Database Systems (INSY


321)

12/14/15

DataIndependenceandtheANSISPARC
ThreeLevelArchitecture

41

Fundamentals of Database Systems (INSY


321)

12/14/15

DatabaseLanguages
DataDefinitionLanguage(DDL)
AllowstheDBAorusertodescribeandname

entities,attributes,andrelationshipsrequiredforthe
application
plusanyassociatedintegrityandsecurityconstraints.

42

Fundamentals of Database Systems (INSY


321)

12/14/15

DatabaseLanguages
DataManipulationLanguage(DML)

Providesbasicdatamanipulationoperationsondata

heldinthedatabase.

ProceduralDML

allowsusertotellsystemexactlyhowtomanipulate

data.

NonProceduralDML

allowsusertostatewhatdataisneededratherthan

howitistoberetrieved.

FourthGenerationLanguages(4GLs)
AutomatedCASEtools

43

Fundamentals of Database Systems (INSY


321)

12/14/15

DataModel
Defined:Integratedcollectionofconceptsfordescribingdata,relationships
betweendata,andconstraintsonthedatainanorganization.
DataModelcomprises:
astructuralpart;
amanipulativepart;
possiblyasetofintegrityrules.

CanhaveThreetypesofModels(InlinewithANSISPARC)
1. anexternaldatamodel,torepresenteachusersviewofthe

organization,sometimescalledtheUniverseofDiscourse(UoD);
2. aconceptualdatamodel,torepresentthelogical(orcommunity)view
thatisDBMSindependent;
3. aninternaldatamodel,torepresenttheconceptualschemainsuchaway
thatitcanbeunderstoodbytheDBMS.

44

Fundamentals of Database Systems (INSY


321)

12/14/15

DataModel
Purpose
Torepresentdatainanunderstandableway.

Categoriesofdatamodelsinclude:
Objectbased
Recordbased
Physical.

45

Fundamentals of Database Systems (INSY


321)

12/14/15

DataModels
ObjectBasedDataModels

basedontheconceptofEntity(distinctobject)
EntityRelationshipConsidersonlythedataaspect
ObjectOrientedconsidersbothdataandbehaviour.

RecordBased Data Models (Hierarchical, Network and

Relational)
basedonfixedformatrecords
Eachrecordhasfixednumberoffields
eachfieldisofafixedlength

PhysicalDataModels
Modelsfordescribingphysicalstoragecharacterstics
Fundamentals of Database Systems (INSY
321)

12/14/15

Hierarchical Data Models


Record type is referred to as node or segment
The top node is the root node
Nodes are arranged in a hierarchical structure as

sort of upside down tree


A parent node can have more than one child node
A child node can only have one parent node
The relationship between parent and child is oneto-many
Relation is established by creating physical link
between stored records (implemented as pointer)
To add new record type or relationship, the
database must be redefined and then stored in a
new form.
47

Fundamentals of Database Systems (INSY


321)

12/14/15

HierarchicalDataModel

48

Fundamentals of Database Systems (INSY


321)

12/14/15

Network Data model


Allows record types to have more than

one parent unlike hierarchical model


A network data models sees records as
set members
Each set has an owner and one or more
members
Allows many to many relationship
between entities
Like hierarchical model network model is
a collection of physically linked records.
Allow member records to have more than
one owner
49

Fundamentals of Database Systems (INSY


321)

12/14/15

NetworkDataModel

50

Fundamentals of Database Systems (INSY


321)

12/14/15

1st Generation Data


Models
Hierarchical and Network
Navigational and procedural

approach to data processing


Need to know the physical
Database to access the data
Treat records as individual
objects linked with pointers i.e.
cannot process in sets

51

Fundamentals of Database Systems (INSY


321)

12/14/15

Relational Data Model (2nd


Gen.)
Relational

Model for Large Shared Data Banks famous paper of Dr. Edgar F.

Codd
Terminologies originates from the branch of mathematics called set theory and
predicate logic and is based on the mathematical concept called Relation
Can define more flexible and complex relationship
Viewed as a collection of tables called Relations equivalent to collection of
record types
Relation: Two dimensional table
Stores information or data in the form of tables rows and columns
A row of the table is called tuple equivalent to record
A column of a table is called attribute equivalent to fields
Data value is the value of the Attribute
Records are related by the data stored jointly in the fields of records in two
tables or files. The related tables contain information that creates the
relationship
Uses Declarative ( as Opposed to Procedural) approach to Database
Processing
Can Treats Records as a Group (Set)

52

Fundamentals of Database Systems (INSY


321)

12/14/15

RelationalDataModel

53

Fundamentals of Database Systems (INSY


321)

12/14/15

PhysicalDataModels
Used in Internal Database Design
structure / Class/ Type Def

Eg. Frame Memory, Unifying Model

54

Fundamentals of Database Systems (INSY


321)

12/14/15

ConceptualModelling
Conceptualschemaisthecoreofasystemsupportingall

userviews.
Shouldbecompleteandaccuraterepresentationofan
organizationsdatarequirements.

Conceptualmodellingisprocessofdevelopingamodelof

informationuseinanorganizationthatisindependentof
implementationdetailssuchasthetargetDBMS,
applicationprograms,programminglanguages,orany
otherphysicalconsiderations.
Resultisaconceptualdatamodel.
55

Fundamentals of Database Systems (INSY


321)

12/14/15

Logical Modeling
Conceptual models are also referred to

as logical models in the some


literature.
However, critically thinking, we make
a distinction between conceptual and
logical data models.
The conceptual model is independent
of all implementation details, whereas
the logical data model assumes
knowledge of the underlying data
model of the target DBMS.
56

Fundamentals of Database Systems (INSY


321)

12/14/15

FunctionsofaDBMS
DataStorage,Retrieval,andUpdate.
AUserAccessibleCatalog.
TransactionSupport.
ConcurrencyControlServices.
RecoveryServices.

57

Fundamentals of Database Systems (INSY


321)

12/14/15

FunctionsofaDBMS
AuthorizationServices.
SupportforDataCommunication.
IntegrityServices.
ServicestoPromoteDataIndependence.
Utility Services( Import/Export, Task scheduler,

etc)

58

Fundamentals of Database Systems (INSY


321)

12/14/15

SystemCatalog
Repositoryofinformation(metadata)describing

thedatainthedatabase.
OneofthefundamentalcomponentsofDBMS.
Typicallystores:
names,types,andsizesofdataitems;
constraintsonthedata;
namesofauthorizedusers;

dataitemsaccessiblebyauserandthetypeofaccess;
usagestatistics.

59

Fundamentals of Database Systems (INSY


321)

12/14/15

ComponentsofaDBMS

60

Fundamentals of Database Systems (INSY


321)

12/14/15

ComponentsofDatabaseManager(DM)

61

Fundamentals of Database Systems (INSY


321)

12/14/15

Multi-User DBMS Architectures


There are Common architectures that

are used to implement multi-user


database management systems,
Teleprocessing,
File-server, and
Clientserver.

62

Fundamentals of Database Systems (INSY


321)

12/14/15

Tele-Processing
The traditional architecture for multi-user

systems was teleprocessing, where there is


one computer with a single central
processing unit (CPU) and a number of
terminals
User terminals are typically dumb ones,
incapable of functioning on their own. Just
cabled to the main computer.

63

Fundamentals of Database Systems (INSY


321)

12/14/15

Disadvantage
Unfortunately, this architecture placed a

tremendous burden on the central


computer, which not only had to run the
application programs and the DBMS, but
also had to carry out a significant amount
of work on behalf of the terminals (such as
formatting data for display on the screen).

64

Fundamentals of Database Systems (INSY


321)

12/14/15

File-Server Architecture
In a file-server environment, the processing is

distributed about the network, typically a local


area network (LAN). The file-server holds the
files required by the applications and the DBMS.
However, the applications and the DBMS run on
each workstation requesting files from the fileserver when necessary.
In this way, the file-server acts simply as a
shared hard disk drive. The DBMS on each
workstation sends requests to the file-server for
all data that the DBMS requires that is stored on
disk.
65

Fundamentals of Database Systems (INSY


321)

12/14/15

File-Server Contd

66

Fundamentals of Database Systems (INSY


321)

12/14/15

The file-server architecture three main disadvantages


(1) There is a large amount of network

traffic.
(2) A full copy of the DBMS is required on
each workstation.
(3) Concurrency, recovery, and integrity
control are more complex because there
can be multiple DBMSs accessing the same
files at the same time.

67

Fundamentals of Database Systems (INSY


321)

12/14/15

ClientServer Architecture
To overcome the disadvantages of the first

68

two approaches and accommodate an


increasingly decentralized business
environment, the clientserver architecture
was developed.
Clientserver refers to the way in which
software components interact to form a
system.
As the name suggests, there is a client
process, which requires some resource, and
a server, which provides the resource.
There ofisDatabase
no requirement
that the client and
Fundamentals
Systems (INSY
12/14/15
321)
server must reside on the same machine.

Possible combinations of the


clientserver topology.

69

Fundamentals of Database Systems (INSY


321)

12/14/15

Traditional Two tier


Applications

70

Fundamentals of Database Systems (INSY


321)

12/14/15

Two Tier- Problems


The need for enterprise scalability challenged this

traditional two-tier clientserver model.


In the mid-1990s, as applications became more
complex and potentially could be deployed to
hundreds or thousands of end-users, the client
side presented two problems that prevented true
scalability:
A fat client, requiring considerable resources on
the clients computer to run effectively. This
includes disk space, RAM, and CPU power.
A significant client-side administration overhead.
Solution is to go for Three Tier- Architecture
71

Fundamentals of Database Systems (INSY


321)

12/14/15

Three tier-Client Server Architecture

72

Fundamentals of Database Systems (INSY


321)

12/14/15

Das könnte Ihnen auch gefallen