Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Introduction to Database Systems

Similar presentations


Presentation on theme: "An Introduction to Database Systems"— Presentation transcript:

1 An Introduction to Database Systems
第一章 绪论 1.1 数据库系统概述 1.2 数据模型 1.3 数据库系统结构 1.4 数据库系统的组成 1.5 小结 An Introduction to Database Systems

2 An Introduction to Database Systems
1.3 数据库系统结构 从数据库管理系统角度看,数据库系统通常采用三级模式结构,是数据库系统内部的系统结构 从数据库最终用户角度看(数据库系统外部的体系结构) ,数据库系统的结构分为: 单用户结构 主从式结构 分布式结构 客户/服务器 浏览器/应用服务器/数据库服务器多层结构等 An Introduction to Database Systems

3 An Introduction to Database Systems
单用户结构 可以运行在PC机上的DBS称为桌面型DBMS。 桌面型DBMS虽在数据的完整性、安全性、并发性等方面存在许多缺陷,但已基本实现了DBMS所应具备的功能。 在桌面型DBMS中,数据存储层、业务处理层和界面表示层的所有功能都存在于单台PC机上。 适合未联网、个人用户及移动用户使用。 An Introduction to Database Systems

4 An Introduction to Database Systems
集中式结构 采用大型主机和多个终端相结合的系统。 该结构将OS、应用程序、DBS等数据和资源均放在作为核心的主机上,连接在主机上的终端,只作为主机的一种输入/输出设备。 在此体系结构中,数据存储层和业务处理层都放在主机上,而界面表示层放在与主机相连接的各个终端上。 An Introduction to Database Systems

5 An Introduction to Database Systems
客户机/服务器(C/S)结构 在C/S结构中,客户机提出请求,服务器对客户机的服务请求作出回应。 C/S结构的本质在于通过对服务功能的分布实现分工服务。 每个服务器都为整个局域网系统提供自己最擅长的服务,让所有客户机来分享;客户机的应用程序借助服务器的服务功能实现复杂的应用功能。 在C/S结构中,数据存储层处于服务器上,业务处理层和界面表示层处于客户机上。 An Introduction to Database Systems

6 An Introduction to Database Systems
浏览器/服务器(B/S)结构 该结构的DB应用系统中,客户机端仅安装通用的浏览器软件实现同用户的输入/输出,而应用程序在服务器端安装和运行。 服务器端,除了有DB服务器保存数据并运行基本的DB操作外,还有称作应用服务器的服务器来处理客户端提交的处理要求。即C/S结构中客户端运行的程序转移到了应用服务器中。 应用服务器充当客户机与DB服务器的中介,架起用户界面同DB之间的桥梁,故也称为三层结构。 An Introduction to Database Systems

7 An Introduction to Database Systems
1.3.1 数据库系统模式的概念 “型” 和“值” 的概念 型(Type) 对某一类数据的结构和属性的说明 值(Value) 是型的一个具体赋值 例如 学生记录型: (学号,姓名,性别,系别,年龄,籍贯) 一个记录值: (900201,李明,男,计算机,22,江苏) An Introduction to Database Systems

8 An Introduction to Database Systems
模式(Schema) 数据库逻辑结构和特征的描述 是对型的描述 反映的是数据的结构及其联系 模式是相对稳定的 实例(Instance) 模式的一个具体值 反映数据库某一时刻的状态 同一个模式可以有很多实例 实例随数据库中的数据的更新而变动 An Introduction to Database Systems

9 An Introduction to Database Systems
1.3.2 数据库系统的三级模式结构 模式(Schema) 外模式(External Schema) 内模式(Internal Schema) An Introduction to Database Systems

10 An Introduction to Database Systems
数据库系统的三级模式结构 An Introduction to Database Systems

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

12 An Introduction to Database Systems
模式所定义的内容 数据的逻辑结构(数据项的名字、类型、取值范围等) 数据之间的联系 数据有关的安全性、完整性要求 An Introduction to Database Systems

13 2、外模式(External Schema)
外模式(也称子模式或用户模式) 数据库用户(包括应用程序员和最终用户)使用的局部数据的逻辑结构和特征的描述 数据库用户的数据视图,是与某一应用有关的数据的逻辑表示 An Introduction to Database Systems

14 An Introduction to Database Systems
外模式的地位:介于模式与应用之间 模式与外模式的关系:一对多 外模式通常是模式的子集 一个数据库可以有多个外模式。反映了不同的用户的应用需求、看待数据的方式、对数据保密的要求 对模式中同一数据,在外模式中的结构、类型、长度、保密级别等都可以不同 外模式与应用的关系:一对多 同一外模式也可以为某一用户的多个应用系统所使用 但一个应用程序只能使用一个外模式 外模式的用途 保证数据库安全性的一个有力措施 每个用户只能看见和访问所对应的外模式中的数据 An Introduction to Database Systems

15 3、内模式(Internal Schema)
内模式(也称存储模式) 是数据物理结构和存储方式的描述 是数据在数据库内部的表示方式 记录的存储方式(例:顺序存储,按照B树结构存储或按hash方法存储) 索引的组织方式 数据是否压缩存储 数据是否加密 数据存储记录结构的规定 一个数据库只有一个内模式 An Introduction to Database Systems

16 An Introduction to Database Systems
例如学生记录,如果按堆存储,则插入一条新记录总是放在学生记录存储的最后,如右图所示 An Introduction to Database Systems

17 An Introduction to Database Systems
如果按照学生年龄聚簇存放,假如新插入的S3是16岁,则应插入的位置如图1.29(c)所示 An Introduction to Database Systems

18 An Introduction to Database Systems
1.3.3 数据库的二级映像功能与数据独立性 三级模式是对数据的三个抽象级别 二级映象在DBMS内部实现这三个抽象层次的联系和转换 外模式/模式映像 模式/内模式映像 An Introduction to Database Systems

19 1、外模式/模式映象 模式:描述的是数据的全局逻辑结构 外模式:描述的是数据的局部逻辑结构 同一个模式可以有任意多个外模式
每一个外模式,数据库系统都有一个外模式/模式映象,定义外模式与模式之间的对应关系 映象定义通常包含在各自外模式的描述中

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

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

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

23 An Introduction to Database Systems
第一章 绪论 1.1 数据库系统概述 1.2 数据模型 1.3 数据库系统结构 1.4 数据库系统的组成 1.5 小结 An Introduction to Database Systems

24 An Introduction to Database Systems
1.4 数据库系统的组成 数据库 数据库管理系统(及其开发工具) 应用系统 数据库管理员 An Introduction to Database Systems

25 An Introduction to Database Systems
硬件平台及数据库 软件 人员 An Introduction to Database Systems

26 An Introduction to Database Systems
1、硬件平台及数据库 数据库系统对硬件资源的要求 (1) 足够大的内存 操作系统 DBMS的核心模块 数据缓冲区 应用程序 An Introduction to Database Systems

27 An Introduction to Database Systems
(2) 足够大的外存 磁盘或磁盘阵列 数据库 光盘、磁带 数据备份 (3) 较高的通道能力,提高数据传送率 An Introduction to Database Systems

28 An Introduction to Database Systems
2、软件 DBMS 支持DBMS运行的操作系统 与数据库接口的高级语言及其编译系统 以DBMS为核心的应用开发工具 为特定应用环境开发的数据库应用系统 An Introduction to Database Systems

29 An Introduction to Database Systems
3、人 员 数据库管理员 系统分析员和数据库设计人员 应用程序员 用户 An Introduction to Database Systems

30 不同的人员涉及不同的数据抽象级别,具有不同的数据视图,如下图所示
各种人员的数据视图

31 An Introduction to Database Systems
数据库管理员(DBA) 职责: 1.决定数据库中的信息内容和结构 2.决定数据库的存储结构和存取策略 3.定义数据的安全性要求和完整性约束条件 4.监控数据库的使用和运行 周期性转储数据库:数据文件,日志文件 故障恢复 5. 数据库的改进和重构 性能监控和调优 定期对数据库进行重组织,以提高系统的性能 需求增加和改变时,数据库须需要重构造 An Introduction to Database Systems

32 An Introduction to Database Systems
系统分析员和数据库设计人员 系统分析员 负责应用系统的需求分析和规范说明 与用户及DBA协商,确定系统的硬软件配置 参与数据库系统的概要设计 数据库设计人员 参加用户需求调查和系统分析 确定数据库中的数据 设计数据库各级模式 An Introduction to Database Systems

33 An Introduction to Database Systems
应用程序员 设计和编写应用系统的程序模块 进行调试和安装 An Introduction to Database Systems

34 An Introduction to Database Systems
用户 用户是指最终用户(End User)。最终用户通过应用系统的用户接口使用数据库。 1. 偶然用户 不经常访问数据库,但每次访问数据库时往往需要不同的数据库信息 企业或组织机构的高中级管理人员 An Introduction to Database Systems

35 An Introduction to Database Systems
2. 简单用户 主要工作是查询和更新数据库 银行的职员、机票预定人员、旅馆总台服务员 3. 复杂用户 工程师、科学家、经济学家、科技工作者等 直接使用数据库语言访问数据库,甚至能够基于数据库管理系统的API编制自己的应用程序 An Introduction to Database Systems

36 An Introduction to Database Systems
本章小结 数据库系统概述 数据库的基本概念 数据管理的发展过程 数据模型 数据模型的三要素 概念模型, E-R 模型 三种主要数据库模型 An Introduction to Database Systems

37 An Introduction to Database Systems
数据库系统的结构 数据库系统三级模式结构 数据库系统两层映像系统结构 数据库系统的组成 An Introduction to Database Systems


Download ppt "An Introduction to Database Systems"

Similar presentations


Ads by Google