事务管理

Download Report

Transcript 事务管理

数据库系统原理
叶 文
北京邮电大学
计算机学院
2013年2月,北京
Database System Concepts
YE Wen
School of Computer Science and Technology
Beijing University of Posts and Telecommunications
COURSE INTRODUCTION
Syllabus for Database System Principles
China Computing Curricula 2005/08 (CCC2005/08)
Body of Knowledge in Computer Science
Areas of Knowledge in Database Systems
Contents of Class Teaching
Basic Experiments on DB2 and Sybase
Course Design
Some Issues to Be Emphasized
PART 1
Syllabus for Database System Principles
The syllabus is about basic information about this course, such
as course overviews, lecture meetings, faculty, text book and
references, course objects and curricula, assignments and
projects, grading policy, and class policies, etc.
for more details, see the file Syllabus for Database System
Principles.doc attached
Database System is an essential part of Information
Management (IM) knowledge area specified in China
Computing Curricula 2008 by ACM and IEEE/CS
Syllabus for Database System Principles
(cont.)
In Beijing University of Posts and Telecommunications,
Database System Principles is a required course for about 450
juniors majoring in computer science and technology according
to the cultivation plans. This course is taught in Chinese and
English, and the English textbook used is DATABASE
SYSTEM CONCEPTS (Fifth Edition), written by Abraham
Silberschatz, etc..
Syllabus for Database System Principles
(cont.)
Course Contents
The teaching of Database System includes three parts, i.e.,
In-class teaching of Database System (48 teaching hours)
Basic after-class experiments on DB2, Sybase (17 teaching
hours)
Professional practice in DB2, Sybase (about 10 days, 40
teaching hours), i.e. Course Design
Syllabus for Database System Principles
(cont.)
SQL Server, DB2, Sybase technologies and products are taken
as case studies, applied to the class teaching, the basic
experiments, and the professional practice in the course of
Database Systems
Syllabus for Database System Principles
(cont.)
With respect to in-class Teaching, SQL Server, DB2, Sybase
are taken as case studies, their principles and key technologies
are incorporated into the teaching contents, such as
DBS and DBMS architectures
Relational DBS
DBS Development
Database Management System (DBMS)
PART 2
China Computing Curricula 2005/2008
China Computing Curricula 2005/2008
中国计算机科学与技术教程CCC2005/2008
参照IEEE-CS&ACM制定的Computing Curricula
2003/2006
计算机科学与技术学科的四个专业
计算机科学
计算机工程
软件工程
信息技术
China Computing Curricula 2005/2008 (cont.)
知识与课程体系
包括:知识领域(areas),知识单元(unit) in areas,知识
点(topics) in units
课程体系:基础课程,主干课程,特色课程
不同的专业方向上,知识领域和知识单元有所不同
Body of Knowledge in Computer Science
包括如下14个知识领域:
CS-AR计算机体系结构与组织
CS-AL算法与复杂性
CS-HC人机交互
CS-OS操作系统
CS-PF程序设计基础
CS-SP社会与职业问题
CS-SE软件工程
CS-DS离散结构
CS-NC以网络为中心的计算
CS-PL程序设计语言
Body of Knowledge in Computer Science(cont.)
CS-GV图形学与可视化计算
CS-IS智能系统
CS-IM信息管理:
核心课程“数据库系统原理”
CS-CN数值计算科学
Body of Knowledge in Computer Science(cont.)
—— Knowledge units in CS-IM信息管理
CS-IM
IM1 信息模型与信息系统
信息管 (4)
理(34) IM2 数据库系统(4)
IM3 数据建模(6)
IM4 关系数据库(2)
IM5 数据库查询语言(6
)
IM6 关系数据库设计(6
)
IM7 事务处理(6)
IM8 分布式数据库
IM9 物理数据库设计
IM10 数据挖掘
IM11 信 息 存 储 与 信 息
检索
IM12 超文本和超媒体
IM13 多 媒 体 信 息 与
多媒体系统
IM14 数字图书馆
Body of Knowledge in Computer Science(cont.)
—— Knowledge Topics in CS-IM信息管理
IM1 信息模型和信息系统(核心)
知识点:
信息系统简介,组织中的信息系统
信息存储和信息检索
信息获取和信息表示
信息管理应用程序
业务信息系统
信息系统中的搜索、检索、连接、导航
信息保密、信息完整性、信息安全性
信息的重要特征与特性 (如可伸缩性、有效性和可
行性)
Body of Knowledge in Computer Science(cont.)
—— Knowledge Topics in CS-IM信息管理
IM2数据库系统(核心)
知识点:
数据库系统简介
数据库系统的组件
DBMS功能
数据库的体系结构和数据完整性
数据库查询语言概述
Body of Knowledge in Computer Science(cont.)
—— Knowledge Topics in CS-IM信息管理
IM3数据模型化(核心)
知识点:
数据模型
概念模型(如:实体—联系模型)
面向对象模型(语义对象模型)
关系数据模型
IM4 关系数据库(核心)
知识点:
概念模式映射为关系模式
实体完整性与参照完整性
关系代数与关系演算
Body of Knowledge in Computer Science(cont.)
—— Knowledge Topics in CS-IM信息管理
IM5 数据库查询语言(核心)
知识点:
数据库查询语言概述(DDL, DML, DCL)
SQL (数据定义、查询模式、更新子语言、约束及完
整性控制)
查询优化策略
QBE和第四代环境
嵌入式SQL
对象查询初步
Body of Knowledge in Computer Science(cont.)
—— Knowledge Topics in CS-IM信息管理
IM6 关系数据库设计(核心)
知识点:
数据库设计的概念
函数依赖与范式(1NF, 2NF, 3NF, BCNF)
用多值依赖作规范化(4NF)
用连接依赖作规范化(投影—连接范式)
IM7 事务处理(核心)
知识点:
事务处理
故障和恢复
并发控制
Body of Knowledge in Computer Science(cont.)
—— Knowledge Topics in CS-IM信息管理
IM8 分布式数据库(选修)
知识点:
分布式数据存储
分布式查询处理
分布式事务模型
并发控制
分布式提交与分布式封锁
客户机—服务器机制
Body of Knowledge in Computer Science(cont.)
—— Knowledge Topics in CS-IM信息管理
IM9 物理数据库设计(选修)
知识点:
存储结构和文件结构
索引结构(顺序文件上的索引、辅助索引)
B树
散列表
签名文件
稠密索引文件
变长记录文件
数据库效率和协调
Body of Knowledge in Computer Engineering
包括如下18个知识领域:
CE-ALG 算法与复杂度
CE-CAO 计算机体系结构和组织
CE-CSE 计算机系统工程
CE-CSG 电路和信号
CE-DBS 数据库系统
CE-DIG 数字逻辑
CE-DSP 数字信号处理
CE-ELE 电子学
CE-ESY 嵌入式系统
CE-HCI 人机交互
Body of Knowledge in Computer Engineering(cont.)
CE-NWK 计算机网络
CE-OPS 操作系统
CE-PRF 程序设计基础
CE-SPR 社会和职业问题
CE-SWE 软件工程
CE-VLS VLSI设计与构造
CE-DSC 离散结构
CE-PRS 概率和统计
Body of Knowledge in Computer Engineering (cont.)
—— Knowledge units in CE-DBS 数据库系统
CE-DBS
数据库
系 统
(10)
DBS0 历史与概述 (1)
DBS1 数据库系统 (2)
DBS2 数据建模 (2)
DBS3 关系数据库 (3)
DBS4 数 据 库 查 询 语 言
(2)
DBS5
DBS6
DBS7
DBS8
关系数据库设计
事务处理
分布式数据库
物理数据库设计
Body of Knowledge in Software Engineering
包括如下10个知识领域:
SE-CMP 计算基础:
涉及核心课程DBS
SE-FND
数学和工程基础
SE-PRF
职业实践
SE-MAA软件建模与分析
涉及核心课程DBS
SE-DES
软件设计
SE-VAV
软件验证与确认
SE-EVO
软件进化
SE-PRO
软件过程
SE-QUA
软件质量
SE-MGT
软件管理
Body of Knowledge in Software Engineering (cont.)
—— Knowledge units in CS270 数据库
信息模型和系统
数据库系统
数据建模
关系数据库
数据库查询语言
关系数据库设计
事务处理
分布式数据库
数据库的物理设计
最小核心学时 13,授课学时 48,实验学时 16
Body of Knowledge in Information
Technology
包括如下12个知识领域:
IT-ITF信息技术基础(34)
IT-HCI人机交互(29)
IT-IAS 信息保障和安全 (23)
IT-IM 信息管理 (34) :
涉及核心课程DBS
IT-IPT集成程序设计及技术 (23)
IT-NET计算机网络(19)
IT-PF程序设计基础 (38)
IT-PT平台技术(14)
Body of Knowledge in Information
Technology (cont.)
IT-SA系统管理和维护(11)
IT-SIA系统集成和体系结构(21)
IT-SP信息技术与社会环境(23)
IT-SP信息技术与社会环境(23)
IT-WS系统和技术(21)
Body of Knowledge in Information Technology
(cont.)——Knowledge Units in IT-IM
IT-IM 信息管理
(34)
IM.fun
IM.dql
IM.dor
IM.dm
IM.mg
IM.spc
信息管 理 的概念
和基础知识(8)
数据库 查 询语言
(9)
数据组 织 和体系
结构 (7)
数据建模 (6)
数据库 环 境的管
理(3)
特殊用 途 的数据
库(1)
PART3
Contents of Class Teaching
Teaching contents
principles and implementation/development techniques
of DBS
taking SQL Server, DB2, Sybase as case studies in inclass teaching, after-class experiments, and course design
C++程序开发:
数据结构,程序设计,
软件工程, ….
SQL查询语句/程序开发(§3, §4 );
数据库应用程序开发DBAS(§7)
C++ programs
程序编译/编译器:
词法/语法/语义分析;
中间代码生成与优化;
目标代码生成
查询处理与优化/DBMS (§13, §14) :
扫描和语法/语义分析;
查询优化;
查询代码/执行计划生成;
目标代码
事务执行/DBMS (§15, §16, §17) :
程序执行/OS:
进程/线程管理;
并发控制与调度;
死锁处理;
事务管理;
事务并发控制与调度;
事务死锁处理;
故障恢复
应用数据的存储与访问/DB:
程序与数据的存储与访问/OS:
基于文件系统的数据组织与存储;
基于文件系统/IO系统的数据访问;
基于数据模型(§2/5/9/10),设计数据库
( §1/6/7/9 );在数据库文件中存储应用数据,快速
访问数据库文件中的应用数据( §11/12 );
Contents of Class Teaching(cont.)
Main parts in the textbook
1. DBS Principles (基本理论)
data model
— Chapter1, PART1(Chapter2), PART3 (Chapter9,
Chapter10)
— Appendix A, B
databases
— PART2(chapter 3—4)
— PART3(chapter9)
Contents of Class Teaching(cont.)
2. DBS design (数据库应用系统开发)
DBS的生命周期与设计过程
数据库设计
— PART2(Chapter 6, 7)
— PART9(App.C)
应用开发
— Chapter9
Contents of Class Teaching(cont.)
3. DBS ( or DBMS) implementation
存储管理: PART4 (chapter11-12)
查询处理:
— PART4(chapter13-14)
事务管理
— PART5(Chapter15-17)
— PART8(Chapter25)
DBS体系结构: PART7 (Chapter 20-22)
Contents of Class Teaching(cont.)
4. CASE STUDIES
PART9(Chapter26-29)
PostgreSQL, SQL Server, Oracle, DB2
Contents of Class Teaching(cont.)
Relations to Other Courses
数据结构:
— data model: 复杂数据结构 + 语义描述 + 数据操作
离散数学:关系模型
操作系统:
文件子系统,I/O子系统,进程管理
编译原理:
查询处理与优化
软件工程:DBS系统的设计方法
面向对象技术:object-oriented DBS
C++ programs
词法/语法/语义分析
中间代码生成
/
编
译
器
(中间)代码优化
Chapter
13, 14
目标代码生成
目标程序代码
process / thread
关系代数表达式&查询树
查询优化
(§14)
(优化后)查询执行计划
查询代码生成
(§13)
查询计划执行的代码
理
(§15)
transaction
并
发事
控务
制调
度
&
死
锁
处
理
扫描和语法/语义分析
事
务
事
处
Chapter 理 务
管
15,16, 17
/ DBMS
OS
并
发进
控程
制调
度
&
/
程
序 进
执 程
行 管
理
Query processing / DBMS
程
序
编
译
SQL query
死
锁
处
理
(§16)
恢
复
技
术
(§17)
PART4
Basic Experiments on DB2, Sybase
In parallel with course learning, each student is directed to
make several basic after-class Experiments on DB2, Sybase
independently, to get the students to have a better grasp of their
knowledge about DBS learned in the classes and become
skilled at operating practical DBS like DB2, Sybase
The experiment on DB2, Sybase to learn SQL’s
functionality of data definition, including defining of tables
and views
The experiment on DB2, Sybase to learn SQL’s
functionality of data query, including simple query, complex
query, and nested query
Basic Experiments on DB2, Sybase
(cont.)
The experiment on DB2, Sybase Enterprise Manager to
learn building and maintaining of DBS, including Insert,
Delete, and Update operations on DB
The experiment on SQL Server to learn security
mechanisms, including users, roles, and privileges on data
access
The experiment on SQL Server to learn integrity
mechanisms, including defining constraints and triggers in
Transaction-SQL
The experiment on SQL Server to learn backup and
recovery mechanisms in DBS
Basic Experiments on DB2, Sybase
(cont.)
实验安排
2人一组
随着课堂学习的进度逐步布置8组实验
由院实验中心的专职指导老师负责实验指导和上机验收
实验指导老师:
( );
时间、地点:??,主楼院实验中心 913室
Part5 Course Design
(cont.)
As the seamless part of computer discipline specified in China
Computer Curriculum 2005/2008, the Professional Practice
of Database Systems course is conducted during the Summer
short term (at the end of the second semester)
on basis of principles and development of database
systems , DB2, Sybase learned in course learning and
basic experiments, the student teams are directed to design
and develop a demos of telecommunications-area-oriented
database application systems
— GSM网络无线信道利用率分析)
Part5
Course Design
应用程序1
API, e.g.ODBC,
JDBC
数据库文
件
应用程序2
DBMS
…
DB query language
e.g. SQL
Users
DBMS
DBS, DBAS
DB
Part 6 Some Issues to Be Emphasized
Bilingual teaching and English textbooks
bilingual teaching in universities is an important policy
decided by Ministry of Education, also by BUPT
it is better for students to read the English textbook written
by Abraham Silberschat etc. directly, not to use Chineseversion of the textbook for this course
Tests, examination, and grading
课堂纪律
实验、课程设计独立完成,不要抄袭
期末考试成绩过低  重修
Some Issues to Be Emphasized
常识知识 related to DB
e.g. 主流DB产品
注意积累
种瓜得瓜,种豆得豆
要分 ?!
(cont.)
Thanks for your attention