Vous êtes sur la page 1sur 21

Advanced Database Technology

Fundamental Notions of Database


Ho NGUYEN
College of Technology,
Vietnam National University, Hanoi

18 February 2013

Hoa.Nguyen@vnu.edu.vn

Definitions

Information system: model about some phenomena in the world - the Universe of Discourse - (e.g. an organization)

retrieves, updates and deletes these facts derives other facts from existing ones Data - raw facts/details of the model

DATABASE: A shared collection of logically related data (and a description of this data), designed to meet the organization needs of an organization Database Management System (DBMS): software that enables users to define, create and maintain the database and provides controlled access to the database

Advanced Database Technology Information Systems Department

nh ngha

M hnh h thng thng tin v mt s hin tng trong th gii v tr lun (v d nh mt t chc) truy xut, cp nht v xa cc s kin ngun gc s kin khc t nhng ci hin - Nguyn d liu s kin / chi tit ca m hnh DATABASE: Mt b su tp c chia s d liu mt cch hp l c lin quan (v mt m t d liu ny), c thit k p ng cc t chc nhu cu ca mt t chc H thng qun l c s d liu (DBMS): phn mm cho php ngi dng nh ngha, to ra v duy tr c s d liu v cung cp kim sot truy cp vo c s d liu
3

Advanced Database Technology Information Systems Department

Functions of a DBMS

Data storage, retrieval, update Lu tr d liu, phc hi, cp nht A user-accessible catalog Mt danh mc s dng Transaction support truy cp h tr giao dch Concurrency control kim sot ng thi Recovery services dch v phc hi Authorization services y quyn dch v H tr truyn thng d Support for data communication liu Integrity services tnh ton vn dch v d liu c lp Data independence dch v tin c Utility services
4

Advanced Database Technology Information Systems Department

Interacting with the DBMS Tng tc vi cc DBMS


DBMS Database

Application Programs

End Users

Advanced Database Technology Information Systems Department

Components of the Database Cc thnh phn ca c s d liu


DBA Staff casual users application programmers APPLICATION PROGRAMS Precompiler Query Processor DML statements Host Language Compiler

DDL STATEMENTS

PRIVILEGED COMMANDS

HIGH-LEVEL QUERY

DDL compiler

System Catalog/ Data

COMPILED TRANSACTIONS

Dictionary
Run time Database Processor

DML compiler

Database Manager STORED DATABASE


Advanced Database Technology Information Systems Department

Concurrency control/ Backup/Recovery Subsystems

Database Manager Components

Authorization control - check authorized to carry out operation Command processor - control of operation Integrity checker - updates checked against constraints Query Optimizer - determine optimal strategy for query Transaction Manager - controls transaction operations Scheduler - ensure concurrent operations do not conflict Recovery Manager - if failure returns to a consistent state Buffer Manger - transfer of data between memory and CPU Recovery Manager and Buffer Manger often referred to collectively as Data manager

Advanced Database Technology Information Systems Department

Qun l c s d liu thnh phn

Kim sot y quyn - t phng y quyn thc hin hot ng Lnh x l - kim sot hot ng Tnh ton vn kim tra - cp nht kim tra i vi cc rng buc truy vn ti u xc nh chin lc ti u cho truy vn Giao dch v qun l kim sot cc hot ng giao dch ln lch m bo hot ng ng thi khng xung t phc hi qun l - nu tht bi tr v mt nh nc thng nht m manger - chuyn giao d liu gia b nh v CPU phc hi qun l v b m mng c thng c gi chung l qun l d liu
8

Advanced Database Technology Information Systems Department

Interaction of DBMS with O/S Tng tc ca DBMS vi O / S


DBMS
request for stored record returned stored record

FILE MANAGER
request for stored page returned stored page

DISK MANAGER
disk I/O operation retrieved data

Physical record occurrences

Database

Advanced Database Technology Information Systems Department

Maintaining the Database


This is the task of the DBA: Maintaining information structure of the database (metadata in the Data Dictionary) Define user requirements of data usage Monitor use of database Determine and optimize storage structure and access strategies Define authorization checks Define strategies for backup and recovery Define testing procedures and changeover policy

Advanced Database Technology Information Systems Department

10

Duy tr c s d liu

y l nhim v ca DBA: Duy tr thng tin cu trc ca c s d liu (d liu meta trong t in d liu) Xc nh yu cu ngi s dng s dng d liu Mn hnh s dng c s d liu Xc nh v ti u ha cu trc lu tr v chin lc truy cp Xc nh kim tra y quyn Xc nh chin lc sao lu v phc hi Xc nh th tc kim tra v chnh sch chuyn i

Advanced Database Technology Information Systems Department

11

Data Models and Schemas M hnh d liu v lc

Data Model

Specifies the allowable logical structures and operations in a database. A DBMS operates always according to a specific data model eg. relational (M hnh d liu: Ch nh cc cu trc hp l cho php v hot ng trong mt c s d liu. DBMS chia tay lun lun theo mt m hnh c th v d nh d liu. quan h)

Database Schema (intension)

The description of a database for a particular universe of discourse which follows the rules layed down by the data model supported by the target DBMS (Lc c s d liu (tng thm):Cc m t ca mt c s d liu c th ca mt v tr lun theo cc quy tc layed xung bi m hnh d liu c h tr bi cc DBMS ch)

Advanced Database Technology Information Systems Department

12

3-levels Architecture 3-cp kin trc


EXTERNAL LEVEL (individual view) VIEW 1 01 BOOK 02 TITLE PIC X(30) 02 AUTHOR_NAME PIC X(20) VIEW 2 01 BOOK 02 TITLE PIC X(30) 02 PUBLISH_NAME PIC X(20) 02 YEAR PIC 9(4)

VIEW 1

VIEW 2

CONCEPTUAL LEVEL (community view)

Structural Properties & Constraints

BOOK TITLE CHARACTER(30 AUTHOR CHARACTER (20) PUBLISHER CHARACTER(20) YEAR NUMERIC (4) BOOKSHOP STORED_BOOK LENGTH=80 PREFIX TYPE=BYTE(6) TITLE TYPE=BYTE(30), INDEX=TITLE X AUTHOR TYPE=BYTE(20) etc

INTERNAL LEVEL (storage view)

Logical Representation of Stored Records

Advanced Database Technology Information Systems Department

13

Data Independence

Logical Data Independence: The capacity to change the conceptual schema without having to change the external schemas and their application programs .(Hp l d liu c lp: kh nng thay i lc khi nim m khng cn phi thay i cc lc bn ngoi v cc chng trnh ng dng ca h) Physical Data Independence: The capacity to change the internal schema without having to change the conceptual schema .(c lp d liu vt l: Kh nng thay i gin ni b m khng cn phi thay i cc lc khi nim.)

Advanced Database Technology Information Systems Department

14

Database Languages
External Level: mc ngoi
Application Programming End-user Facilities

One or more Host Languages e.g. COBOL, FORTRAN etc Embedded Sublanguage (DDL + DML)

Generalized Query Language (DDL + DML)

Specialized Query Language e.g. forms-driven, graphicsdriven, menu-driven etc

Conceptual Level: Mc Khi nim Data Definition Language (DDL) & Data Manipulation Language (DML) Ngn ng nh ngha d liu (DDL) Ngn ng thao tc d liu (DML)

Internal Level: Mc trong Data Definition Language (DDL)

Advanced Database Technology Information Systems Department

15

System Catalog

A system catalog contains the description of the database

Often referred to as the 'data dictionary'

For the relational data model the catalog is defined and interrogated using the same languages that can be used at the application level (i.e. DDL and DML) - but includes extra commands The catalog describes:

the basic make up of the data items base data views authorization data integrity constraints

Advanced Database Technology Information Systems Department

16

danh mc h thng

Mt danh mc h thng cha cc m t ca cc c s d liu Thng c gi l 'd liu t in i vi m hnh d liu quan h, danh mc c xc nh v thm vn bng cch s dng cng ngn ng c th c s dng mc ng dng (tc l DDL v DML) nhng bao gm cc lnh thm Danh mc m t: c bn ca cc mc d liu c s d liu views cho php d liu tnh ton vn rng buc
17

Advanced Database Technology Information Systems Department

Views

A view represents virtual data structures which are derived from base data structures (Xem Mt i din cho cu trc d liu o m c ngun gc t c s cu trc d liu) Views permit users to perceive the database in terms of derived data which correspond exactly to their applications (Xem cho php ngi s dng cm nhn c s d liu v d liu c ngun gc t tng ng chnh xc cho cc ng dng ca h) Views insulate programmers from base data and enable changes to definitions of base data without affecting application programs (Xem cch nhit cc lp trnh vin t c s d liu v cho php thay i nh ngha ca c s d liu m khng nh hng n cc chng trnh ng dng)
18

Advanced Database Technology Information Systems Department

Example of a View

BOOK Title Intro to DB Systems Author Date Publisher Addison-Wesley Year 1986

Fund. of DB Systems
London Fields 100 years of solitude The history man

Elmasri
Amis Marquez Bradbury

Addison-Wesley
Penguin Picador Arrow Books

1989
1989 1982 1977

CREATE VIEW NEW_BOOK AS SELECT TITLE, AUTHOR FROM BOOK WHERE YEAR>1988

at run-time
NEW_BOOK

Title
Fund. of DB Systems London Fields

Author
Elmasri Amis

Advanced Database Technology Information Systems Department

19

History

The first DBMS was designed by Bachman at GE in early 1960s


Bachman (Turing award 1973).

In 1970 Codd at IBM proposed a new data representation framework called the relational data model.
Codd (Turing Award 1981)

The SQL query for relational databases, developed as part of IBM's System R project, was standardized in the late 1980s. SQL-92, was adopted by ANSI (American National Standards Institute) and ISO (International Standards Organization). SQL-1999 added packages for data mining, spatial data, and text documents
SQL2003 : XML, Window functions, and sequences (Not free)

Advanced Database Technology Information Systems Department

20

History

In late 1980s and 1990s, several vendors (e.g. IBM's DB2, Oracle 8, Informix UDS) have extended their systems with the ability to store new data types such as images and text. Specialized systems developed for data warehouses, consolidating data from several databases. Entering the Internet Age, a new markup language XML is proposed for data access through a Web browser. As more and more data are collected, companies are also interested to mine useful information from their data.
21

Advanced Database Technology Information Systems Department

Vous aimerez peut-être aussi