데이터베이스설계 (database design)contents.kocw.net/kocw/document/2013/koreasejong/... ·...

25
데이터베이스 설계 (Database Design) 시스템분석 및 설계 (Systems Analysis & Design) 13주차

Upload: others

Post on 06-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

데이터베이스 설계(Database Design)

시스템분석 및 설계(Systems Analysis & Design)

13주차

Page 2: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

목차

♥ Database Design♦ 사례(Case)♦ File system♦ Database approach♦ DB 의 장단점♦ Three-level Architecture♦ Data Independence♦ Database Languages♦ Database 설계 과정

Page 3: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

유통회사의 사례

고객

판매부서 재고관리부서

회계부서

주문

고객, 주문

송장

송장

고객, 주문

대금청구

Page 4: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

A Furniture Distribution Company

Customers

Sales Dept.

InventoryDept.

Vendors

AccountingDept.Purchasin

gDept.

Page 5: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

File Systems (1950's)

♥ Basic constructs:

♦ A collection of application programs that perform services for the end users (e.g. reports).

♦ Each program defines and manages its own data.♦ A file contains a set of sequential data records

♦ Each record consists of a set of data fields

Page 6: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

File Systems판매부서

UserProgram 1

UserProgram 2

고객file

주문file

재고관리부서

UserProgram 1

UserProgram 2

제품file

주문file

회계부서

UserProgram 1

UserProgram 2

고객file

제품file

Page 7: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

File SystemsDepartment File Data ItemSales Customers Customer number, Customer name

Address, Telephone NnumberCredit limit, Balance, YTD sales

Orders Order number, Order dateCustomer nameItem 1 number, name, quantity ordered, priceItem 2 number, name, quantity ordered, price

Inventory Products Product number, Product descriptionPrice, Quantity on hand, Quantity in order

Shipments Shipment number, Shipment dateItem 1 no, order no, quantity shipped, priceItem 2 no, order no, quantity shipped, price

Accounting Customers Customer no, Customer nameAddr., Tel. No.Invoice 1 no, date, amount, payment amount, pay. DateInvoice 1 no, date, amount, payment amount, pay. date

Products Product no., Product descriptionProduct price

Page 8: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Disadvantages of File Systems

♥ Uncontrolled data redundancy♦ Data redundancy - A piece of information is stored in multiple places

♥ Data inconsistency♦ Provides inconsistent information depending on the data sources

♥ Poor data sharing♦ Incompatible file formats

♥ High maintenance cost♦ Difficult to keep up with changes♦ Data dependence -File structure is defined in the program code.♦ Fixed Queries/Proliferation of application programs♦ Programs are written to satisfy particular functions. Any new

requirement needs a new program.

Page 9: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

DB Approach

UserProgram 1

UserProgram 2

고객DB

주문DB

회계부서

제품DB

판매부서 재고관리부서

UserProgram 1

UserProgram 2

UserProgram 1

UserProgram 2

DBMS

Page 10: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Definition

♥ Database - an organized collection of related data♥ DBMS - DB를 생성하고 유지, 관리하는 프로그램의 집합

♦ 자료중복을 통제 - 재작업, 저장장치 낭비, 자료 불일치♦ 자료 공유 - concurrency control, user views♦ 다양한 Interface - 질의어, 프로그램 Interface, 메뉴, 자연어♦ Data Relationships♦ Integrity Constraints (무결성 유지)♦ Backup 및 복구

Page 11: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Advantages of DB Systems♥ Control of data redundancy.♥ Data consistency♥ More information from the same amount of data.♥ Sharing of data.♥ Improved data integrity.♥ Improved security.♥ Enforcement of standards.♥ Economy of scale.♥ Balanced conflicting requirements♥ Improved data accessibility and responsiveness♥ Increased productivity♥ Improved maintenance through data independence♥ Increased concurrency♥ Improved backup and recovery services

Page 12: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Disadvantages of DB Systems

♥ Complexity♥ Size♥ Cost of DBMS♥ Additional hardware costs♥ Cost of conversion♥ Performance♥ Higher impact of a failure

Page 13: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Three-level Architecture

Page 14: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Three-level Architecture

♥ External Level♦ Users' view of the database. Describes that part of database

that is relevant to a particular user.

♥ Conceptual Level♦ Community view of the database. Describes what data is

stored in database and relationships among the data.

♥ Internal Level♦ Physical representation of the database on the computer.

Describes how the data is stored in the database.

Page 15: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Objectives of Three-Level Architecture

♥ All users should be able to access same data. ♥ A user's view is immune to changes made in

other views.♥ Users should not need to know physical

database storage details.♥ DBA should be able to change database storage

structures without affecting the users' views.♥ Internal structure of database should be

unaffected by changes to physical aspects of storage.

♥ DBA should be able to change conceptual structure of database without affecting all users.

Page 16: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Data Independence & Three-level Architecture

Page 17: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Data Independence

♥ Logical Data Independence♦ Refers to immunity of external schemas to changes in conceptual

schema.♦ Conceptual schema changes e.g. addition/removal of entities.♦ Should not require changes to external schema or rewrites of

application programs.

♥ Physical Data Independence♦ Refers to immunity of conceptual schema to changes in the

internal schema.♦ Internal schema changes e.g. using different file organizations,

storage structures/devices.♦ Should not require change to conceptual or external schemas.

Page 18: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Database Languages♥ Fourth Generation Language (4GL)

♦ Query Languages♦ Forms Generators♦ Report Generators♦ Graphics Generators♦ Application Generators

♥ Data Manipulation Language (DML)♦ Provides basic data manipulation operations on data

held in the database.♦ Procedural DML - allows user to tell system exactly how

to manipulate data.♦ Non-Procedural DML - allows user to state what data is

needed rather than how it is to be retrieved.

♥ Data Definition Language (DDL)♦ Allows DBA or user to describe and name entities,

attributes and relationships required for the application.

Page 19: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

19

Database 설계 과정

♥ Enterprise Modeling♥ Conceptual Data Modeling♥ Logical Database Design♥ Physical Database Design♥ Database 생성 및 시험 운용

Page 20: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

Enterprise modeling

♥ 조직 전체에서 다루는 data의 구조를 Entity-Relationship 수준에서 작성한 도면

♥ 전사적인 ISP를 수행하는 과정에서 작성되며 개별정보시스템을 개발하는 시점에서는 enterprise model을참조하여 database를 설계함

Page 21: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

21

개념 설계

♥ 개발하려는 DB 시스템이 충족시켜야 할 사용자의요구사항을 정의하는 단계

♥ 업무의 흐름과 내용을 파악♥ 업무에 필요한 자료를 파악한 후 DB에 포함될 자료들을

추출하고 관계를 정의♥ 개념 모형을 도출함♥ 아직 어느 DBMS를 사용할 지를 고려하지 않음

Page 22: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

22

논리 설계

♥ 채택한 data model에 따라 data의 총괄적 구조를 정의♥ DB 구조를 정의하는 schema가 생성됨♥ DBMS 선정♥ 관계형 DB를 채택하는 경우

♦ 사용자 view를 설계♦ table 구성을 정의♦ 정규화♦ 사용자 view의 통합 및 검증

Page 23: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

23

DBMS 선정

♥ 개발하려는 정보시스템이 포함하는 업무 들을 수행하기에가장 적합한 DBMS 선택 (The selection of an appropriate DBMS to support the database application)

♥ Undertaken at any time prior to logical design provided sufficient information is available regarding system requirements.

♥ Define Terms of Reference of study♥ Shortlist two or three products♥ Evaluate products♥ Recommend selection and produce report

Page 24: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

24

물리 설계

♥ 목표: DB 관리의 효율성♦ 데이터 양, 검색 빈도, 검색의 긴급성, 갱신 빈도♦ 색인(index) 설정

♥ The physical realization of the database and application designs.♦ Use DDL of DBMS to create database schemas and empty

database files.♦ Use DDL to create any specified user views.♦ Use 3GL or 4GL to create application programs. Parts of these

programs are the database transactions, created using DML of DBMS possibly embedded in a host programming language.

Page 25: 데이터베이스설계 (Database Design)contents.kocw.net/KOCW/document/2013/koreasejong/... · 2016. 9. 9. · ♦DBMS normally have a utility that loads existing files into the

25

Database 생성 및 시험 운용

♥ Transferring any existing data into the new database and converting any existing applications to run on the new database.♦ DBMS normally have a utility that loads existing files into the

new database. ♦ Where applicable, it may be possible to convert and use

application programs from the old system for use by the new system.

♥ The process of executing the application programs with the intent of finding errors.♦ Use carefully planned test strategies and realistic data. ♦ Testing cannot show the absence of faults; it can show only

that software faults are present.♦ Demonstrates that database and application programs appear

to be working according to requirements.