Presentation is loading. Please wait.

Presentation is loading. Please wait.

AnQing Teachers College Department of Computer & Information

Similar presentations


Presentation on theme: "AnQing Teachers College Department of Computer & Information"— Presentation transcript:

1 AnQing Teachers College Department of Computer & Information
数据库 Principle and Application of Database System 安庆师范学院计算机与信息学院 AnQing Teachers College Department of Computer & Information Principle and Application of Database System

2 AnQing Teachers College Department of Computer & Information
数据库原理与应用 Principle and Application of Database System 安庆师范学院计算机与信息学院 AnQing Teachers College Department of Computer & Information Principle and Application of Database System

3 Principle and Application of Database System
数据库技术的重要性 数据库技术产生于六十年代末,是数据管理的最新技术,是计算机科学的重要分支。产生到今天仅仅40余年,但取得辉煌成就: 经历了三代演变:层次/网状系统、关系系统、新一代数据库系统家族 造就了三位图灵奖turing award得主:C.W.Bachman、E.F.Codd和James Gray 发展了一门计算机基础学科:以数据模型和DBMS核心技术为主,内容丰富、领域宽广 形成了一个巨大的软件产业: DBMS及其相关工具产品、应用解决方案 Principle and Application of Database System

4 Principle and Application of Database System
C.W.Bachman E.F.Codd James Gray Principle and Application of Database System

5 Principle and Application of Database System
数据库技术的重要性 当前,在大、中、小、微型计算机上都有数据库系统在运行。 信息资源已成为各部门的重要财富和资源,各行各业均需应用信息系统,而数据库是信息系统的核心。 Principle and Application of Database System

6 Principle and Application of Database System
数据库技术的重要性 数据库是其它很多系统的核心或重要组成部分,如: MIS(Management Information System)管理信息系统 DSS(Decision Support System)决策支持系统,知识库,规则库,专家系统, 智能数据库 计算机辅助设计与制造 工程数据库 计算机集成制造 Principle and Application of Database System

7 Principle and Application of Database System
数据库技术的重要性 数据库技术与其他学科相结合,涌现出各种新型的数据库系统,如: 分布式数据库系统 并行数据库系统 面向对象数据库系统 知识库系统 多媒体数据库系统 模糊数据库系统 网络数据库系统 Principle and Application of Database System

8 Principle and Application of Database System
学习数据库课程的重要性 鉴于数据库技术重要的学术地位和广泛的实际应用范围,我们必须系统地学习和掌握数据库系统的理论、技术和方法。 Principle and Application of Database System

9 Principle and Application of Database System
国外高等学校较早地在计算机科学系、计算机应用与信息系统系都开设有数据库系统方面的课程。 1983年教育部将数据库概论列为高等学校计算机软件专业四年制本科的必修的重要课程。 Principle and Application of Database System

10 Principle and Application of Database System
教材及参考书  教材 李春葆,曾平:数据库原理与应用—— 基于SQL Server 2000 清华大学出版社,2006年 1 教材介绍: 比较经典的数据库教材 第一版中国最早的数据库教材,为众多高校计算机专业采用 2. 萨老师介绍 创建信息系,最早系主任 中国的C J, Date 3 王老师介绍 4 数据库所介绍 Principle and Application of Database System

11 Principle and Application of Database System
教材及参考书  参考书 李红著:数据库原理与应用(第2版),高等教育出版社,2007 萨师煊,王珊著:数据库系统概论(第四版) 高等教育出版社,2004 SQL Server 2000相关书籍 VB数据库系统开发相关书籍  上机软件 Microsoft SQL Server 2000 Professional Principle and Application of Database System

12 Principle and Application of Database System
学习方式  听课  课外 (预习、复习,看参考书、做相关习题和应用操作) Principle and Application of Database System

13 Principle and Application of Database System
课程学习方法 理论学习 掌握基本概念,多看例题,多做习题 理论指导实践,实践提高认识 重视数据库设计 实践学习 勤思考,多动手 重视上机实习环境 坚持自学 Principle and Application of Database System

14 Principle and Application of Database System
考试成绩 平时成绩(30%) (书面作业、上机实验、考勤) 期末考试(70%) Principle and Application of Database System

15 Principle and Application of Database System
内容安排  数据库原理部分 第1章:数据库系统概述 第2章:数据模型 第3章:关系数据库 第4章:关系数据库规范化理论 第5章:数据库设计 与一些教材的区别 偏重理论,不去讨论某个系统的具体使用方法,但会涉及实现技术 我们的优势 虽然枯燥,但适应DBA的需要 不过时 Principle and Application of Database System

16 Principle and Application of Database System
内容安排  数据库基础应用部分 第6章:SQL Server2000系统概述 第7章:创建和使用数据库 第8章:创建和使用表 第9章:Transact-SQL 第10章:SQL高级应用 第11章:索引 第12章:视图 第13章:数据库完整性 第14章:存储过程 第15章:触发器 第16章:SQL Server的安全管理 第17章:数据备份和还原 第18章:数据转换 与一些教材的区别 偏重理论,不去讨论某个系统的具体使用方法,但会涉及实现技术 我们的优势 虽然枯燥,但适应DBA的需要 不过时 Principle and Application of Database System

17 Principle and Application of Database System
内容安排  数据库应用提高部分* 第19章:VB与数据库 第20章:使用DAO操作数据库 第21章:使用ADO操作数据库 Principle and Application of Database System

18 An Introduction to Database System
数据库系统概论 An Introduction to Database System 第1章 数据库系统概述 安庆师范学院计算机与信息学院 Principle and Application of Database System

19 Principle and Application of Database System
§1.1 四个基本概念 数据(Data) 数据库(Database) 数据库管理系统(DBMS) 数据库系统(DBS) Principle and Application of Database System

20 Principle and Application of Database System
一、数据 信息:客观世界中事物的存在方式和运动状态及其变化的反映,是客观事物之间相互联系和相互作用的表征。 Principle and Application of Database System

21 Principle and Application of Database System
一、数据 数据是对信息的符号化表示,即用一定的符号(数字、文字、图形、图象、声音等)来表示信息。 数据与信息的联系:数据是信息的载体,信息是数据的内涵。同一信息可以有不同的数据表示形式,而同一数据也可能有不同的解释。 Principle and Application of Database System

22 Principle and Application of Database System
数据举例 数据: (李明,男,1972,江苏,计算机系,1990) 李明是个大学生,男,1972年出生,江苏人,1990年考入计算机系 李明是位老师,男,1972年参加工作,江苏人,计算机系,1990年晋升为教授 数据的形式不能完全表达其内容,必须经过解释,数据的解释即对数据语义的说明 信息 Principle and Application of Database System

23 Principle and Application of Database System
二、数据库(举例) Principle and Application of Database System

24 Principle and Application of Database System
二、数据库 人们收集并抽取出一个应用所需要的大量数据之后,应将其保存起来以供进一步加工处理,进一步抽取有用信息 数据库的定义 数据库(Database,简称DB)是长期储存在计算机内、有组织的、可共享的大量数据集合 Principle and Application of Database System

25 Principle and Application of Database System
二、数据库 数据库的特征 数据按一定的数据模型组织、描述和存储 可为各种用户共享 冗余度较小 易扩展 数据独立性较高 Principle and Application of Database System

26 Principle and Application of Database System
三、数据库管理系统 数据库管理系统(Database Management System,简称DBMS)是位于用户与操作系统之间的一层数据管理软件。 Principle and Application of Database System

27 Principle and Application of Database System
DBMS的主要功能 数据定义功能 提供数据定义语言(DDL) 定义数据库中的数据对象 数据操纵功能: 提供数据操纵语言(DML)操纵数据 实现对数据库的基本操作(查询、插入、删除和修改) Principle and Application of Database System

28 Principle and Application of Database System
DBMS的主要功能 数据库的运行管理 安全性控制 完整性控制 多用户对数据的并发使用时的并发控制 Principle and Application of Database System

29 Principle and Application of Database System
DBMS的主要功能 数据库的建立和维护功能(实用程序) 数据库数据批量装载 数据库转储 介质故障恢复 数据库的重组织 性能监视、分析等 Principle and Application of Database System

30 Principle and Application of Database System
四、数据库系统 数据库系统(Database System,简称DBS)是指在计算机系统中引入数据库后的系统构成。 数据库系统的构成 由数据库、数据库管理系统、应用系统(及其开发工具) 、数据库管理员和用户构成。 Principle and Application of Database System

31 Principle and Application of Database System
数据库系统构成图 数据库 应用开发工具 数据库管理系统 应用系统 操作系统 用户 数据库管理员 图1.1 数据库系统 Principle and Application of Database System

32 Principle and Application of Database System
数据库系统在计算机系统中的地位 硬件 操作系统 D B M S 编译系统 应用开发工具 应用系统 图1.2 数据库在计算机系统中的地位 Principle and Application of Database System

33 Principle and Application of Database System
§1.2 数据管理技术的产生和发展 什么是数据管理 对数据进行分类、组织、编码、存储、检索和维护 数据管理技术的发展过程 在应用需求的推动下,在计算机硬件、软件发展的基础上,数据管理技术经历了下面三个阶段: 人工管理阶段(40年代中--50年代中) 文件系统阶段(50年代末--60年代中) 数据库系统阶段(60年代末--现在) Principle and Application of Database System

34 Principle and Application of Database System
一、人工管理 时期 40年代中--50年代中 产生的背景 应用需求 科学计算 硬件水平 无直接存取存储设备 软件水平 没有操作系统 数据处理方式 批处理 Principle and Application of Database System

35 Principle and Application of Database System
人工管理 特点 数据不保存。 应用程序管理数据 数据面向某一应用程序 数据无共享、冗余度极大 数据不独立,完全依赖于程序 Principle and Application of Database System

36 Principle and Application of Database System
应用程序与数据的对应关系(人工管理) 应用程序1 数据集1 应用程序2 数据集2 应用程序n 数据集n ...… Principle and Application of Database System

37 Principle and Application of Database System
二、文件系统 时期 50年代末--60年代中 产生的背景 应用需求 科学计算、数据处理 硬件水平 磁盘、磁鼓 软件水平 有文件系统 处理方式 联机实时处理、批处理 Principle and Application of Database System

38 Principle and Application of Database System
文件系统 特点 数据可长期保存 数据由文件系统管理 数据面向某一应用程序 数据的共享性差、冗余度大 数据记录内有结构,整体无结构 数据独立性差,数据的逻辑结构改变必须修改应用程序 数据独立性差: 1。靠程序定义和解释数据的结构 2。靠程序描述数据间的联系 Principle and Application of Database System

39 Principle and Application of Database System
应用程序与数据的对应关系(文件系统) 应用程序1 文件1 应用程序2 文件2 应用程序n 文件n 存取方法 ...… Principle and Application of Database System

40 Principle and Application of Database System
三、数据库系统 时期 60年代末以来 产生的背景 应用背景 大规模管理 硬件背景 大容量磁盘 软件背景 有数据库管理系统 处理方式 联机实时处理、分布处理 Principle and Application of Database System

41 Principle and Application of Database System
数据结构化 整体数据的结构化是数据库的主要特征之一。 Principle and Application of Database System

42 Principle and Application of Database System
数据的共享性高,冗余度小,易扩充 降低数据的冗余度,节省存储空间 避免数据间的不一致性 使系统易于扩充 Principle and Application of Database System

43 Principle and Application of Database System
数据独立性高 物理独立性 指用户的应用程序与存储在磁盘上的数据库中数据是相互独立的。当数据的物理存储改变了,应用程序不用改变。 逻辑独立性 指用户的应用程序与数据库的逻辑结构是相互独立的。数据的逻辑结构改变了,用户程序也可以不变。 Principle and Application of Database System

44 Principle and Application of Database System
DBMS对数据统一管理与控制 数据的安全性(Security)保护 使每个用户只能按指定方式使用和处理指定数据,保护数据以防止不合法的使用造成的数据的泄密和破坏。 数据的完整性(Integrity)检查 将数据控制在有效的范围内,或保证数据之间满足一定的关系。 Principle and Application of Database System

45 Principle and Application of Database System
DBMS对数据的控制功能 并发(Concurrency)控制 对多用户的并发操作加以控制和协调,防止相互干扰而得到错误的结果或破坏数据库的完整性 数据库恢复(Recovery) 将数据库从错误状态恢复到某一已知的正确状态。 Principle and Application of Database System

46 Principle and Application of Database System
应用程序与数据的对应关系(数据库系统) DBMS 应用程序1 应用程序2 数据库 Principle and Application of Database System

47 Principle and Application of Database System
§1.3 数据库系统结构 §1.3.1数据库系统内部的模式结构 从数据库管理系统角度看 §1.3.2数据库系统外部的体系结构* 从数据库最终用户角度看 Principle and Application of Database System

48 Principle and Application of Database System
§ 数据库系统的模式结构 数据库系统的三级模式结构 数据库的二级映象功能与数据独立性 Principle and Application of Database System

49 Principle and Application of Database System
数据库系统的三级模式结构 应用 A B C D E 外模式 1 2 外模式 3 外模式 / 模式映象 模式 模式 / 内模式映象 内模式 数据库 Principle and Application of Database System

50 Principle and Application of Database System
1.模式(Schema) 模式(也称逻辑模式、数据库模式、概念模式) 数据库中全体数据的逻辑结构的描述 所有用户的公共数据视图,综合了所有用户的需求 一个数据库只有一个模式 模式的地位:是数据库系统模式结构的中间层 与数据的物理存储细节和硬件环境无关 与具体的应用程序、开发工具及高级程序设计语言无关 Principle and Application of Database System

51 Principle and Application of Database System
模式的定义 数据的逻辑结构(数据项的名字、类型、取值范围等) 数据之间的联系 有关数据的安全性、完整性要求 Principle and Application of Database System

52 Principle and Application of Database System
2. 外模式(External Schema) 外模式(也称子模式或用户模式) 数据库用户(包括应用程序员和最终用户)使用的局部数据的逻辑结构的描述 数据库用户的数据视图,是与某一应用有关的数据的逻辑表示 Principle and Application of Database System

53 Principle and Application of Database System
外模式(续) 外模式的地位:介于模式与应用之间 模式与外模式的关系:一对多 外模式通常是模式的子集 一个数据库可以有多个外模式。反映了不同的用户的应用需求、看待数据的方式、对数据保密的要求 对模式中同一数据,在外模式中的结构、类型、长度、保密级别等都可以不同 外模式与应用的关系:一对多 同一外模式也可以为某一用户的多个应用系统所使用, 但一个应用程序只能使用一个外模式。 Principle and Application of Database System

54 Principle and Application of Database System
外模式(续) 外模式的用途 保证数据库安全性的一个有力措施。 每个用户只能看见和访问所对应的外模式中的数据 Principle and Application of Database System

55 3.内模式(Internal Schema)
内模式(也称存储模式) 是数据物理结构和存储方式的描述 是数据在数据库内部的表示方式 记录的存储方式(顺序存储,按照B树结构存储,按hash方法存储) 索引的组织方式 数据是否压缩存储 数据是否加密 一个数据库只有一个内模式 Principle and Application of Database System

56 Principle and Application of Database System
三级模式与二级映象 三级模式是对数据的三个抽象级别 二级映象在DBMS内部实现这三个抽象层次的联系和转换 Principle and Application of Database System

57 Principle and Application of Database System
数据库系统的三级模式结构 应用 A B C D E 外模式 1 外模式 2 外模式 3 外模式 / 模式映象 模式 模式 / 内模式映象 内模式 数据库 Principle and Application of Database System

58 Principle and Application of Database System
1.外模式/模式映象 定义外模式与模式之间的对应关系 每一个外模式都对应一个外模式/模式映象 映象定义通常包含在各自外模式的描述中 Principle and Application of Database System

59 Principle and Application of Database System
外模式/模式映象的用途 保证数据的逻辑独立性 当模式改变时,数据库管理员修改有关的外模式/模式映象,使外模式保持不变 应用程序是依据数据的外模式编写的,从而应用程序不必修改,保证了数据与程序的逻辑独立性,简称数据的逻辑独立性。 Principle and Application of Database System

60 Principle and Application of Database System
2.模式/内模式映象 模式/内模式映象定义了数据全局逻辑结构与存储结构之间的对应关系。例如,说明逻辑记录和字段在内部是如何表示的 数据库中模式/内模式映象是唯一的 该映象定义通常包含在模式描述中 Principle and Application of Database System

61 Principle and Application of Database System
模式/内模式映象的用途 保证数据的物理独立性 当数据库的存储结构改变了(例如选用了另一种存储结构),数据库管理员修改模式/内模式映象,使模式保持不变 应用程序不受影响。保证了数据与程序的物理独立性,简称数据的物理独立性。 Principle and Application of Database System

62 Principle and Application of Database System
小结 模式 是数据库的中心与关键 独立于数据库的其它层次 设计数据库模式结构时应首先确定数据库的逻辑模式 Principle and Application of Database System

63 Principle and Application of Database System
小结(续) 内模式 依赖于全局逻辑结构,但独立于数据库的用户视图即外模式,也独立于具体的存储设备。 它将全局逻辑结构中所定义的数据结构及其联系按照一定的物理存储策略进行组织,以达到较好的时间与空间效率。 Principle and Application of Database System

64 Principle and Application of Database System
小结(续) 外模式 面向具体的应用程序,定义在逻辑模式之上,但独立于存储模式和存储设备 设计外模式时应充分考虑到应用的扩充性。当应用需求发生较大变化,相应外模式不能满足要求时,该外模式就得做相应改动 Principle and Application of Database System

65 Principle and Application of Database System
小结(续) 二级映象 保证了数据库外模式的稳定性,从而从底层保证了应用程序的稳定性,除非应用需求本身发生变化,否则应用程序一般不需要修改。 Principle and Application of Database System

66 Principle and Application of Database System
1.3.2 数据库系统外部的体系结构 单用户结构 主从式结构 分布式结构 客户/服务器结构 浏览器/应用服务器/数据库服务器结构 Principle and Application of Database System

67 Principle and Application of Database System
1. 单用户数据库系统 整个数据库系统(应用程序、DBMS、数据)装在一台计算机上,为一个用户独占,不同机器之间不能共享数据。 早期的最简单的数据库系统 例如一个企业的各个部门都使用本部门的机器来管理本部门的数据,各个部门的机器是独立的。由于不同部门之间不能共享数据,因此企业内部存在大量的冗余数据。例如人事部门、会计部门、技术部门必须重复存放每一名职工的一些基本信息(职工号、姓名等)。 Principle and Application of Database System

68 Principle and Application of Database System
2. 主从式结构的数据库系统 一个主机带多个终端的多用户结构 数据库系统,包括应用程序、DBMS、数据,都集中存放在主机上,所有处理任务都由主机来完成 各个用户通过主机的终端并发地存取数据库,共享数据资源 Principle and Application of Database System

69 Principle and Application of Database System
主从式结构的数据库系统 终端 主机 Principle and Application of Database System

70 Principle and Application of Database System
主从式结构的数据库系统(续) 优点 易于管理、控制与维护。 缺点 当终端用户数目增加到一定程度后,主机的任务会过分繁重,成为瓶颈,从而使系统性能下降。 系统的可靠性依赖主机,当主机出现故障时,整个系统都不能使用。 Principle and Application of Database System

71 Principle and Application of Database System
3. 分布式结构的数据库系统 数据库中的数据在逻辑上是一个整体,但物理地分布在计算机网络的不同结点上。 网络中的每个结点都可以独立处理本地数据库中的数据,执行局部应用 同时也可以同时存取和处理多个异地数据库中的数据,执行全局应用 Principle and Application of Database System

72 Principle and Application of Database System
分布式结构的数据库系统 终端 主机 终端 终端 网络 主机 主机 Principle and Application of Database System

73 Principle and Application of Database System
分布式结构的数据库系统(续) 优点 适应了地理上分散的公司、团体和组织对于数据库应用的需求。 缺点 数据的分布存放给数据的处理、管理与维护带来困难。 当用户需要经常访问远程数据时,系统效率会明显地受到网络传输的制约。 Principle and Application of Database System

74 Principle and Application of Database System
4.客户/服务器结构的数据库系统 把DBMS功能和应用分开 网络中某个(些)结点上的计算机专门用于执行DBMS功能,称为数据库服务器,简称服务器 其他结点上的计算机安装DBMS的外围应用开发工具,用户的应用系统,称为客户机 与主从式结构的区别 主从式数据库系统中的主机和分布式数据库系统中的每个结点机既执行DBMS功能又执行应用程序。 Principle and Application of Database System

75 Principle and Application of Database System
客户/服务器数据库系统的种类 集中的服务器结构 一台数据库服务器,多台客户机 分布的服务器结构 在网络中有多台数据库服务器 分布的服务器结构是客户/服务器与 分布式数据库的结合 Principle and Application of Database System

76 Principle and Application of Database System
集中的服务器结构 应用 工具 接口 应用 工具 接口 客户机 接口 DBMS功能 服务器 Principle and Application of Database System

77 Principle and Application of Database System
分布的服务器结构 应用 工具 接口 应用 工具 接口 客户机 接口 DBMS功能 接口 DBMS功能 服务器 Principle and Application of Database System

78 Principle and Application of Database System
客户/服务器结构的优点 客户端的用户请求被传送到数据库服务器,数据库服务器进行处理后,只将结果返回给用户,从而显著减少了数据传输量 数据库更加开放 客户与服务器一般都能在多种不同的硬件和软件平台上运行 可以使用不同厂商的数据库应用开发工具 Principle and Application of Database System

79 Principle and Application of Database System
客户/服务器结构的缺点 “胖客户”问题: 相同的应用程序要重复安装在每一台客户机上,从系统总体来看,大大浪费了系统资源。 系统规模达到数百数千台客户机,它们的硬件配置、操作系统又常常不同,要为每一个客户机安装应用程序和相应的工具模块,其安装维护代价便不可接受了。 Principle and Application of Database System

80 Principle and Application of Database System
5. 浏览器/应用服务器/数据库服务器结构 客户端: 浏览器软件、用户界面 浏览器的界面统一,广大用户容易掌握 大大减少了培训时间与费用。 服务器端分为两部分: Web服务器、应用服务器 数据库服务器 专门的应用服务器处理客户请求,提高了数据库的访问效率 将部分任务处理和数据操作移到后台,简化了客户机的设计 Principle and Application of Database System


Download ppt "AnQing Teachers College Department of Computer & Information"

Similar presentations


Ads by Google