2015 fall 1 chapter 1: the database environment 楊立偉教授 台灣大學工管系

24
2015 Fall 2015 Fall 1 Chapter 1: Chapter 1: The Database The Database Environment Environment 楊楊楊楊楊 楊楊楊楊楊楊楊

Upload: daniella-singleton

Post on 04-Jan-2016

223 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

2015 Fall2015 Fall 11

Chapter 1:Chapter 1:The Database The Database EnvironmentEnvironment

楊立偉教授台灣大學工管系

Page 2: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 22

DefinitionsDefinitions Database: organized collection of logically Database: organized collection of logically

related datarelated data Data: stored representations of meaningful Data: stored representations of meaningful

objects and eventsobjects and events Structured: numbers, text, dates Structured: numbers, text, dates 結構性結構性 Unstructured: images, video, documents Unstructured: images, video, documents 非結構性非結構性

Information: data processed to increase Information: data processed to increase knowledge in the person using the dataknowledge in the person using the data

Metadata: data that describes the properties Metadata: data that describes the properties and context of user data and context of user data 描述資料用的註記描述資料用的註記

Page 3: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 33

Figure 1-1a Data in context 範例 : 修課清單

Context helps users understand data

有哪些種類的資料?有哪些欄位?

Page 4: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 44

Graphical displays turn data into useful information that managers can use for decision making and

interpretation 提供決策與解釋之用

Figure 1-1b Summarized data 摘要 ( 描述性 ) 資料

Page 5: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 55

Descriptions of the properties or characteristics of the data, including data

types 資料型別 , field sizes 欄位長度 , allowable values 合法值 , and data context 資料來源與描述

Page 6: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 66

Disadvantages of File Disadvantages of File ProcessingProcessing

1.1. Program-Data Dependence Program-Data Dependence 程式與資料相依程式與資料相依 All programs maintain metadata for each file they useAll programs maintain metadata for each file they use

2.2. Duplication of DataDuplication of Data Different systems/programs have separate copies of the same Different systems/programs have separate copies of the same

datadata

3.3. Limited Data SharingLimited Data Sharing No centralized control of dataNo centralized control of data

4.4. Lengthy Development TimesLengthy Development Times Programmers must design their own file formats Programmers must design their own file formats 欠缺統一格式欠缺統一格式

5.5. Excessive Program MaintenanceExcessive Program Maintenance 80% of information systems budget80% of information systems budget

如果不存在資料庫,就只能存在檔案中,缺點是…

Page 7: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 77

1. Problems with Data 1. Problems with Data DependencyDependency

Each programmer must maintain his/her own Each programmer must maintain his/her own data data 不同人不同人 (( 或系統或系統 )) 得維護自己的資料得維護自己的資料

Each program needs to include code for the Each program needs to include code for the metadata of each file metadata of each file 得在程式中自己定義資料種類得在程式中自己定義資料種類

Each program must have its own processing Each program must have its own processing routines for reading, inserting, updating, and routines for reading, inserting, updating, and deleting data deleting data 在程式中自己處理各項資料操作在程式中自己處理各項資料操作

Lack of coordination and central control Lack of coordination and central control 欠缺控欠缺控管管

Non-standard file formats Non-standard file formats 沒有標準格式沒有標準格式

若不將資料分離開,而程式與資料是相依的話…

Page 8: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 188

Duplicate Data某大傢俱公司的三個部門 ( 系統 )

Page 9: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 99

2. Problems with Data 2. Problems with Data RedundancyRedundancy

Waste of space to have duplicate Waste of space to have duplicate data data 浪費儲存空間浪費儲存空間

Causes more maintenance Causes more maintenance headaches headaches 需更多維護成本需更多維護成本

The biggest problem: The biggest problem: Data changes in one file could Data changes in one file could

cause inconsistencies cause inconsistencies 造成資料不一致性造成資料不一致性 Compromises in Compromises in data integritydata integrity

重複資料的問題

破壞資料整體性破壞資料整體性

Page 10: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1010

SOLUTION: SOLUTION: The DATABASE ApproachThe DATABASE Approach

Central repository of shared data Central repository of shared data 集中儲存集中儲存 Data is managed by a controlling agentData is managed by a controlling agent 統一管理統一管理 Stored in a standardized, convenient Stored in a standardized, convenient

form form 標準並方便處理的格式標準並方便處理的格式

Requires a Database Management System (DBMS)

Page 11: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1111

Database Management System Database Management System (DBMS)(DBMS)

DBMS manages data resources like an operating system manages hardware resources

A software system that is used to create, maintain, and provide controlled access to user databases

Order Filing System

Invoicing System

Payroll System

DBMSCentral database

Contains employee,order, inventory,

pricing, and customer data

集中儲存集中儲存

存取統一控制存取統一控制

不同系統不同系統

Page 12: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1212

Advantages of the Database Advantages of the Database ApproachApproach

Program-data independence Program-data independence 程式與資料獨立切開程式與資料獨立切開 Planned data redundancy Planned data redundancy 避免資料重複避免資料重複 Improved data consistency Improved data consistency 改善資料一致性改善資料一致性 Improved data sharing Improved data sharing 讓資料可共用讓資料可共用 Increased application development productivityIncreased application development productivity

加快應用程式開發加快應用程式開發 Enforcement of standards Enforcement of standards 標準的資料格式標準的資料格式 Improved data quality Improved data quality 改善資料品質改善資料品質 Improved data accessibility and responsivenessImproved data accessibility and responsiveness

更好的資料存取性與回應更好的資料存取性與回應 Reduced program maintenance Reduced program maintenance 減少維護成本減少維護成本

Page 13: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1313

Costs and Risks of the Database Costs and Risks of the Database ApproachApproach

New, specialized personnel New, specialized personnel 需要專人處理需要專人處理 Installation and management cost and Installation and management cost and

complexity complexity 資料庫安裝與管理成本資料庫安裝與管理成本 Conversion costs Conversion costs 轉換資料或系統的成本轉換資料或系統的成本 Need for explicit backup and recoveryNeed for explicit backup and recovery

需要確實備份與復原需要確實備份與復原 Organizational conflictOrganizational conflict

可能會造成組織衝突可能會造成組織衝突

Page 14: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1414

Elements of the Database Elements of the Database ApproachApproach

Data models Data models 資料模型資料模型 Graphical system capturing nature and relationship of Graphical system capturing nature and relationship of

datadata Enterprise Data Model–high-level entities and Enterprise Data Model–high-level entities and

relationships for the organizationrelationships for the organization Project Data Model–more detailed view, matching data Project Data Model–more detailed view, matching data

structure in database or data warehouse structure in database or data warehouse Relational Databases Relational Databases 關聯式資料庫關聯式資料庫

Database technology involving Database technology involving tables (relations)tables (relations) representing entities and primary/foreign keys representing entities and primary/foreign keys representing relationshipsrepresenting relationships

Use of Internet Technology Use of Internet Technology 使用網路技術使用網路技術 Networks and telecommunications, distributed databases, Networks and telecommunications, distributed databases,

client-server, and 3-tier architecturesclient-server, and 3-tier architectures Database Applications Database Applications 資料庫應用資料庫應用

Application programs used to perform database activities Application programs used to perform database activities (create, read, update, and delete (create, read, update, and delete 增查修刪 增查修刪 CRUDCRUD) for ) for database usersdatabase users

Page 15: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1515

Segment of an enterprise data model

Segment of a project-level data model

Figure 1-2 Comparison of enterprise and project level data models

Page 16: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1717

Figure 1-5 Components of the Database Environment

Page 17: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1818

Components of the Database Components of the Database EnvironmentEnvironment

CASE Tools CASE Tools ––computer-aided software engineeringcomputer-aided software engineering Repository Repository ––centralized storehouse of metadatacentralized storehouse of metadata Database Management System (DBMS) Database Management System (DBMS) ––

software for managing the databasesoftware for managing the database Database Database ––storehouse of the datastorehouse of the data Application Programs Application Programs ––software using the datasoftware using the data User InterfaceUser Interface––text and graphical displays to userstext and graphical displays to users 角色 角色 Data/Database AdministratorsData/Database Administrators––personnel personnel

responsible for maintaining the databaseresponsible for maintaining the database 角色 角色 System DevelopersSystem Developers––personnel responsible for personnel responsible for

designing databases and softwaredesigning databases and software 角色 角色 End UsersEnd Users––people who use the applications people who use the applications

and databasesand databases

Page 18: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 1919

The Range of Database The Range of Database ApplicationsApplications

Personal databasesPersonal databases Workgroup databasesWorkgroup databases Departmental/divisional databasesDepartmental/divisional databases Enterprise databaseEnterprise database

Enterprise resource planning (ERP) Enterprise resource planning (ERP) systemssystems

Data warehousing implementationsData warehousing implementations

各種資料庫應用系統 – 會用到資料庫的程式 ( 非常多 )

Page 19: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 2020

Table 1-6 Summary of Database Applications

各種資料庫應用系統的比較表

Page 20: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 2121

人事資料庫系統畫面範例

Page 21: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 2222

Figure 1-7 Workgroup database with wireless local area network

部署在無線區域網路的資料庫系統範例

Page 22: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 2323

Enterprise Database Enterprise Database ApplicationsApplications

Enterprise Resource Planning (ERP)Enterprise Resource Planning (ERP) Integrate all enterprise functions Integrate all enterprise functions

(manufacturing, finance, sales, (manufacturing, finance, sales, marketing, inventory, accounting, human marketing, inventory, accounting, human resources)resources)

相當於 產進銷存相當於 產進銷存 ++ 財會財會 ++ 人資總務人資總務 Data Warehouse Data Warehouse 資料倉儲資料倉儲

Integrated decision support system Integrated decision support system derived from various operational derived from various operational databasesdatabases

Page 23: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 2424

Figure 1-8 An enterprise data warehouse

資料倉儲 資料倉儲 : : 包含包含 // 匯整了整個企業所有的資料匯整了整個企業所有的資料

Page 24: 2015 Fall 1 Chapter 1: The Database Environment 楊立偉教授 台灣大學工管系

Chapter 1 2525

Web-Enabled DatabasesWeb-Enabled Databases

Web applications requiring databases Customer relationship management

(CRM)顧客關係管理 Ex. 網路客服系統

Business-to-consumer (B2C) 面對消費者的電子商務 Ex. PChome

Electronic data interchange (EDI) 電子資料交換 Ex. 網路報稅或網路銀行轉帳結清

需要資料庫的各種網路應用系統