Académique Documents
Professionnel Documents
Culture Documents
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
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
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
Application Programs
End Users
DDL STATEMENTS
PRIVILEGED COMMANDS
HIGH-LEVEL QUERY
DDL compiler
COMPILED TRANSACTIONS
Dictionary
Run time Database Processor
DML compiler
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
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
FILE MANAGER
request for stored page returned stored page
DISK MANAGER
disk I/O operation retrieved data
Database
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
11
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)
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)
12
VIEW 1
VIEW 2
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
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.)
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)
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)
15
System Catalog
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
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
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
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
19
History
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)
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