Top Banner
Managing Enterprise Database ISYS 464 David Chao
35
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Managing Enterprise Database ISYS 464 David Chao.

Managing Enterprise Database

ISYS 464

David Chao

Page 2: Managing Enterprise Database ISYS 464 David Chao.

Introduction to Databases

• The most important component of an information system

• Created to support all levels of business operations:– Day-to-day operations

• TPS, CRM, ERP

– Decision-makings• Business intelligence, data warehouse

– Strategic plans

Page 3: Managing Enterprise Database ISYS 464 David Chao.

Definitions• Database: organized collection of logically related data

– A group of related files

• Data: stored representations of meaningful objects and events– Structured: Fixed format record

• numbers, text, dates

– Unstructured: images, video, documents

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

• Metadata: data that describes the properties and context of user data– data about data

Page 4: Managing Enterprise Database ISYS 464 David Chao.

Example of Metadata

Page 5: Managing Enterprise Database ISYS 464 David Chao.

Traditional File-Based Systems

• A collection of application programs that perform services for the end-users. Each program defines and manages its own data.

Page 6: Managing Enterprise Database ISYS 464 David Chao.

Example

Page 7: Managing Enterprise Database ISYS 464 David Chao.

Limitations of the File-Based Approach

• Duplication of data– Data inconsistency– Limited data sharing

• Program-data dependence– When file structure changed, all programs that access

the file must be modified to conform to the new file structure.

– The definition of the data is embedded in the program.

• Fixed queries– No facilities for asking unplanned, ad hoc queries

Page 8: Managing Enterprise Database ISYS 464 David Chao.

Problems with Program-Data Dependency

• Each application program needs to include code for the metadata of each file

• Each application program must have its own processing routines for reading, inserting, updating, and deleting data

Page 9: Managing Enterprise Database ISYS 464 David Chao.

Example: Comma-Delimited File

• It stores each data item with a comma separating each item and places double quotes around string fields.

• Student file with fields: SID, Sname, and GPA– “S5”, ”Peter”, 3.0– “S1”, “Paul”, 2.5

• Questions:– How many students?– What is average GPA?

Page 10: Managing Enterprise Database ISYS 464 David Chao.

Sequentially Accessing the Student File to Compute Average GPA

Dim fileNumber, stCounter As Integer

Dim SID, SNAME As String

Dim gpa, sumGpa As Double

fileNumber = FreeFile()

FileOpen(fileNumber, "c:\stdata.txt", OpenMode.Input)

Do While Not EOF(fileNumber)

Input(fileNumber, SID)

Input(fileNumber, SNAME)

Input(fileNumber, gpa)

sumGpa += gpa

stCounter += 1

Loop

MessageBox.Show(sumGpa / stCounter.ToString)

Note: What happen if the Student File changes structure?

Page 11: Managing Enterprise Database ISYS 464 David Chao.

Database Approach

• Central repository of shared data• The database holds not only the data but also a

description of the data.– System catalog (data dictionary, or metadata)

• A central location where data descriptions are stored.

• Data about data

– Program-data independence

• Demo: VS ProgramDataIndependenceDemoWeb

Page 12: Managing Enterprise Database ISYS 464 David Chao.

Advantages of the Database Approach

• Program-data independence– The separation of data descriptions from the

application programs that use the data.– Allows the data to change without changing the

application programs.

• Planned data redundancy• Improved data consistency• Improved data sharing• Enforcement of standards

Page 13: Managing Enterprise Database ISYS 464 David Chao.

Database Management System (DBMS)

• A software that enables users to define, create, maintain, and control access to the database.– Data Definition Language (DDL)– Data Manipulation Language (DML)– Control access:

• Security, integrity, concurrent access, recovery, support for data communication, etc.

– Utility services• File import/export, monitoring facilities, etc.

• Support Ad Hoc queries

Page 14: Managing Enterprise Database ISYS 464 David Chao.

Database Management System

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 15: Managing Enterprise Database ISYS 464 David Chao.

Evolution of DB Systems

Page 16: Managing Enterprise Database ISYS 464 David Chao.

Database Schema

• External Schema– User Views– Subsets of Conceptual Schema

• Conceptual Schema– This level describes what data is stored in the database

and the relationships among the data.– View of the data administrator

– E-R models

• Internal schema– Physical Schema

• File organizations, indexes

Page 17: Managing Enterprise Database ISYS 464 David Chao.

Different people have different views of the database…these are the external schema

The internal schema is the underlying design and implementation

Figure 2-7 Three-schema architecture

Page 18: Managing Enterprise Database ISYS 464 David Chao.

Data Independence

• Data independence means that upper levels are unaffected by changes to lower levels.– Logical data independence

• Changes to the conceptual level, such as the addition of new entities, attributes, or relationships, should be possible without having to change the existing external level design.

– Physical data independence• Changes to the physical level, such as using a different file

organization, indexes, should be possible without having to change the conceptual level design.

Page 19: Managing Enterprise Database ISYS 464 David Chao.

Three-Level ExampleEmployee Entity

• Conceptual design: – Employee entity with attributes: EmpID, EmpName, DateOfBirth,

Salary, and Sex.• Internal level:

– Logical schema:• EmpID – 4 characters• EmpName – 30 characters• DateOfBirth – Date field 8 bytes• Salary – Number(7,2)• Sex – 1 character

– Physical schema: • Record size = 4 + 30 + 8 + 7 +1 = 50 bytes• Sequential file with index on EmpID field

• External level:• EmpAgeView: • EmpID, EmpName, Age=Year(Today()) – Year(DateOfBirth)• EmpSalaryView: EmpID, EmpName, Salary

Page 20: Managing Enterprise Database ISYS 464 David Chao.

Benefits of Using Views

• Views provide a level of security.

• Views provide a mechanism to customize the appearance of the database.

• Views provide a consistent, unchanging picture of the database, even if the underlying database is changed.

Page 21: Managing Enterprise Database ISYS 464 David Chao.

Database Application

• It is a program that interacts with the database at some point in its execution by issuing an appropriate request (typically an SQL statement) to the DBMS.

• Database programming

Page 22: Managing Enterprise Database ISYS 464 David Chao.

The Range of Database Applications

• Personal databases:– Desktop, PDA/Smart Phone

• Workgroup databases• Departmental/divisional databases• Enterprise database

– Enterprise Resource Planning (ERP)• Integrate all enterprise functions (manufacturing, finance, sales,

marketing, inventory, accounting, human resources)

– Data Warehouse• Integrated decision support system derived from various

operational databases

Page 23: Managing Enterprise Database ISYS 464 David Chao.

The three components in a database application

1. Presentation – user interface• Menus, forms, reports, etc

2. Processing logic • Business rules

3. Database

Page 24: Managing Enterprise Database ISYS 464 David Chao.

Client Database Server

SQL queries

Results

Database Server: A high processing power computer with advanced DBMS.

Client: A PC that runs database applications.

SQL interface.

Page 25: Managing Enterprise Database ISYS 464 David Chao.

Client Functions

• Manages the user interface.

• Accepts and checks syntax of user input.

• Implements business rules.

• Generates database requests and transmits to server.

• Passes response back to user.

Page 26: Managing Enterprise Database ISYS 464 David Chao.

Database Server Functions

• Checks authorization.• Accepts and processes database requests from

clients.• Ensures integrity constraints not violated.• Performs query/update processing and transmits

response to client.• Provides concurrent database access, transaction

management, and recovery control.

Page 27: Managing Enterprise Database ISYS 464 David Chao.

The Web as a Database Application Platform

• Three-tier architecture– Browser - interface– Server

• web server, database server

– processing logic

• Advantages:– Cross-platform support– Graphical user interface

Page 28: Managing Enterprise Database ISYS 464 David Chao.

Figure 2-9 Three-tiered client/server database architecture

Page 29: Managing Enterprise Database ISYS 464 David Chao.

Major Database Management Activities

• Creating database

• Updating database

• Querying database

Page 30: Managing Enterprise Database ISYS 464 David Chao.

Creating Database

• Analysis– System analysis

• Data Flow Diagram, UML

– Data modeling• ERD

• Design– Maps the data model on to a target database model.

• Implementation: Efficiently store and retrieve data– File organization and index

Page 31: Managing Enterprise Database ISYS 464 David Chao.

Updating Database

• Insertions, deletions, modifications– Update pattern:

• Read only, Insertion only, no modification

• Concurrent processing– Read/Write

• Transaction management

Page 32: Managing Enterprise Database ISYS 464 David Chao.

Querying Database

• Relational algebra

• SQL

• QBE

Page 33: Managing Enterprise Database ISYS 464 David Chao.

New Developments in Database

• Object-Oriented database

• Object-Relational database

• Decision support with data warehouse

• Web based database applications

• XML database

Page 34: Managing Enterprise Database ISYS 464 David Chao.

Course Overview• An introduction to the design and use of database:

– Creating database:• Analysis: Data modeling, ERD, Normalization• Design: Relational database design• Implementation:

– Use SQL data definition language to create database

– Updating database:• SQL data manipulation language

– Querying database:• SQL Select commands

• Other database management technologies:– File and index– Data warehouse– Database transaction management– Database security and management

Page 35: Managing Enterprise Database ISYS 464 David Chao.

Download DBMS

• MySQL 5.0 Community Server:– http://dev.mysql.com/downloads/

• Oracle 10g Express Edition:– http://www.oracle.com/technology/products/database/xe/index.html