【正文】
data ? Issues: ? Storage access ? File anization ? Indexing and hashing TCGCSU Database Systems Query Processing 1. Parsing and translation語(yǔ)法分析與轉(zhuǎn)換 2. Optimization優(yōu)化 3. Evaluation評(píng)價(jià) TCGCSU Database Systems Query Processing (Cont.) ? Alternative ways of evaluating a given query ? Equivalent expressions ? Different algorithms for each operation ? Cost difference between a good and a bad way of evaluating a query can be enormous ? Need to estimate the cost of operations ? Depends critically on statistical information about relations which the database must maintain ? Need to estimate statistics for intermediate results to pute cost of plex expressions TCGCSU Database Systems Transaction Management ? A transaction is a collection of operations that performs a single logical function in a database application ? Within an application program, one or more queryandupdate requests to the DBMS can be logically grouped together in order to perform a task. A group of such requests is called a transaction. ? Examples: a customer pays with a credit card, withdraw money from ATM ? Transactionmanagement ponent ensures that the database remains in a consistent (correct) state despite system failures (., power failures and operating system crashes) and transaction failures. ? Concurrencycontrol manager controls the interaction among the concurrent transactions, to ensure the consistency of the database. TCGCSU Database Systems The Database System Environment ? Database system is posed of 5 main parts: 1. Hardware 2. Software ? Operating system software ? DBMS software ? Application programs and utility software 3. People 4. Procedures 5. Data TCGCSU Database Systems The Database System Environment (continued) TCGCSU Database Systems Components of a DBMS TCGCSU Database Systems Components of Database Manager (DM) TCGCSU Database Systems MultiUser DBMS Architectures ? Teleprocessing ? Fileserver ? Clientserver TCGCSU Database Systems Teleprocessing ? Traditional architecture. ? Single mainframe with a number of terminals attached. ? Trend is now towards downsizing. TCGCSU Database Systems Teleprocessing Topology TCGCSU Database Systems FileServer ? Fileserver is connected to several workstations across a work. ? Database resides on fileserver. ? DBMS and applications run on each workstation. ? Disadvantages include: ? Significant work traffic. ? Copy of DBMS on each workstation. ? Concurrency, recovery and integrity control more plex. TCGCSU Database Systems FileServer Architecture TCGCSU Database Systems ClientServer ? Server holds the database and the DBMS. ? Client manages user interface and runs applications. ? Advantages include: ? wider access to existing databases。 ? increased performance。 ? possible reduction in hardware costs。 ? reduction in munication costs。 ? increased consistency. TCGCSU Database Systems ClientServer Architecture TCGCSU Database Systems Alternative ClientServer Topologies TCGCSU Database Systems History of Database Systems ? 1950s and early 1960s: ? Data processing using magic tapes for storage ? Tapes provide only sequential access ? Punched cards for input ? Late 1960s and 1970s: ? Hard disks allow direct access to data ? Hierarchical(IMS) and Network(IDS、 DBTG) data models in widespread use( 1G) ? Ted Codd defines the relational data model ? Would win the ACM Turing Award for this work ? IBM Research begins System R prototype ? UC Berkeley begins Ingres prototype ? Highperformance (for the era) transaction processing TCGCSU Database Systems History (cont.) ? 1980s: ? Research relational prototypes evolve into mercial systems( 2G) ? SQL bees industrial standard ? Parallel and distributed database systems ? Objectoriented database systems( 3G) ? 1990s: ? Large decision support and datamining applications ? Large multiterabyte data warehouses ? Emergence of Web merce ? 2022s: ? XML and XQuery standards ? Automated database administration End of Chapter 1 TCGCSU Database Systems Figure TCGCSU Database Systems Figure TCGCSU Database Systems Database(con’t) ? 人們收集并抽取出一個(gè)應(yīng)用所需要的大量數(shù)據(jù)之后 , 應(yīng)將其保存起來(lái)以供進(jìn)一步加工處理 , 進(jìn)一步抽取有用信息 ? Def. of DB ? An integrated collection of related data constitutes a Database (DB). ? 是 長(zhǎng)期 儲(chǔ)存在計(jì)算機(jī)內(nèi) 、 有 組織 的 、 可 共享 的 大量 數(shù)據(jù)集合 TCGCSU Database Systems 二、數(shù)據(jù)庫(kù) (續(xù) ) ? 數(shù)據(jù)庫(kù)的特征 ? 數(shù)據(jù)按一定的數(shù)據(jù)模型組織 、 描述和儲(chǔ)存 ? 可為各種用戶共享 ? 冗余度較小 ? 數(shù)據(jù)獨(dú)立性較高 ? 易擴(kuò)展 TCGCSU Database Systems 三、數(shù)據(jù)庫(kù)管理系統(tǒng) ? DBMS ? A collection of programs that controls a database. Specifically, it provides us with an interface to create, maintain, and manipulate multiple databases. ? For generalpurpose,是位于用戶與操作系統(tǒng)之間的一層數(shù)據(jù)管理軟件 。 ? DBMS的用途 ? 科學(xué)地組織和存儲(chǔ)數(shù)據(jù) 、 高效地獲取和維護(hù)數(shù)據(jù) TCGCSU Database Systems DBMS的主要功能 ? 數(shù)據(jù)定義功能 提供數(shù)據(jù)定義語(yǔ)言 (DDL) 定義數(shù)據(jù)庫(kù)中的數(shù)據(jù)對(duì)象 ? 數(shù)據(jù)操縱功能 :提供數(shù)據(jù)操縱語(yǔ)言 (DML) 操縱數(shù)據(jù)實(shí)現(xiàn)對(duì)數(shù)據(jù)庫(kù)的基本操作 (查詢 、 插入 、 刪除和修改 ) TCGCSU Database Systems DBMS的主要功能 ? 數(shù)據(jù)庫(kù)的運(yùn)行管理 保證數(shù)據(jù)的安全性 、 完整性 、 多用戶對(duì)數(shù)據(jù)的并發(fā)使用 發(fā)生故障后的系統(tǒng)恢復(fù) ? 數(shù)據(jù)庫(kù)的建立和維護(hù)功能 (實(shí)用程序 ) 數(shù)據(jù)庫(kù)數(shù)據(jù)批量裝載 數(shù)據(jù)庫(kù)轉(zhuǎn)儲(chǔ) 介質(zhì)故障恢復(fù) 數(shù)據(jù)庫(kù)的重組織 性能監(jiān)視等 TCGCSU Database Systems 四、數(shù)據(jù)庫(kù)系統(tǒng) ? Database System: ? Be developed to support the operations of a specific anization or a specific set of applications. ? Consists of 1) an application specific database, 2) the DBMS that maintains that database, and 3) the application software that manipulates the database. ? (數(shù)據(jù)庫(kù)系統(tǒng) ( , 簡(jiǎn)稱 DBS) 是指在計(jì)算機(jī)系統(tǒng)中引入數(shù)據(jù)庫(kù)后的系統(tǒng)構(gòu)成。 在不引起混淆的情況下常常把數(shù)據(jù)庫(kù)系統(tǒng)簡(jiǎn)稱為數(shù)據(jù)庫(kù) 。 ) ? 數(shù)據(jù)庫(kù)系統(tǒng)的構(gòu)成 ? 由數(shù)據(jù)庫(kù) 、 數(shù)據(jù)庫(kù)管理系統(tǒng) ( 及其開(kāi)發(fā)工具 ) 、 應(yīng)用系統(tǒng) 、 數(shù)據(jù)庫(kù)管理員( 和用戶 ) 構(gòu)成 。 TCGCSU Database Systems ? Instructor: 譚長(zhǎng)庚 . ( ) ? Textbook: ? Database – s