浙江大学数据库系统概念PPT第十五章,对应原版教材第五版

合集下载

数据库系统概念PPT第一章,对应原版教材第五版

数据库系统概念PPT第一章,对应原版教材第五版
Instance – the actual content of the database at a particular point in time
Analogous to the value of a variable
Physical Data Independence – the ability to modify the physical schema
Security problems
Database systems offer solutions to all the above problems
Database System Concepts
1.5
©Silberschatz, Korth and Sudarshan, Bo Zhou
Data Abstraction
1.6
©Silberschatz, Korth and Sudarshan, Bo Zhou
Levels of Abstraction
A major purpose of database system is to provide an abstract of
view of data, and hide the certain detail of data storage.
Integrity constraints (e.g. account balance > 0) become part
of program code
Hard to add new constraints or change existing ones
Database System Concepts
without changing the logical schema

数据库系统概念(第五版)Abraham Silberschatz著,CH8

数据库系统概念(第五版)Abraham Silberschatz著,CH8

Chapter 8: Application Design and Development
User Interfaces and Tools Web Interfaces to Databases Web Fundamentals Servlets and JSP Building Large Web Applications Triggers Authorization in SQL Application Security
8.5
©Silberschatz, Korth and Sudarshan
Web Interfaces to Databases
Why interface databases to the Web?
1.
Web browsers have become the de-facto standard user interface to databases Enable large numbers of users to access databases from anywhere Avoid the need for downloading/installing specialized code, while providing a good graphical user interface Examples: banks, airline and rental car reservations, university course registration and grading, an so on.
Database System Concepts - 5th Edition, Oct 23, 2006.
8.3
©Silberschatz, Korth and Sudarshan

数据库系统的基本概念优秀课件

数据库系统的基本概念优秀课件
信息以数据的形式处理,而处理的结果又可能产生新的信息。
1.1.2 数据处理
数据处理是指对各种形式的数据进行收集、存储、加工和传播的一系列 活动的总和。其目的是从大量的、原始的数据中抽取、推导出对人们有 价值的信息以作为行动和决策的依据;数据处理从根本上来说是为了借 助计算机科学地保存和管理大量复杂的数据,以便人们能够充分地利用 这些宝贵的信息资源。
在数据处理的一系列活动中,数据的收集、组织、存储、传播、检索和 分类等活动是基本环节,这些基本环节统称为数据管理或信息管理。在 数据处理中,对数据的加工、计算、打印报表等操作对不同的业务部门 可以有不同的内容。数据库技术所研究的问题就是如何科学地组织和存 储数据,如何高效地获取和处理数据。数据库技术是数据管理的最新技 术。数据库系统是当代计算机系统的重要组成部分。
数据库系统的基本概念
第1章 数据库系统的基本概念
教学提示:本章主要介绍数据库系统的基本概念, 包括数据与信息的概念;数据管理技术的发展阶段; 数据模型的两个层次;数据库系统的体系结构及数 据库系统的组成。
教学目标:了解数据、信息及其联系与区别;数据 管理技术发展的三个阶段及其特点;掌握概念数据 模型与结构数据模型的基本概念;掌握数据库系统 的三级模式、两级映像及两级独立性。
第1章 数据库系统的基本概念
1.1 信息、数据与数据处理 1.2 数据管理技术的发展 1.3 数据模型 1.4 数据库系统的体系结构 1.5 数据库系统 1.6 习题
1.1 信息、数据与数据处理
1.1.1 信息与数据 1.1.2 数据处理
1.1 信息、数据与数据处理
在科学、技术、经济、文化和军事等各个领域里,我们会遇 到大量的数据,这些数据不但复杂,而且数据量大,因此如 何科学地管理数据是一个极为重要的课题。

数据库系统概念(第五版)Abraham Silberschatz著,CH10

数据库系统概念(第五版)Abraham Silberschatz著,CH10

Database System Concepts - 5th Edition, Aug 22, 2005.
10.2
©Silberschatz, Korth and Sudarshan
Introduction
XML: Extensible Markup Language Defined by the WWW Consortium (W3C) Derived from SGML (Standard Generalized Markup Language), but simpler to use than SGML Documents have tags giving extra information about sections of the document E.g. <title> XML </title> <slide> Introduction …</slide> Extensible, unlike HTML Users can add new tags, and separately specify how the tag should be handled for display
Chapter 10: XML
Database System Concepts
©Silberschatz, Korth and Sudarshan See for conditions on re-use
XML
Structure of XML Data XML Document Schema Querying and Transformation Application Program Interfaces to XML Storage of XML Data XML Applications

浙江大学数据库系统概念PPT第十章,对应原版教材第五版

浙江大学数据库系统概念PPT第十章,对应原版教材第五版

querying XML documents/data
Database System Concepts 10.5 ©Silberschatz, Korth and Sudarshan, Bo Zhou
Comparison with Relational Data
Inefficient: tags, which in effect represent schema information,
Nesting is supported in object-relational databases
But nesting is appropriate when transferring data
External application does not have direct access to data referenced by a foreign key
<bank-1> <customer> <customer_name> Hayes </customer_name> <customer_street> Main </customer_street> <customer_city> Harrison </customer_city> <account> <account_number> A-102 </account_number> <branch_name> Perryridge </branch_name> <balance> 400 </balance> </account> <account> … </account> </customer> . . </bank-1>

浙江大学数据库系统概念十七,对应原版教材第五版

浙江大学数据库系统概念十七,对应原版教材第五版
System errors: the database system must terminate an active transaction due to an error condition (e.g., deadlock)
System crash: a power failure or other hardware or software failure causes the system to crash.
Consider transaction Ti that transfers $50 from account A to account B; goal is either to perform all database modifications made by Ti or none at all.
When transaction Ti starts, it registers itself by writing a <Ti start>log record
Before Ti executes write(X), a log record <Ti, X, V1, V2> is written, where V1 is the value of X before the write, and V2 is the value to be written to X.
Database System Concepts
17.7
©Silberschatz, Korth and Sudarshan, Bo Zhou
Implementation of Atomicity and Durability (Cont.)
The shadow-database scheme:

浙江大学数据库系统概念PPT-SQL2,对应原版教材第五版

浙江大学数据库系统概念PPT-SQL2,对应原版教材第五版

Commercial systems offer most, if not all, SQL-92 features, plus varying features from later standards and special proprietary features.
Not all examples here may work on your particular system.
Database System Concepts
A little of physical 4.5 structure…
©Silberschatz, Korth and Sudarshan, Bo Zhou
Domain Types in SQL
char(n). Fixed length character string, with user-specified length n. varchar(n). Variable length character strings, with user-specified maximum length n. int. Integer (a finite subset of the integers that is machine-dependent). smallint. Small integer (a machine-dependent subset of the integer domain type). numeric(p,d). Fixed point number, with user-specified precision of p digits, with n digits to the right of decimal point. real, double precision. Floating point and double-precision floating point numbers, with machine-dependent precision. float(n). Floating point number, with user-specified precision of at least n digits. Null values are allowed in all the domain types. Declaring an attribute to be not null prohibits null values for that attribute.

浙江大学数据库系统概念PPT第十七章,对应原版教材第五版

浙江大学数据库系统概念PPT第十七章,对应原版教材第五版

System crash: a power failure or other hardware or software failure causes the system to crash.
Fail-stop assumption: non-volatile storage contents are assumed to not be corrupted by system crash Database systems have numerous integrity checks to prevent corruption of disk data
To ensure atomicity despite failures
we first output information describing the modifications to stable storage without modifying the database itself. Then make the modification to database at commit point, or remove all the modification if the transaction failed (rollback)
Disk failure: a head crash or similar disk failure destroys all or part of disk storage
Destruction is assumed to be detectable: disk drives use checksums to detect failures
Recovery actions in each case above are: (a) undo (T0): B is restored to 2000 and A to 1000. (b) undo (T1) and redo (T0): C is restored to 700, and then A and B are set to 950 and 2050 respectively. (c) redo (T0) and redo (T1): A and B are set to 950 and 2050 respectively. Then C is set to 600
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Can be ensured trivially by running transactions serially, that is one after the other. However, executing multiple transactions concurrently has significant benefits, as we will see.
Database System Concepts
15.5
©Silberschatz, Korth and Sudarshan, Bo Zhou
Concurrent Executions
Multiple transactions are allowed to run concurrently in the system. Advantages are:
Database System Concepts
15.1
©Silberschatz, Korth and Sudarshan, Bo Zhou
Transaction Concept
E.g. Transaction to transfer $50 from account A to account B:
T1 1 2 3 4 5 X = x+1 Write(x) X = x*2 Write(x) Read(x) Read(x) T2
Dirty Read:
T1 1 2 3 rollback Write(T) Read(T) T2
Database System Concepts
15.7
©Silberschatz, Korth and Sudarshan, Bo Zhou
Some notions:
Serial Schedule Equivalent schedule Serializable Schedule
Database System Concepts
15.9
©Silberschatz, Korth and Sudarshan, Bo Zhou
Example Schedules
1. read(A) 2. A := A – 50 3. write(A) 4. read(B) 5. B := B + 50 6. write(B
A transaction is a unit of program execution that accesses and possibly updates various data items.
Consistency problems (Cont.)
Non repeatable read
T1 1 2 3 Read(x) X? Read(x) Write(x) T2

Database System Concepts
15.8
©Silberschatz, Korth and Sudarshan, Bo Zhou
Failure could be due to software or hardware
Database System Concepts
15.4
©Silberschatz, Korth and Sudarshan, Bo Zhou
Example of Fund Transfer (Cont.)
Durability requirement — once the user has been notified that the transaction has completed (i.e., the transfer of the $50 has taken place), the updates to the database by the transaction must persist despite failures. Isolation requirement — if between steps 3 and 6, another transaction is allowed to access the partially updated database, it will see an inconsistent database (the sum A + B will be less than it should be).
Concurrency control schemes – mechanisms to achieve isolation, i.e., to control the interaction among the concurrent transactions in order to prevent them from destroying the consistency of the database
In both Schedule 1 and 3, the sum A + B is preserved.
Database System Concepts 15.11 ©Silberschatz, Korth and Sudarshan, Bo Zhou
15.2
©Silberschatz, Korth and Sudarshan, Bo Zhou
ACID Properties
To preserve integrity of data, the database system must ensure: Atomicity. Either all operations of the transaction are properly reflected in the database or none are.
increased processor and disk utilization, leading to better transaction throughput: one transaction can be using the CPU while another is reading from or writing to the disk reduced average response time for transactions: short transactions need not wait behind long ones.
Let T1 transfer $50 from A to B, and T2 transfer 10% of the balance from A to B. The following is a serial schedule (Schedule 1 in the text), in which T1 is followed by T2.
1. 2. 3. 4. 5. 6. read(A) A := A – 50 write(A) read(B) B := B + 50 write(B)
Consistency requirement – the sum of A and B is unchanged by the execution of the transaction. Atomicity requirement — if the transaction fails after step 3 and before step 6, the system should ensure that its updates are not reflected in the database, else an inconsistency will result.
Database System Concepts
15.6
©Silberschatz, Korth and Sudarshan, Bo Zhou
Consistency problems of concurrent Execution without control
Lost modification:
Database System Concepts
15.3
©Silberschatz, Korth and Sudarshan, Bo Zhou
Example of Fund Transfer
Transaction to transfer $50 from account A to account B:
Chapter 15: Transactions
Transaction Concept Concurrent Executions Serializability Testing for Serializability Recoverability Transaction Definition in SQL
A transaction must see a consistent database. During transaction execution the database may be inconsistent. When the transaction is committed, the database must be consistent.
Two main issues to deal with:
Failures of various kinds, such as hardware failures and system crashes Concurrent execution of multiple transactions
Database System Concepts
Schedules
Schedules – sequences that indicate the chronological order in which instructions of concurrent transactions are executed
a schedule for a set of transactions must consist of all instructions of those transactions must preserve the order in which the instructions appear in each individual transaction.
相关文档
最新文档