Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 1 File Systems and Databases Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.

Similar presentations


Presentation on theme: "1 Chapter 1 File Systems and Databases Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel."— Presentation transcript:

1 1 Chapter 1 File Systems and Databases Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

2 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 2 In this chapter, you will learn: What a database is, what it does, and why database design is important How modern databases evolved from files and file systems About flaws in file system data management What a DBMS is, what it does, and how it fits into the database system About types of database systems and database models

3 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 3 Introducing the Database Data versus Information –Data constitute building blocks of information –Information produced by processing data –Information reveals meaning of data –Good, timely, relevant information key to decision making –Good decision making key to organizational survival

4 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 4 Database Management Database is shared, integrated computer structure housing: –End user data –Metadata Database Management System (DBMS) –Manages Database structure –Controls access to data –Contains query language

5 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 5 Importance of DBMS Makes data management more efficient and effective Query language allows quick answers to ad hoc queries Provides better access to more and better- managed data Promotes integrated view of organization’s operations Reduces the probability of inconsistent data

6 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 6 DBMS Manages Interaction Figure 1.2

7 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 7 Database Design Importance of Good Design –Poor design results in unwanted data redundancy –Poor design generates errors leading to bad decisions Practical Approach –Focus on principles and concepts of database design –Importance of logical design

8 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 8 Historical Roots of Database First applications focused on clerical tasks Requests for information quickly followed File systems developed to address needs –Data organized according to expected use –Data Processing (DP) specialists computerized manual file systems

9 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 9 File Terminology Data –Raw Facts Field –Group of characters with specific meaning Record –Logically connected fields that describe a person, place, or thing File –Collection of related records

10 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 10 Simple File System Figure 1.5

11 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 11 File System Critique File System Data Management –Requires extensive programming in third- generation language (3GL) –Time consuming –Makes ad hoc queries impossible –Leads to islands of information

12 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 12 File System Critique (con’t.) Data Dependence –Change in file’s data characteristics requires modification of data access programs –Must tell program what to do and how –Makes file systems cumbersome from programming and data management views Structural Dependence –Change in file structure requires modification of related programs

13 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 13 File System Critique (con’t.) Field Definitions and Naming Conventions –Flexible record definition anticipates reporting requirements –Selection of proper field names important –Attention to length of field names –Use of unique record identifiers

14 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 14 File System Critique (con’t.) Data Redundancy – Different and conflicting versions of same data – Results of uncontrolled data redundancy Data anomalies –Modification –Insertion –Deletion Data inconsistency –Lack of data integrity

15 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 15 Database Systems Database consists of logically related data stored in a single repository Provides advantages over file system management approach –Eliminates inconsistency, data anomalies, data dependency, and structural dependency problems –Stores data structures, relationships, and access paths

16 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 16 Database vs. File Systems Figure 1.6

17 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 17 Database System Environment Figure 1.7

18 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 18 Database System Types Single-user vs. Multiuser Database –Desktop –Workgroup –Enterprise Centralized vs. Distributed Use –Production or transactional –Decision support or data warehouse

19 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 19 DBMS Functions Data dictionary management Data storage management Data transformation and presentation Security management Multiuser access control Backup and recovery management Data integrity management Database language and application programming interfaces Database communication interfaces

20 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 20 Database Models Collection of logical constructs used to represent data structure and relationships within the database –Conceptual models: logical nature of data representation –Implementation models: emphasis on how the data are represented in the database

21 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 21 Relationships in Conceptual Models –One-to-one (1:1) –One-to-many (1:M) –Many-to-many (M:N) Implementation Database Models –Hierarchical –Network –Relational Database Models (con’t.)

22 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 22 Hierarchical Database Model Logically represented by an upside down tree –Each parent can have many children –Each child has only one parent Figure 1.8

23 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 23 Hierarchical Database Model Advantages –Conceptual simplicity –Database security and integrity –Data independence –Efficiency Disadvantages –Complex implementation –Difficult to manage and lack of standards –Lacks structural independence –Applications programming and use complexity –Implementation limitations

24 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 24 Network Database Model Each record can have multiple parents –Composed of sets –Each set has owner record and member record –Member may have several owners Figure 1.10

25 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 25 Network Database Model Advantages –Conceptual simplicity –Handles more relationship types –Data access flexibility –Promotes database integrity –Data independence –Conformance to standards Disadvantages –System complexity –Lack of structural independence

26 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 26 Relational Database Model Perceived by user as a collection of tables for data storage Tables are a series of row/column intersections Tables related by sharing common entity characteristic(s)

27 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 27 Relational Database Model (con’t.) Figure 1.11

28 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 28 Relational Database Model Advantages –Structural independence –Improved conceptual simplicity –Easier database design, implementation, management, and use –Ad hoc query capability with SQL –Powerful database management system

29 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 29 Relational Database Model Disadvantages –Substantial hardware and system software overhead –Poor design and implementation is made easy –May promote “islands of information” problems

30 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 30 Entity Relationship Database Model Complements the relational data model concepts Represented in an entity relationship diagram (ERD) Based on entities, attributes, and relationships Figure 1.13

31 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 31 Entity Relationship Database Model Advantages –Exceptional conceptual simplicity –Visual representation –Effective communication tool –Integrated with the relational database model Disadvantages –Limited constraint representation –Limited relationship representation –No data manipulation language –Loss of information content

32 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 32 Object-Oriented Database Model Objects or abstractions of real-world entities are stored –Attributes describe properties –Collection of similar objects is a class Methods represent real world actions of classes Classes are organized in a class hierarchy – Inheritance is ability of object to inherit attributes and methods of classes above it

33 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 33 OO Data Model Advantages –Adds semantic content –Visual presentation includes semantic content –Database integrity –Both structural and data independence Disadvantages –Lack of OODM –Complex navigational data access –Steep learning curve –High system overhead slows transactions

34 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 34 Database Models and the Internet Characteristics of “Internet age” databases –Flexible, efficient, and secure Internet access –Easily used, developed, and supported –Supports complex data types and relationships –Seamless interfaces with multiple data sources and structures –Simplicity of conceptual database model –Many database design, implementation, and application development tools –Powerful DBMS GUI make DBA job easier

35 1 Chapter 2 The Relational Database Model Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

36 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 36 In this chapter, you will learn: That the relational database model takes a logical view of data That the relational database model’s basic components are entities and their attributes, and relationships among entities How entities and their attributes are organized into tables About relational database operators, the data dictionary, and the system catalog How data redundancy is handled in the relational database model Why indexing is important

37 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 37 Logical View of Data Relational Database –Designer focuses on logical representation rather than physical –Use of table advantageous Structural and data independence Related records stored in independent tables Logical simplicity –Allows for more effective design strategies

38 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 38 Logical View of Data (con’t.) Entities and Attributes –Entity is a person, place, event, or thing about which data is collected –Attributes are characteristics of the entity Tables –Holds related entities or entity set –Also called relations –Comprised of rows and columns

39 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 39 Table Characteristics Two-dimensional structure with rows and columns Rows (tuples) represent single entity Columns represent attributes Row/column intersection represents single value Tables must have an attribute to uniquely identify each row

40 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 40 Table Characteristics (con’t.) Column values all have same data format Each column has range of values called attribute domain Order of the rows and columns is immaterial to the DBMS

41 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 41 Keys One or more attributes that determine other attributes –Key attribute –Composite key Full functional dependence Entity integrity –Uniqueness –No ‘null’ value in key

42 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 42 Example Tables Figure 2.1

43 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 43 Simple Relational Database Figure 2.2

44 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 44 Keys (con’t.) Superkey –Uniquely identifies each entity Candidate key –Minimal superkey Primary key –Candidate key to uniquely identify all other attributes in a given row Secondary key –Used only for data retrieval Foreign key –Values must match primary key in another table

45 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 45 Integrity Rules Entity integrity –Ensures all entities are unique –Each entity has unique key Referential integrity –Foreign key must have null value or match primary key values –Makes it impossible to delete row whose primary key has mandatory matching foreign key values in another table

46 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 46 Relational Database Operators Relational algebra determines table manipulations Key operators –SELECT –PROJECT –JOIN Other operators –INTERSECT –UNION –DIFFERENCE –PRODUCT –DIVIDE

47 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 47 Union Combines all rows Figure 2.5

48 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 48 Yields rows that appear in both tables Intersect Figure 2.6

49 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 49 Yields rows not found in other tables Difference Figure 2.7

50 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 50 Yields all possible pairs from two tables Product Figure 2.8

51 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 51 Yields a subset of rows based on specified criterion Select Figure 2.9

52 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 52 Yields all values for selected attributes Project Figure 2.10

53 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 53 Information from two or more tables is combined Join Figure 2.11 Figure 2.14

54 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 54 Links tables by selecting rows with common values in common attribute(s) Three-stage process –Product creates one table –Select yields appropriate rows –Project yields single copy of each attribute to eliminate duplicate columns Natural Join Process

55 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 55 Other Joins EquiJOIN –Links tables based on equality condition that compares specified columns of tables –Does not eliminate duplicate columns –Join criteria must be explicitly defined Theta JOIN –EquiJOIN that compares specified columns of each table using operator other than equality one Outer JOIN –Matched pairs are retained –Unmatched values in other tables left null –Right and left

56 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 56 Requires user of single-column table and two-column table Divide Figure 2.17

57 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 57 Data Dictionary and System Catalog Data dictionary –Provides detailed account of all tables found within database –Metadata –Attribute names and characteristics System catalog –Detailed data dictionary –System-created database –Stores database characteristics and contents –Tables can be queried just like any other tables –Automatically produces database documentation

58 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 58 Relationships within Relational Database Relationship classifications –1:1 –1:M –M:N E-R Model –ERD Maps E-R model –Chen –Crow’s Feet

59 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 59 ERD Symbols Rectangles represent entities Diamonds represent the relationship(s) between the entities “1” side of relationship –Number 1 in Chen Model –Bar crossing line in Crow’s Feet Model “ Many” relationships –Letter “M” and “N” in Chen Model –Three pronged “Crow’s foot” in Crow’s Feet Model

60 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 60 Example 1:M Relationship Figure 2.18

61 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 61 Example 1:M Relationship Figure 2.20

62 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 62 Example M:N Relationship Figure 2.23

63 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 63 Example M:N Relationship Figure 2.24

64 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 64 Converting M:N Relationship to Two 1:M Relationships Figure 2.25

65 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 65 Converting M:N Relationship to Two 1:M Relationships (con’t.) Figure 2.26

66 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 66 Converting M:N Relationship to Two 1:M Relationships (con’t.) Figure 2.27

67 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 67 Converting M:N Relationship to Two 1:M Relationships (con’t.) Figure 2.28

68 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 68 Data Redundancy Revisited Foreign keys can reduce redundancy Some redundancy is desirable –Called controlled redundancy –Speed –Information requirements

69 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 69 Points to location Makes retrieval of data faster Indexes Figure 2.31

70 1 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

71 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 71 In this chapter, you will learn: What a conceptual model is and what its purpose is The difference between internal and external models How internal and external models serve the database design process How relationships between entities are defined and refined, and how such relationships are incorporated into the database design process How ERD components affect database design and implementation How to interpret the modeling symbols for the four most popular E-R modeling tools That real-world database design often requires you to reconcile conflicting goals

72 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 72 Basic Modeling Concepts Art and science Good judgment coupled with powerful design tools Models –“Description or analogy used to visualize something that cannot be directly observed” Webster’s Dictionary Data Model –Relatively simple representation of complex real- world data structures

73 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 73 Data Models: Degrees of Data Abstraction Figure 3.1

74 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 74 Degrees of Abstraction Conceptual –Global view of data –Basis for identification and description of main data items –ERD used to represent conceptual data model –Hardware and software independent Internal –Representation of database as seen by DBMS –Adapts conceptual model to specific DBMS –Software dependent

75 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 75 Degrees of Abstraction (con’t.) External –Users’ views of data environment –Provides subsets of internal view –Makes application program development easier –Facilitates designers’ tasks –Ensures adequacy of conceptual model –Ensures security constraints in design Physical –Lowest level of abstraction –Software and hardware dependent –Requires definition of physical storage devices and access methods

76 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 76 The Entity Relationship (E-R) Model Represents conceptual view Main Components –Entities Corresponds to entire table, not row Represented by rectangle –Attributes –Relationships

77 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 77 Attributes Characteristics of entities Domain is set of possible values Primary keys underlined Figure 3.6

78 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 78 Attributes (con’t.) Simple –Cannot be subdivided –Age, sex, marital status Composite –Can be subdivided into additional attributes –Address into street, city, zip Single-valued –Can have only a single value –Person has one social security number Multi-valued –Can have many values –Person may have several college degrees Derived –Can be derived with algorithm –Age can be derived from date of birth

79 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 79 Relationships Association between entities Connected entities are called participants Operate in both directions Connectivity describes relationship classification –1:1, 1:M, M:N Cardinality –Expresses number of entity occurrences associated with one occurrence of related entity

80 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 80 Connectivity and Cardinality in an ERD Figure 3.12

81 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 81 Relationship Strength Existence dependence –Entity’s existence depends on existence of related entities –Existence-independent entities can exist apart from related entities –EMPLOYEE claims DEPENDENT Weak (non-identifying) –One entity is existence-independent on another –PK of related entity doesn’t contain PK component of parent entity Strong (identifying) –One entity is existence-dependent on another –PK of related entity contains PK component of parent entity

82 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 82 Relationship Participation Optional –Entity occurrence does not require a corresponding occurrence in related entity –Shown by drawing a small circle on side of optional entity on ERD Mandatory –Entity occurrence requires corresponding occurrence in related entity –If no optionality symbol is shown on ERD, it is mandatory

83 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 83 Weak Entity Existence-dependent on another entity Has primary key that is partially or totally derived from parent entity Figure 3.19

84 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 84 Relationship Degree Indicates number of associated entities Unary –Single entity –Recursive –Exists between occurrences of same entity set Binary –Two entities associated Ternary –Three entities associated

85 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 85 Three Types of Relationships Figure 3.21

86 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 86 Composite Entities Used to ‘bridge’ between M:N relationships Bridge entities composed of primary keys of each entity needing connection Figure 3.30

87 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 87 Composite Entities (con’t.) Figure 3.31

88 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 88 Entity Supertypes and Subtypes Generalization hierarchy –Depicts relationships between higher-level supertype and lower-level subtype entities –Supertype has shared attributes –Subtypes have unique attributes –Disjoint relationships Unique subtypes Non-overlapping Indicated with a ‘G’ –Overlapping subtypes use ‘Gs’ Symbol

89 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 89 Generalization Hierarchy with Overlapping Subtypes Figure 3.35

90 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 90 Comparison of E-R Modeling Symbols Alternate styles developed to enable easier use of CASE tools Chen –Moved conceptual design into practical database design arena Crow’s Foot –Cannot detail all cardinalities Rein85 –Similar to Crow’s Foot –Operates at higher level of abstraction IDEF1X –Derivative of ICAM studies in the late 1970’s –Uses fewer symbols

91 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 91 Comparison of E-R Modeling Symbols Figure 3.36

92 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 92 Developing an E-R Diagram Iterative Process –Step1: General narrative of organizational operations developed –Step2: Basic E-R Model graphically depicted and reviewed –Step3: Modifications made to incorporate newly discovered E-R components Repeat process until designers and users agree E-R Diagram complete

93 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 93 Supertype/Subtype Relationship in an ERD Figure 3.42

94 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 94 First ERD Segment Established Figure 3.43

95 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 95 Second and Third ERD Segments Established Figures 3.44 & 3.45

96 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 96 Fourth and Fifth ERD Segments Established Figures 3.46 & 3.47

97 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 97 Sixth and Seventh ERD Segments Established Figures 3.48 & 3.49

98 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 98 Eighth ERD Segment Established Figures 3.50

99 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 99 Ninth ERD Segment Established Figures 3.51

100 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 100 Components of E-R Model Table 3.2

101 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 101 Completed ERD Figure 3.52

102 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 102 Challenge of Database Design: Conflicting Goals Database must be designed to conform to design standards High-speed processing may require design compromises Quest for timely information may be the focus of database design Other concerns –Security –Performance –Shared access –Integrity

103 1 Chapter 4 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

104 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 104 In this chapter, you will learn: What normalization is and what role it plays in database design About the normal forms 1NF, 2NF, 3NF, BCNF, and 4NF How normal forms can be transformed from lower normal forms to higher normal forms That normalization and E-R modeling are used concurrently to produce a good database design That some situations require denormalization to generate information efficiently

105 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 105 Database Tables and Normalization Table is basic building block in database design Normalization is process for assigning attributes to entities –Reduces data redundancies –Helps eliminate data anomalies –Produces controlled redundancies to link tables Normalization stages –1NF - First normal form –2NF - Second normal form –3NF - Third normal form –4NF - Fourth normal form

106 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 106 Need for Normalization l Figure 4.1

107 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 107 Figure 4.1 Observations PRO_NUM intended to be primary key Table entries invite data inconsistencies Table displays data anomalies –Update Modifying JOB_CLASS –Insertion New employee must be assigned project –Deletion If employee deleted, other vital data lost

108 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 108 Conversion to 1NF Repeating groups must be eliminated –Proper primary key developed Uniquely identifies attribute values (rows) Combination of PROJ_NUM and EMP_NUM –Dependencies can be identified Desirable dependencies based on primary key Less desirable dependencies –Partial »based on part of composite primary key –Transitive »one nonprime attribute depends on another nonprime attribute

109 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 109 Dependency Diagram (1NF) l Figure 4.4

110 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 110 Data Organization: 1NF l Figure 4.3

111 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 111 1NF Summarized All key attributes defined No repeating groups in table All attributes dependent on primary key

112 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 112 Conversion to 2NF Start with 1NF format: Write each key component on separate line Write original key on last line Each component is new table Write dependent attributes after each key l PROJECT (PROJ_NUM, PROJ_NAME) l EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS, CHG_HOUR) l ASSIGN (PROJ_NUM, EMP_NUM, HOURS)

113 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 113 2NF Conversion Results l Figure 4.5

114 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 114 2NF Summarized In 1NF Includes no partial dependencies –No attribute dependent on a portion of primary key Still possible to exhibit transitive dependency –Attributes may be functionally dependent on nonkey attributes

115 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 115 Conversion to 3NF Create separate table(s) to eliminate transitive functional dependencies l PROJECT (PROJ_NUM, PROJ_NAME) l ASSIGN (PROJ_NUM, EMP_NUM, HOURS) l EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS) l JOB (JOB_CLASS, CHG_HOUR)

116 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 116 3NF Summarized In 2NF Contains no transitive dependencies

117 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 117 Additional DB Enhancements l Figure 4.6

118 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 118 Boyce-Codd Normal Form (BCNF) Every determinant in the table is a candidate key –Determinant is attribute whose value determines other values in row –3NF table with one candidate key is already in BCNF

119 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 119 3NF Table Not in BCNF l Figure 4.7

120 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 120 Decomposition of Table Structure to Meet BCNF l Figure 4.8

121 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 121 Decomposition into BCNF l Figure 4.9

122 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 122 Normalization and Database Design Normalization should be part of the design process E-R Diagram provides macro view Normalization provides micro view of entities –Focuses on characteristics of specific entities –May yield additional entities Difficult to separate normalization from E-R diagramming Business rules must be determined

123 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 123 Initial ERD for Contracting Company l Figure 4.10

124 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 124 Modified ERD for Contracting Company l Figure 4.11

125 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 125 Final ERD for Contracting Company l Figure 4.12

126 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 126 Higher-Level Normal Forms Fourth Normal Form (4NF) –Table is in 3NF –Has no multiple sets of multivalued dependencies

127 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 127 Conversion to 4NF l Figure 4.14 l Multivalued Dependencies l Figure 4.15 l Set of Tables in 4NF

128 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 128 Denormalization Normalization is one of many database design goals Normalized table requirements –Additional processing –Loss of system speed Normalization purity is difficult to sustain due to conflict in: –Design efficiency –Information requirements –Processing

129 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 129 Unnormalized Table Defects Data updates less efficient Indexing more cumbersome No simple strategies for creating views

130 1 Chapter 5 Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

131 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 131 In this chapter, you will learn: The basic commands and functions of SQL How SQL is used for data manipulation (to add, modify, delete, and retrieve data) How to use SQL to query a database to extract useful information How SQL is used for data administration (to create tables, indexes, and views) About more advanced SQL features such as updatable views, stored procedures, and triggers

132 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 132 Introduction to SQL Ideal database language –Create database and table structures –Perform basic data management chores (add, delete, and modify) –Perform complex queries to transform data into useful information SQL is the ideal DB language –Data definition language –Data manipulation language

133 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 133 Good Reasons to Study SQL ANSI standardization effort led to de facto query standard for relational database Forms basis for present and future DBMS integration efforts Becomes catalyst in development of distributed databases and database client/server architecture

134 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 134 Data Definition Commands Create database structure –Holds all tables and is a collection of physical files stored on disk –DBMS automatically creates tables to store metadata –Database administrator creates structure or schema Logical group of tables or logical database Groups tables by owner Enforces security l CREATE SCHEMA AUTHORIZATION Example: CREATE SCHEMA AUTHORIZATION JONES

135 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 135 Creating Table Structure Tables store end-user data May be based on data dictionary entries l CREATE TABLE ( );

136 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 136 Using Domains Domain is set of permissible values for a column Definition requires: –Name –Data type –Default value –Domain constraint or condition l CREATE DOMAIN AS DATA_TYPE [DEFAULT ] l [CHECK ( )]

137 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 137 SQL Integrity Constraints Adherence to entity integrity and referential integrity rules is crucial –Entity integrity enforced automatically if primary key specified in CREATE TABLE command sequence –Referential integrity can be enforced in specification of FOREIGN KEY –Other specifications to ensure conditions met: ON DELETE RESTRICT ON UPDATE CASCADE

138 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 138 Data Manipulation Commands Common SQL Commands l Table 5.3

139 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 139 Data Entry and Saving Enters data into a table Saves changes to disk l INSERT INTO l VALUES (attribute 1 value, attribute 2 value, … etc.); l COMMIT ;

140 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 140 Listing Table Contents and Other Commands Allows table contents to be listed UPDATE command makes data entry corrections ROLLBACK command restores database back to previous condition if COMMIT hasn’t been used DELETE command removes table row l SELECT FROM ;

141 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 141 Queries Creating partial listings of table contents l SELECT FROM WHERE ; l Table 5.4 l Mathematical Operators

142 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 142 Examples Mathematical operators Mathematical operators on character attributes Mathematical operators on dates l SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE l FROM PRODUCT l WHERE V_CODE <> 21344; l SELECT P_CODE,P_DESCRIPT,P_ONHAND,P_MIN,P_PRICE FROM PRODUCT WHERE P_CODE < ‘1558-QWI’; l SELECT P_DESCRIPT,P_ONHAND,P_MIN,P_PRICE,PINDATE FROM PRODUCT WHERE P_INDATE >= ‘01/20/2002’;

143 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 143 Computed Columns New columns can be created through valid computations or formulas –Formulas may contain mathematical operators –May contain attributes of any tables specified in FROM clause Alias is alternate name given to table or column in SQL statement l SELECT P_DESCRIPT,P_ONHAND,P_PRICE,P_ONHAND*P_PRICE l AS TOTVALUE l FROM PRODUCT;

144 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 144 Operators Logical: AND, OR, NOT Rules of precedence –Conditions within parenthesis executed first –Boolean algebra Special –BETWEEN - defines limits –IS NULL - checks for nulls –LIKE - checks for similar string –IN - checks for value in a set –EXISTS - opposite of IS NULL l SELECT * l FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE = 24288;

145 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 145 Advanced Data Management Commands ALTER - changes table structure ADD - adds column MODIFY - changes column characteristics Entering data into new column l ALTER TABLE ADD ( ); l ALTER TABLE MODIFY ( ); l UPDATE PRODUCT SET P_SALECODE = ‘2’ WHERE P_CODE = ‘1546-QQ2’;

146 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 146 Advanced Data Management Commands (con’t.) Dropping a column Arithmetic operators and rules of precedence l ALTER TABLE VENDOR DROP COLUMN V_ORDER; l Table 5.5

147 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 147 Advanced Data Management Commands (con’t.) Copying parts of tables Deleting a table from database Primary and foreign key designation l INSERT INTO SELECT FROM ; l DROP TABLE PART; l ALTER TABLE LINE l ADD PRIMARY KEY (INV_NUMBER, LINE_NUMBER) l ADD FOREIGN KEY (INV_NUMBER) REFERENCES INVOICE l ADD FOREIGN KEY (PROD_CODE) REFERENCES PRODUCT;

148 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 148 Example Aggregate Function Operations COUNT MAX and MIN l SELECT COUNT(DISTINCT V_CODE) FROM PRODUCT; l SELECT COUNT(DISTINCT V_CODE) FROM PRODUCT WHERE P_PRICE <= 10.00; l SELECT MIN(P_PRICE) FROM PRODUCT; l SELECT P_CODE, P_DESCRIPT, P_PRICE FROM PRODUCT WHERE P_PRICE = MAX(P_PRICE);

149 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 149 Example Aggregate Function Operations (con’t.) SUM AVG l SELECT SUM(P_ONHAND * P_PRICE) FROM PRODUCT; l SELECT P_DESCRIPT, P_ONHAND, P_PRICE, V_CODE FROM PRODUCT WHERE P_PRICE > (SELECT AVG(P_PRICE) FROM PRODUCT) ORDER BY P_PRICE DESC;

150 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 150 More Complex Queries and SQL Functions Ordering a listing Results ascending by default –Descending order uses DESC Cascading order sequence l ORDER BY l ORDER BY DESC l ORDER BY

151 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 151 More Complex Queries and SQL Functions (con’t.) Listing unique values –DISTINCT clause produces list of different values Aggregate functions –Mathematical summaries l SELECT DISTINCT V_CODE l FROM PRODUCT; l Table 5.6

152 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 152 More Complex Queries and SQL Functions (con’t.) Grouping data –Creates frequency distributions –Only valid when used with SQL arithmetic functions –HAVING clause operates like WHERE for grouping output l SELECT P_SALECODE, MIN(P_PRICE) FROM PRODUCT_2 GROUP BY P_SALECODE; l SELECT V_CODE,COUNT(DISTINCT(P_CODE)),AVG(P_PRICE) l FROM PRODUCT_2 l GROUP BY V_CODE l HAVING AVG(P_PRICE) < 10;

153 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 153 More Complex Queries and SQL Functions (con’t.) Virtual tables: creating a view –CREATE VIEW command –Creates logical table existing only in virtual memory –SQL indexes l CREATE VIEW PRODUCT_3 AS SELECT P_DESCRIPT, P_ONHAND, P_PRICE FROM PRODUCT WHERE P_PRICE > 50.00; l CREATE INDEX P_CODEX ON PRODUCT(P_CODE);

154 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 154 More Complex Queries and SQL Functions (con’t.) Joining database tables –Data are retrieved from more than one table –Recursive queries joins a table to itself –Outer joins can be used when ‘null’ values need to be included in query result l SELECT PRODUCT.P_DESCRIPT, PRODUCT.P_PRICE, l VENDOR.V_NAME, VENDOR.V_CONTACT, l VENDOR.V_AREACODE, VENDOR.V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE; l SELECT A.EMP_NUM,A.EMP_LNAME,A.EMP_MGR, l B.EMP_LNAME FROM EMP A, EMP B l WHERE A.EMP_MGR=B.EMP_NUM l ORDER BY A.EMP_MGR

155 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 155 Updatable Views Common operation in production environments is use of batch routines to update master table attributes using transaction data Overnight batch jobs Not all views are updatable Restrictions –GROUP BY expressions cannot be used –Cannot use set operators---UNION, INTERSECTION, etc. –Most restrictions based on use of JOINS or group operators in views

156 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 156 Procedural SQL SQL shortcomings –Doesn’t support execution of stored procedures based on logical condition –Fails to support looping operations Solutions –Embedded SQL can be called from within procedural programming languages –Shared Code is isolated and used by all application programs. –Procedural SQL (PL/SQL) stored within the database, executed by DBMS, and invoked by the end user Triggers Stored procedures PL/SQL functions

157 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 157 Procedural SQL (con’t.) Procedural SQL allows the use of procedural code and SQL statements that are stored within the database. The procedural code is executed by the DBMS when it is invoked by the end user. End users can use procedural SQL (PL/SQL) to create: –Triggers –Stored procedures –PL/SQL functions

158 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 158 Triggers Procedural SQL code invoked before or after data row is selected, inserted, or updated Associated with a database table Table may have multiple triggers Executed as part of transaction Can enforce particular constraints Automate critical actions and provide warnings for remedial action Can update values, insert records, and call procedures Add processing power

159 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 159 Triggers (con’t.) Oracle example l CREATE OR REPLACE TRIGGER [BEFORE/AFTER] l [DELETE/INSERT/UPDATE OF <column_name] l ON [FOR EACH ROW] BEGIN PL/SQL instructions; …………… END;

160 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 160 Stored Procedures Named collection of procedural and SQL statements stored in database Invoked by name Executed as unit Invoked with EXEC l CREATE OR REPLACE PROCEDURE procedure_name (argument IN/OUT data-type, etc) IS/AS BEGIN DECLARE variable name and data type PL/SQL or SQL statements; END; l EXEC store_procedure_name l (parameter, parameter, …)

161 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 161 PL/SQL Stored Functions Named group of procedural and SQL statements that returns a value Invoked from within stored procedures or triggers Cannot be invoked from within SQL statements l CREATE FUNCTION function_name (argument IN data-type, etc) RETURN data-type AS BEGIN PL/SQL statements; RETURN (value); …… END;

162 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 162 Artist Database ERD and Tables l Figure 5.55

163 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 163 General Rules Governing Relationships Among Tables l Figure 5.57: M:N, Both Sides Optional l Figure 5.56: M:N, Both Sides Mandatory

164 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 164 General Rules Governing Relationships Among Tables (Con’t.) l Figure 5.58: M:N, One Side Optional l Figure 5.59: 1:M, Both Sides Mandatory

165 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 165 General Rules Governing Relationships Among Tables (Con’t.) l Figure 5.60: 1:M, Both Sides Optional l Figure 5.61: 1:M, Many Side Optional, One Side Mandatory

166 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 166 General Rules Governing Relationships Among Tables (Con’t.) l Figure 5.62: 1:M, One Side Optional, One Side Mandatory l Figure 5.63: 1:1, Both Sides Mandatory

167 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 167 General Rules Governing Relationships Among Tables (Con’t.) l Figure 5.64: 1:1, Both Sides Optional l Figure 5.65: 1:1, One Side Optional, One Side Mandatory

168 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 168 General Rules Governing Relationships Among Tables (Con’t.) l Figure 5.66: Weak Entity, Foreign Key Located in Weak Entity l Figure 5.67: Multivalued Attributes (New Table in 1:M l Relationship, Foreign Key CAR_VIN in the New Table

169 1 Chapter 6 Database Design Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

170 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 170 In this chapter, you will learn: That successful database design must reflect the information system of which the database is a part That successful information systems are subject to frequent evaluation and revision within a framework known as the Systems Development Life Cycle (SDLC) That, within the information system, the most successful databases are subject to frequent evaluation and revision within a framework known as the Database Life Cycle (DBLC) How to conduct evaluation and revision within the SDLC and DBLC frameworks What database design strategies exist: top-down vs. bottom-up design and centralized vs. decentralized design

171 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 171 Data –Raw facts stored in databases –Need additional processing to become useful Information –Required by decision maker –Data processed and presented in a meaningful form –Transformation Changing Data into Information

172 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 172 Database –Carefully designed and constructed repository of facts –Part of an information system Information System –Provides data collection, storage, and retrieval –Facilitates data transformation –Components include: People Hardware Software – Database(s) – Application programs – Procedures The Information System

173 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 173 System Analysis –Establishes need and extent of an information system Systems development –Process of creating information system Database development –Process of database design and implementation –Creation of database models –Implementation Creating storage structure Loading data into database Providing for data management The Information System (Con’t.)

174 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 174 l Figure 6.2 Systems Development Life Cycle

175 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 175 l Figure 6.3 Database Lifecycle (DBLC)

176 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 176 Phase 1: Database Initial Study Purposes –Analyze company situation Operating environment Organizational structure –Define problems and constraints –Define objectives –Define scope and boundaries

177 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 177 Initial Study Activities l Figure 6.4

178 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 178 Phase 2: Database Design Most Critical DBLC phase Makes sure final product meets requirements Focus on data requirements Subphases –Create conceptual design –DBMS software selection –Create logical design –Create physical design

179 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 179 Two Views of Data l Figure 6.5

180 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 180 I. Conceptual Design Data modeling creates abstract data structure to represent real-world items High level of abstraction Four steps –Data analysis and requirements –Entity relationship modeling and normalization –Data model verification –Distributed database design

181 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 181 Data analysis and Requirements Focus on: –Information needs –Information users –Information sources –Information constitution Data sources –Developing and gathering end-user data views –Direct observation of current system –Interfacing with systems design group Business rules

182 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 182 Entity Relationship Modeling and Normalization l Table 6.2

183 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 183 E-R Modeling is Iterative l Figure 6.8

184 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 184 Concept Design: Tools and Sources l Figure 6.9

185 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 185 Data Model Verification E-R model is verified against proposed system processes –End user views and required transactions –Access paths, security, concurrency control –Business-imposed data requirements and constraints Reveals additional entity and attribute details Define major components as modules –Cohesivity –Coupling

186 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 186 E-R Model Verification Process l Table 6.4

187 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 187 Iterative Process of Verification l Figure 6.10

188 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 188 Distributed Database Design Design portions in different physical locations Development of data distribution and allocation strategies

189 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 189 II. DBMS Software Selection DBMS software selection is critical Advantages and disadvantages need study Factors affecting purchasing decision –Cost –DBMS features and tools –Underlying model –Portability –DBMS hardware requirements

190 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 190 III. Logical Design Translates conceptual design into internal model Maps objects in model to specific DBMS constructs Design components –Tables –Indexes –Views –Transactions –Access authorities –Others

191 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 191 IV. Physical Design Selection of data storage and access characteristics –Very technical –More important in older hierarchical and network models Becomes more complex for distributed systems Designers favor software that hides physical details

192 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 192 Physical Organization l Figure 6.12

193 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 193 Phase 3: Implementation and Loading Creation of special storage-related constructs to house end-user tables Data loaded into tables Other issues –Performance –Security –Backup and recovery –Integrity –Company standards –Concurrency controls

194 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 194 Phase 4: Testing and Evaluation Database is tested and fine-tuned for performance, integrity, concurrent access, and security constraints Done in parallel with application programming Actions taken if tests fail –Fine-tuning based on reference manuals –Modification of physical design –Modification of logical design –Upgrade or change DBMS software or hardware

195 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 195 Phase 5: Operation Database considered operational Starts process of system evaluation Unforeseen problems may surface Demand for change is constant

196 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 196 Phase 6: Maintenance and Evaluation Preventative maintenance Corrective maintenance Adaptive maintenance Assignment of access permissions Generation of database access statistics to monitor performance Periodic security audits based on system- generated statistics Periodic system usage-summaries

197 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 197 DB Design Strategy Notes Top-down –1) Identify data sets –2) Define data elements Bottom-up –1) Identify data elements –2) Group them into data sets

198 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 198 Top-Down vs. Bottom-Up l Figure 6.14

199 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 199 Centralized vs. Decentralized Design Centralized design –Typical of simple databases –Conducted by single person or small team Decentralized design –Larger numbers of entities and complex relations –Spread across multiple sites –Developed by teams

200 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 200 Decentralized Design l Figure 6.16

201 1 Chapter 7 The University Lab: Conceptual Design Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

202 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 202 In this chapter, you will learn: How to develop a database initial study How to write a description of operations How to write business rules on which the database design is based How to translate the business rules into ERD segments How to put the ERD segments together to create the initial ERD

203 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 203 Database Initial Study Detailed description of organization’s current and proposed superscript database system environments –Organizational Objectives Structure Operations Problems –System Objectives Scope and boundaries Information sources and users End-user requirements

204 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 204 UCL Database Initial Study Users –Assistant Dean, College of Business –Computer Lab Director –Computer Lab Assistants –Computer Lab Secretary –Computer Lab Graduate Assistants Objectives –Provide users with controlled access to UCL assets –Guide users working with assets and provide problem-solving services

205 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 205 UCL’s Organizational Structure l Figure 7.1

206 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 206 UCL Description of Operations Inventory, storage, order management –Classifications: hardware, software, literature, supplies –Serialized vs. nonserialized items l Table 7.2

207 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 207 UCL Description of Operations (con’t.) Equipment maintenance and repair management –Information kept in Bad Equipment Log and Hardware Returned for Service Log Equipment check-out and check-in management –Form completed when equipment checked out –Notice sent for late equipment Lab assistant payroll management –Time sheets used to track assistants –Hourly basis for a fourteen day period Lab reservation management –Faculty member completes reservation form with date, time, department, and course number Computer lab access management –Lab users sign users’ log and leave University ID card

208 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 208 Common Problems and Constraints in Current System Never up to date and error-ridden Too much data duplication and inconsistency Does not generate useful information Does not allow ad hoc queries CLD spends too much time processing data manually Lack of computerization makes inventory management difficult

209 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 209 Specific Problems Inventory/Storage/Order Management –No access to crucial inventory management data for CLD –UCL needs available stock figures & average use of supplies –CLD does not know item location Equipment maintenance and repair management –CLD cannot generate history for equipment –CLD determine the status of items subject to maintenance procedures

210 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 210 Specific Problems (con’t.) Equipment check-out/check-in management –CLD lacks information about lab assets Lab assistant payroll management –CLD spends too much time summarizing hours worked LAs –CLD cannot estimate work loads Lab reservations management –Manual reservation system inadequate –No statistical information for scheduling lab reservations Computer lab access management –User log not properly maintained –Certain items not returned –Security problems

211 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 211 Constraints for UCL Time Frame –Operational within 3 months Hardware and Software –Use existing UCL hardware and software Distributed Aspects and Expandability –Operate in multiuser environment –Independent of existing administrative systems Cost –Development costs must be minimal –Use no more than two additional terminals –Operate without additional personnel –$9,500 is available

212 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 212 Objectives for UCL General System Objectives –Improve operational efficiency –Provide useful information for planning, control, and security Specific Objectives –Inventory/Storage/Order Management Better purchase order control Monitor supply item stock Control inventory by type and item Quick information about item location Timely information about use of supplies and generate stats to aid in future purchases

213 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 213 Specific Objectives for UCL (con’t.) Equipment maintenance and repair management –Monitor maintenance histories –Track items returned to vendor Equipment check-out/check-in management –Tracks items checked out –Monitor item check-out time –Generate usage statistics Lab assistant payroll management –Scheduling and work loads –Work summaries

214 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 214 Specific Objectives for UCL (con’t.) Lab reservations management –Decrease reservation processing time –Produce reservation schedules –Generate statistical summaries Computer lab access management –Control users and lab resources –Reduce sign-in time –Provide peak use information for scheduling

215 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 215 Scope and Boundaries What will be system’s extent? –UCL portion of organizational chart –Independent of other systems What operational areas are covered by system? –Limited to six areas addressed earlier What design/ implementation strategy to use? –Organization into system modules What modules should be included in system? –Lab management –Inventory management How do modules interface? –Through CHECK_OUT module

216 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 216 Modules and Interfaces l Figure 7.2 l Table 7.4

217 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 217 Conceptual Design: General Systems Requirements Easy to use Provide security measures Fully integrated Able to access system concurrently Perform various functions –Personnel, inventory, order, maintenance, reservation, Check_out, and access Input driven by output

218 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 218 Conceptual Design Phase Confirmation of good data sources l From Table 7.5

219 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 219

220 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 220 l Figure 7.3 Conceptual Design Phase: User Needs

221 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 221

222 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 222 Conceptual Design Phase: Initial Entities l Table 7.8

223 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 223

224 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 224 Business Rule 1 l Figure 7.4

225 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 225 Business Rule 2 l Figure 7.5

226 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 226 Business Rule 3 l Figure 7.6

227 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 227 Business Rule 4 l Figure 7.7

228 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 228 Business Rule 5 l Figure 7.8

229 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 229 Business Rule 6 l Figure 7.9

230 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 230 Business Rule 7 l Figure 7.10

231 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 231 Business Rule 8 l Figure 7.11

232 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 232 Business Rule 9 l Figure 7.12

233 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 233 Business Rule 10 l Figure 7.13

234 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 234 Business Rule 11 l Figure 7.14

235 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 235 Business Rule 12 l Figure 7.15

236 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 236 Business Rule 13 l Figure 7.16

237 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 237 Business Rule 14 l Figure 7.17

238 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 238 Business Rule 15 l Figure 7.18

239 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 239 UCL Entities Considering Business Rules l Table 7.10 l Weak l Composit e

240 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 240 Initial ERD for UCL

241 1 Chapter 8 The University Lab: Conceptual Design Verification, Logical Design, and Implementation Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

242 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 242 In this chapter, you will learn: How the Lab Management System modules are defined and refined How attributes and domains are identified and defined for each of the entities defined in the initial E-R model How the database transactions are identified and defined within the system modules That the design verification process uses modeling and normalization techniques concurrently to find and eliminate data redundancies Review the steps of database implementation Review the steps of database testing and evaluation Review the steps of database operation

243 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 243 Completing Conceptual and Logical Design Detail Matters! –Tasks Entity relationship modeling and normalization Data model verification Logical design Physical design Implementation Testing and Evaluation Operation –Primary modules Lab Management System Inventory Management System

244 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 244 Entities Identified l Table 8.2

245 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 245 Completion of Conceptual Design Refine module definition –Entities –Attributes Normalization process –Discover new entities –Revise attributes

246 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 246 l Figure 8.1 Lab Management System Module E-R Segment

247 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 247 USER Entity l Table 8.3

248 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 248

249 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 249

250 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 250 LAB_ASSISTANT Entity

251 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 251

252 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 252 WORK_SCHEDULE Entity

253 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 253 HOURS_WORKED Entity l Table 8.8

254 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 254 RESERVATION Entity l Table 8.9

255 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 255 Revised RESERVATION Entity l Table 8.10

256 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 256 RES_SLOT (Weak) Entity l Table 8.11

257 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 257 Inventory Management Module E-R Segment l Figure 8.9

258 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 258

259 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 259

260 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 260

261 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 261 INV_Type Entity l Table 8.13

262 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 262 ITEM Entity l Table 8.14

263 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 263 STORAGE Entity l Table 8.15

264 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 264 LOCATION Entity l Table 8.16

265 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 265 REPAIR Entity l Table 8.17

266 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 266 VENDOR Entity l Table 8.18

267 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 267 ORDER Entity l Table 8.19

268 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 268 ORDER_ITEM Entity l Table 8.20

269 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 269 WITHDRAW Entity Revision l Figure 8.19

270 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 270 WITHDRAW Entity and Revision l Table 8.21 l Table 8.22

271 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 271 WD_ITEM (Weak) Entity l Table 8.23

272 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 272 CHECK_OUT Design Revision l Figure 8.22

273 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 273 CHECK_OUT Entity l Table 8.24

274 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 274 CHECK_OUT_ITEM (Weak) Entity l Table 8.25

275 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 275 E-R Model Verification Establishes –Design reflects end user views of database –Database transactions defined and modeled so design supports related requirements –Design meets output requirements –Design supports required input screens and data entry forms –Design flexible to support future enhancements Verification identifies –Central entity –Each module and its components –Each module transaction requirement

276 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 276 Inventory Management Reporting Problems Generates three reports; one is inventory movement report –Inventory movements spread across different entities –Difficult to generate output and reduces performance Item “quantity on hand” updated with different inventory movements –Purchase, withdraw, check-out, check-in, or inventory adjustment –Only withdrawals and check-outs represented in model

277 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 277 Inventory Management Reporting Problems Solution Create new entity as common movement entry point INV_TRANS created –Standardizes inventory module interfaces –Facilitates control and generation of required outputs

278 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 278 Inventory Transaction Process l Figure 8.25

279 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 279 INV_TRANS Entity l Table 8.26

280 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 280 TR_ITEM (Weak) Entity l Table 8.27

281 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 281 Initial ERD for UCL

282 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 282 Revised University Computer Lab ERD l Figure 8.28

283 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 283 Logical Design Translates conceptual model to format for selected DBMS Sets stage for creating table structures, indexes, and views Table structures can be created with CREATE TABLE SQL commands Views created with CREATE VIEW SQL Commands Indexes created with CREATE INDEX SQL Commands

284 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 284 Physical Design Defines specific storage or access methods used by database Includes estimate of storage space Characteristics are function of DBMS and operating systems

285 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 285 Implementation Database administrator (DBA) –Controls database management function –Defines standards and procedures required to interact with the database –Adopts appropriate plan Plan elements –Definitions of processes and standards –Chronology of required activities Database creation Loading and Conversion –Documentation standards –Responsibilities for continued development and maintenance

286 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 286 Testing and Evaluation Determine how well database meets goals Ongoing process Considerations –Performance measures –Security –Backup and recovery procedures

287 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 287 Operation Provides support for daily operations Maintains operational procedures Database maintenance and evolution –DBA performs technical and managerial duties to ensure proper operation of database to support organizational mission

288 1 Chapter 9 Transaction Management and Concurrency Control Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

289 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 289 In this chapter, you will learn: What a database transaction is and what its properties are How database transactions are managed What concurrency control is and what role it plays in maintaining the database’s integrity What locking methods are and how they work How database recovery management is used to maintain database integrity

290 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 290 Logical unit of work Must be either entirely completed or aborted No intermediate states are acceptable What is a Transaction? l Figure 9.1

291 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 291 Examine current account balance Consistent state after transaction No changes made to Database Example Transaction l SELECT ACC_NUM, ACC_BALANCE FROM CHECKACC WHERE ACC_NUM = ‘0908110638’;

292 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 292 Register credit sale of 100 units of product X to customer Y for $500 Consistent state only if both transactions are fully completed DBMS doesn’t guarantee transaction represents real-world event Example Transaction l UPDATE PRODUCT SET PROD_QOH = PROD_QOH - 100 WHERE PROD_CODE = ‘X’; l UPDATE ACCT_RECEIVABLE l SET ACCT_BALANCE = ACCT_BALANCE + 500 WHERE ACCT_NUM = ‘Y’;

293 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 293 Atomicity –All transaction operations must be completed –Incomplete transactions aborted Durability –Permanence of consistent database state Serializability –Conducts transactions in serial order –Important in multi-user and distributed databases Isolation –Transaction data cannot be reused until its execution complete Transaction Properties

294 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 294 Transaction support –COMMIT –ROLLBACK User initiated transaction sequence must continue until: –COMMIT statement is reached –ROLLBACK statement is reached –End of a program reached –Program reaches abnormal termination Transaction Management with SQL

295 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 295 Tracks all transactions that update database May be used by ROLLBACK command May be used to recover from system failure Log stores –Record for beginning of transaction –Each SQL statement Operation Names of objects Before and after values for updated fields Pointers to previous and next entries –Commit Statement Transaction Log

296 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 296 Transaction Log Example l Table 9.1

297 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 297 Coordinates simultaneous transaction execution in multiprocessing database –Ensure serializability of transactions in multiuser database environment –Potential problems in multiuser environments Lost updates Uncommitted data Inconsistent retrievals Concurrency Control

298 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 298 Lost Updates l Table 9.2 l Table 9.3

299 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 299 Uncommitted Data l Table 9.5 l Table 9.4

300 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 300 Inconsistent Retrievals l Table 9.6 l Table 9.7

301 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 301 Inconsistent Retrievals (con’t.) l Table 9.8

302 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 302 Establishes order of concurrent transaction execution Interleaves execution of database operations to ensure serializability Bases actions on concurrency control algorithms –Locking –Time stamping Ensures efficient use of computer’s CPU The Scheduler

303 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 303 Read/Write Conflict Scenarios: Conflicting Database Operations Matrix l Table 9.9

304 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 304 Concurrency Control with Locking Methods Lock guarantees current transaction exclusive use of data item Acquires lock prior to access Lock released when transaction is completed DBMS automatically initiates and enforces locking procedures Managed by lock manager Lock granularity indicates level of lock use

305 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 305 Database-Level Locking Sequence l Figure 9.2

306 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 306 Table-Level Lock Example l Figure 9.3

307 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 307 Page-Level Lock Example l Figure 9.4

308 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 308 Row-Level Lock Example l Figure 9.5

309 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 309 Two states –Locked (1) –Unlocked (0) Locked objects unavailable to other objects –Unlocked objects open to any transaction –Transaction unlocks object when complete Binary Locks

310 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 310 Example of Binary Lock Table l Table 9.10

311 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 311 Shared/Exclusive Locks Shared –Exists when concurrent transactions granted READ access –Produces no conflict for read-only transactions –Issued when transaction wants to read and exclusive lock not held on item Exclusive –Exists when access reserved for locking transaction –Used when potential for conflict exists –Issued when transaction wants to update unlocked data

312 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 312 Problems with Locking Transaction schedule may not be serializable –Managed through two-phase locking Schedule may create deadlocks –Managed by using deadlock detection and prevention techniques

313 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 313 Two-Phase Locking Growing phase Shrinking phase Governing rules –Two transactions cannot have conflicting locks –No unlock operation can precede a lock operation in the same transaction –No data are affected until all locks are obtained

314 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 314 Two-Phase Locking Protocol l Figure 9.6

315 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 315 Deadlocks Occurs when two transactions wait for each other to unlock data Called deadly embrace Control techniques –Deadlock prevention –Deadlock detection –Deadlock avoidance

316 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 316 How Deadlock Conditions Created l Table 9.11

317 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 317 Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces order for transaction submission Properties –Uniqueness –Monotonicity DBMS executes conflicting operations in time stamp order Each value requires two additional time stamps fields –Last time field read –Last update

318 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 318 Concurrency Control with Optimistic Methods Assumes most database operations do not conflict Transaction executed without restrictions until committed Phases: –Read Phase –Validation Phase –Write Phase

319 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 319 Restores a database to previously consistent state Based on the atomic transaction property Level of backup –Full backup –Differential –Transaction log Database Recovery Management

320 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 320 Software Hardware Programming Exemption Transaction External Causes of Database Failure

321 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 321 Deferred-write and Deferred-update –Changes are written to the transaction log –Database updated after transaction reaches commit point Write-through –Immediately updated by during execution –Before the transaction reaches its commit point –Transaction log also updated –Transaction fails, database uses log information to ROLLBACK Transaction Recovery

322 1 Chapter 10 Distributed Database Management Systems Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

323 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 323 In this chapter, you will learn: What a distributed database management system (DDBMS) is and what its components are How database implementation is affected by different levels of data and process distribution How transactions are managed in a distributed database environment How database design is affected by the distributed database environment

324 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 324 Evolution of DDBMS Decentralized database management systems (DDBMS) –Interconnected computer systems –Data/processing functions reside on multiple sites 1970’s: Centralized DBMS 1980’s: Social and Technical Changes –Ad hoc capability required –Decentralized management structure common 1990’s: New forces –Internet and the World Wide Web used for data access and distribution –Data analysis through data mining and data warehousing

325 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 325 DDBMS Advantages Data located near site with greatest demand Faster data access Faster data processing Growth facilitation Improved communications Reduced operating costs User-friendly interface Less danger of single-point failure Processor independence

326 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 326 DDBMS Disadvantages Complexity of management and control Security Lack of standards Increased storage requirements Greater difficulty in managing data environment Increased training costs

327 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 327 Distributed Processing Shares database’s logical processing among physically, networked independent sites l Figure 10.1

328 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 328 Distributed Database Stores logically related database over physically independent sites l Figure 10.2

329 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 329 Distributed Database vs. Distributed Processing Distributed processing –Does not require distributed database –May be based on a single database on single computer –Copies or parts of database processing functions must be distributed to all data storage sites Distributed database –Requires distributed processing Both –Require a network to connect components

330 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 330 Functions of DDBMS Application/end user interface Validation to analyze data requests Transformation to determine request components Query optimization to find the best access strategy Mapping to determine the data location I/O interface to read or write data Formatting to prepare the data for presentation Security to provide data privacy Backup and recovery DB Administration Concurrency Control Transaction Management

331 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 331 Centralized Database l Figure 10.3

332 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 332 Fully Distributed Database Management System l Figure 10.4

333 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 333 DDBMS Components Computer workstations Network hardware and software components Communications media Transaction processor (TP) –Also called application manager (AP) or transaction manager (TM) Data processor (DP) –Also called data manager (DM)

334 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 334 Distributed Database Components l Figure 10.5

335 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 335 DDBMS Protocols Interface with network to transport data and commands between DPs and TPs Synchronize data received from DPs and route to appropriate TPs Ensure common database functions –Security –Concurrency control –Backup and recovery

336 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 336 Levels of Data and Process Distribution Database systems can be classified based on process distribution and data distribution l Table 10.1

337 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 337 Single-Site Processing, Single-Site Data (SPSD) All processing on single CPU or host computer All data are stored on host computer disk DBMS located on the host computer DBMS accessed by dumb terminals Typical of mainframe and minicomputer DBMSs Typical of 1st generation of single-user microcomputer database

338 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 338 Single-Site Processing, Single-Site Data (con’t.) l Figure 10.6

339 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 339 Multiple-Site Processing, Single-Site Data (MPSD) Requires network file server Applications accessed through LAN Variation known as client/server architecture l Figure 10.7

340 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 340 Multiple-Site Processing, Multiple-Site Data (MPMD) Fully distributed DDBMS with support for multiple DPs and TPs at multiple sites –Homogeneous I Integrate one type of centralized DBMS over the network –Heterogeneous Integrate different types of centralized DBMSs over a network

341 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 341 Heterogeneous Distributed Database Scenario l Figure 10.8

342 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 342 Distributed DB Transparency Allows end users to feel like only database user Hides complexities of distributed database Transparency features –Distribution –Transaction –Failure –Performance –Heterogeneity

343 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 343 Distribution Transparency Allows management of a physically dispersed database as though it were centralized Three Levels –Fragmentation transparency –Location transparency –Local mapping transparency l Table 10.2

344 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 344 Transaction Transparency Ensures transactions maintain integrity and consistency Completed only if all involved database sites complete their part of the transaction Management mechanisms –Remote request –Remote transaction –Distributed transaction –Distributed request

345 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 345 Remote Request l Figure 10.10

346 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 346 Remote Transaction l Figure 10.11

347 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 347 Distributed Transaction l Figure 10.12

348 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 348 Distributed Requests l Figure 10.13

349 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 349 Distributed Requests (con’t.) l Figure 10.14

350 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 350 Distributed Concurrency Control Multisite, multiple-process operations more likely to create data inconsistencies and deadlocked transactions Problems –Transaction committed by local DP –One DP could not commit transaction’s result –Yields inconsistent database

351 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 351 Two-Phase Commit Protocol DO-UNDO-REDO protocol –Write-ahead protocol –Two kinds of nodes Coordinator Subordinates Phases –Preparation Coordinator sends message to all subordinates Confirms all are ready to commit or abort –Final Commit Ensures all subordinates have committed or aborted

352 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 352 Performance Transparency and Query Optimization Objective: Minimize total cost associated with execution of request Main costs –Access time –Communication –CPU time Basis for query optimization algorithms –Optimum execution order –Sites accessed to minimize communication costs Dynamic or static optimization Statistically based vs. rule-based query optimization algorithms

353 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 353 Distributed Database Design Partition database into fragments –Horizontal –Vertical –Mixed Fragments to replicate –Storage of data copies at multiple sites –Fully, partially, unreplicated databases Data allocation –Where to locate data –Centralized, partitioned, replicated

354 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 354 Client/Server Advantages Over DDBMS Client/server less expensive Client/server solutions allow use of microcomputer’s GUI More people with PC skills than mainframe skills PC is well established in workplace Numerous data analysis and query tools exist Considerable cost advantages to off-loading application development

355 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 355 Client/Server Disadvantages Creates more complex environment with different platforms Increased number of users and sites creates security problems Training issues become more complex and expensive

356 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 356 Date’s 12 Commandments for Distributed Databases 1. Local Site Independence 2. Central Site Independence 3. Failure Independence 4. Location Transparency 5. Fragmentation Transparency 6. Replication Transparency

357 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 357 Date’s 12 Commandments for Distributed Databases 7. Distributed Query Processing 8. Distributed Transaction Processing 9. Hardware Independence 10. Operating System Independence 11. Network Independence 12. Database Independence

358 1 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

359 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 359 What basic concepts govern OO systems What effect OO concepts are likely to have on data modeling and design How OO features are related to the more traditional relational and E-R models What the basic features of an OO database management system (OODBMS) are About the advantages and disadvantages of OODBMSs In this chapter, you will learn:

360 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 360 Object Orientation –Set of design and development principles –Based on autonomous computer structures known as objects OO Contribution areas –Programming Languages –Graphical User Interfaces –Databases –Design –Operating Systems

361 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 361 Concepts stem from object-oriented programming languages (OOPLs) –Ada, ALGOL, LISP, SIMULA OOPLs goals –Easy-to-use development environment –Powerful modeling tools for development –Decrease in development time –Make reusable code OO Attributes –Data set not passive –Data and procedures bound together –Objects can act on self Evolution of OO Concepts

362 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 362 OO Concepts: Objects Abstract representation of a real-world entity –Unique identity –Embedded properties –Ability to interact with other objects and self OID –Unique to object –Not a primary key Attributes –Called instance variables –Domain Object state –Object values at any given time

363 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 363 OO Concepts: Objects (con’t.) Methods –Code that performs operation on object’s data –Has name and body Messages –Invokes method –Sent to object Classes –Collection of similar objects –Shares attributes and structure Protocol –Represents object’s public aspect

364 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 364 OO Concepts: Objects (con’t.) Class hierarchy –Code that performs operation on object’s data –Has name and body

365 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 365 Object Characteristics l Figure 11.7

366 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 366 Class Hierarchy Superclass Subclass Class lattice l Figure 11.8

367 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 367 Inheritance Ability of object to inherit the data structure and behavior of classes above it Single inheritance –Class has one immediate superclass l Figure 11.9

368 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 368 Inheritance (con’t.) Multiple –Class has more than one immediate superclass l Figure 11.10

369 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 369 Method Overriding Method redefined at subclass level l Figure 11.12

370 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 370 Polymorphism Allows different objects to respond to same message in different ways l Figure 11.13

371 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 371 Abstract Data Types (ADT) Describes a set of similar objects Differs from conventional data types –Operations are user-defined –Uses encapsulation Definitions needed for creation –Name –Data representation –Abstract data type operations and constraints

372 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 372 Object Classification Simple –Only single-valued attributes –No attributes refer to other object Composite –At least one multivalued attribute –No attributes refer to other object Compound –At least one attribute that references other object Hybrid –Repeating group of attributes –At least one refers to other object

373 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 373 Characteristics of OODM Supports complex objects Must be extensible Supports encapsulation Exhibit inheritance Supports object identity

374 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 374 OO vs. E-R Model Components l Table 11.3

375 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 375 Shared Representation for all Objects of the Class Person l Figure 11.14 l Figure 11.15

376 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 376 Referential Sharing of Objects l Figure 11.19

377 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 377 Class-Subclass Relationship l Figure 11.20 l Figure 11.21

378 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 378 Attribute-Class Link Object’s attribute references another object Relationship Representation –Related classes enclosed in boxes –Double line on right side indicates mandatory –Connectivity indicated by labeling each box 1:M M:N M:N with an Intersection Class Interobject Relationships

379 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 379 1:1 and 1:M Relationships l Figure 11.24

380 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 380 Employee-Dependent Relationship l Figure 11.25

381 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 381 Representing the M:N Relationship l Figure 11.26

382 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 382 Representing the M:N Relationship with Associated Attributes l Figure 11.27

383 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 383 Representing the M:N Relationship with Intersection Class l Figure 11.28

384 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 384 Object Space Representation l Figure 11.29

385 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 385 Late binding –Data type of attribute not known until runtime –Allows different instances of same class to contain different data types for same attribute Early binding –Allows database to check data type at compilation or definition time Late and Early Binding

386 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 386 Object, Entity, and Tuple –OODM object has behavior, inheritance, and encapsulation –OO modeling more natural Class, Entity Set, and Table –Class allows description of data and behavior –Class allows abstract data types Encapsulation and Inheritance –Object inherits properties of superclasses –Encapsulation hides data representation and method OODM vs. E-R Data Models

387 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 387 Object ID –Not supported in relational models Relationships –OODM Interclass references Class hierarchy inheritance –Relational models Value-based approach OODM vs. E-R Data Models (con’t.) Access –Relational models SQL –OODM Navigational Set-oriented access

388 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 388 OODBMS Database management system integrates benefits of typical database systems with OODM characteristics Handles a mix of data types Follows OO rules Follows DBMS rules

389 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 389 Provides data identification and the procedures for data manipulation Data and procedures self-contained entity Iterative and incremental DBA does more programming Lack of standards OO and Database Design

390 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 390 OODBMS Advantages More semantic information Support for complex objects Extensibility of data types May improve performance with efficient caching Versioning Reusability Inheritance speeds development and application Potential to integrate DBMSs into single environment

391 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 391 OODBMS Disadvantages Strong opposition from the established RDBMSs Lack of theoretical foundation Throwback to old pointer systems Lack of standard ad hoc query language Lack of business data design and management tools Steep learning curve Low market presence Lack of compatibility between different OODBMSs

392 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 392 OO Influences on Relational Model Extensibility of new user-defined (abstract) data types Complex objects Inheritance Procedure calls (rules or triggers) System-generated identifiers (OID surrogates)

393 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 393 The Next Generation of DBMS Object-oriented database systems Artificial intelligence systems Expert systems Distributed database The Internet

394 1 Chapter 12 Client/Server Systems Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

395 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 395 In this chapter, you will learn: What client/server computing is What the advantages of using client/server systems are How client/server systems evolved About client/server systems components and how they interact What effect the client/server system has on the DBMS How client/server systems might be introduced into an organization What factors affect the implementation of client/server systems

396 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 396 Client/Server Computing Computing model for the development of computerized systems –Client requests specific service –Server provides requested service Reside on same or different computers l Figure 12.1

397 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 397 Client/Server Computing (con’t.) Key to client server power is where request processing takes place Extent of sharing processing –Thin client –Thin server –Fat client –Fat server Classification –2-tier –3-tier

398 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 398 Forces that Drive Client/Server Trend Changing business environment Growing need for enterprise data access Demand for end-user productivity gains based on efficient use of data Technological advances Growing cost/performance advantages

399 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 399 Evolution of Computing Environment l Figure 12.2

400 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 400 Mainframe vs. Client/Server Systems l Table 12.1

401 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 401 Managerial Expectations of Client/Server Systems Client/Server efficiency functions –Platform independent development –Optimized distribution of processing activities among different platforms –User friendly and cost effective techniques, methodologies, and specialized tools Observations –Tool, not end goal –Not answer to all data management problems –Has own set of management problems

402 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 402 MIS Expectations of Client/Server Benefits Reduced development and implementation costs Reduced development time and increased programmer productivity Extended system life cycle through scalability and portability Reduced system operational cost Change of MIS function from development to end- user support Enhanced information deployment

403 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 403 Organizational Expectations of Client/Server Benefits Flexibility and adaptability Improved employee productivity Improved company work flow and way to reengineer business operations New opportunities for competitive advantages Increased customer service satisfaction

404 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 404 Client –Front-end application Server –Back-end application Communications middleware –Communications layer Components of Client/Server Architecture l Figure 12.3

405 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 405 Example Client/Server Architecture l Figure 12.4

406 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 406 Client/Server Principles Hardware independence Software independence –Operating systems –Network systems –Applications Open access to services Process distribution –Process autonomy –Maximization of local resources –Scalability and flexibility –Interoperability and integration Standards

407 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 407 File services Print services Fax services Communications services Database services Transaction services Miscellaneous services Server Components

408 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 408 Server Components l Figure 12.6

409 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 409 Fast CPU Fault-tolerant capabilities –Dual power –Standby power –Error checking and correcting memory –RAID Expandability of CPU, memory, disk, and peripherals Bus support for multiple add-on boards Multiple communications options Typical Characteristics of Server Hardware

410 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 410 Location independence Resource optimization Scalability Interoperability and integration Server Process Benefits

411 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 411 Database Middleware Network independence –Front-end application accesses data without regard to network protocols Database server independence –Generic SQL to access different database servers –Isolates programmer from SQL dialect differences

412 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 412 Two levels –Physical level Client and server computers –Logical level Client and server processes Interprocess communication (ICP) protocols Communications Middleware

413 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 413 OSI Network Reference Model l Table 12.2

414 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 414 Information Flow through OSI Model l Figure 12.7

415 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 415 Transport Process ID l Figure 12.8

416 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 416 Transmission Control Protocol/Internet Protocol (TCP/IP) Internetwork Packet Exchange/ Sequenced Packet Exchange (IPX/SPX) Network Basic Input Output System (NetBIOS) Application Program to Program Communications (APPC) Network Protocols

417 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 417 Database Middleware Components l Figure 12.9

418 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 418 Interactions between Middleware Components l Figure 12.10

419 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 419 Middleware Accessing Multiple Database Servers l Figure 12.11

420 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 420 Middleware Accessing Mainframe Databases l Figure 12.12

421 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 421 Messaging-oriented middleware (MOM) Remote-procedure-call-based (RPC-based) middle ware Object-based middleware Middleware Classifications

422 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 422 Client operating systems –Microsoft Windows –OS/2, Apple Mac OS, Unix, Linux Client graphical user interfaces –Microsoft Windows –OS/2 Presentation Manager, Macintosh, UNIX Server operating systems and network protocols –Database servers: Unix, OS/2, Windows NT Server/2000 Server –Printer and file servers: Novell Netware –LAN protocols: TCP/IP, IPX/SPX, NetBIOS Middleware –ODBC, IDAPI, DRDA, Q+E Competing Standards

423 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 423 Transparent data access to multiple, heterogeneous clients Allow client requests to the database server over network Process client data requests at local server Send only SQL results to clients over network Client/Server DBMS Functions

424 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 424 Application Logic Components l Figure 12.14

425 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 425 Two Key Questions –How is the division made? –Where should the results of division be placed? Five Functional Logic Components –Presentation logic –I/O processing logic –Application of business logic –Data management logic –Data manipulation logic Client/Server Architectural Styles

426 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 426 Application Functional Components l Figure 12.15

427 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 427 Functional Logic Splitting l Figure 12.16

428 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 428 Proprietary to open systems Maintenance-oriented coding to analysis, design, and service Data collection to data deployment Centralized to distributed style Vertical, inflexible to horizontal, flexible organizational style Differences in IS components Client/Server versus Traditional DP

429 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 429 Management Issues –Communications infrastructure –Applications –Controlling escalating and hidden costs –People and cultural changes –Multiple vendor relationships Development tool acquisition Determination if client/server approach is correct Client/Server Implementation Issues

430 1 Chapter 13 The Data Warehouse Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

431 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 431 In this chapter, you will learn: How operational data and decision support differ What a data warehouse is and how its data are prepared What star schemas are and how they are constructed What steps are required to implement a data warehouse successfully What data mining is and what role it plays in decision support

432 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 432 External and internal forces require tactical and strategic decisions Search for competitive advantage Business environments are dynamic Decision-making cycle time is reduced Different managers require different decision support systems (DSS) The Need for Data Analysis

433 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 433 Decision Support –Is a methodology –Extracts information from data –Uses information as basis for decision making Decision Support Systems

434 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 434 Decision Support Systems Decision support system (DSS) –Arrangement of computerized tools –Used to assist managerial decision –Extensive data “massaging” to produce information –Used at all levels in organization –Tailored to focus on specific areas and needs –Interactive –Provides ad hoc query tools

435 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 435 DSS Components l Figure 13.1

436 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 436 Operational data –Relational, normalized database –Optimized to support transactions –Real time updates DSS –Snapshot of operational data –Summarized –Large amounts of data Data analyst viewpoint –Timespan –Granularity –Dimensionality Operational vs. Decision Support Data

437 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 437 Database schema –Support complex (non-normalized) data –Extract multidimensional time slices Data extraction and filtering End-user analytical interface Database size –Very large databases (VLDBs) –Contains redundant and duplicated data The DSS Database Requirements

438 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 438 Integrated –Centralized –Holds data retrieved from entire organization Subject-Oriented –Optimized to give answers to diverse questions –Used by all functional areas Time Variant –Flow of data through time –Projected data Non-Volatile –Data never removed –Always growing Data Warehouse

439 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 439 Creating a Data Warehouse l Figure 13.3

440 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 440 Single-subject data warehouse subset Decision support to small group Can be test for exploring potential benefits of Data warehouses Address local or departmental problems Data Marts

441 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 441 DSS Architectural Styles Traditional mainframe-based OLTP Managerial information system (MIS) with 3GL First-generation departmental DSS First-generation enterprise data warehouse using RDMS Second-generation data warehouse using MDBMS

442 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 442 1.Separated from operational environment 2.Data are integrated 3.Contains historical data over long time horizon 4.Snapshot data captured at given time 5.Subject-oriented data 6.Mainly read-only data with periodic batch updates from operational source, no online updates 7.Development life cycle differs from classical one, data driven not process driven Twelve Data Warehouse Rules

443 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 443 8. Contains different levels of data detail –Current and old detail –Lightly and highly summarized 9. Characterized by read-only transactions to large data sets 10. Environment has system to trace data resources, transformation, and storage 11. Metadata critical components –Identify and define data elements –Provide the source, transformation, integration, storage, usage, relationships, and history of data elements 12. Contains charge-back mechanism for usage –Enforces optimal use of data Twelve Data Warehouse Rules (Con’t.)

444 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 444 Advanced data analysis environment Supports decision making, business modeling, and operations research activities Characteristics of OLAP –Use multidimensional data analysis techniques –Provide advanced database support –Provide easy-to-use end-user interfaces –Support client/server architecture Online Analytical Processing (OLAP)

445 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 445 OLAP Client/Server Architecture l Figure 13.6

446 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 446 OLAP Server Arrangement l Figure 13.7

447 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 447 OLAP Server with Multidimensional Data Store Arrangement l Figure 13.8

448 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 448 OLAP Server with Local Mini-Data-Marts l Figure 13.9

449 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 449 OLAP functionality Uses relational DB query tools Extensions to RDBMS –Multidimensional data schema support –Data access language and query performance optimized for multidimensional data –Support for very large databases (VLDBs) Relational OLAP (ROLAP)

450 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 450 Typical ROLAP Client/Server Architecture l Figure 13.10

451 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 451 OLAP functionality to multidimensional databases (MDBMS) Stored data in multidimensional data cube N-dimensional cubes called hypercubes Cube cache memory speeds processing Affected by how the database system handles density of data cube called sparsity Multidimensional OLAP (MOLAP)

452 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 452 MOLAP Client/Server Architecture l Figure 13.11

453 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 453 Data-modeling technique Maps multidimensional decision support into relational database Yield model for multidimensional data analysis while preserving relational structure of operational DB Four Components: –Facts –Dimensions –Attributes –Attribute hierarchies Star Schema

454 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 454 Simple Star Schema l Figure 13.12

455 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 455 Slice and Dice View of Sales l Figure 13.14

456 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 456 Facts and dimensions represented by physical tables in data warehouse DB Fact table related to each dimension table (M:1) Fact and dimension tables related by foreign keys Subject to the primary/foreign key constraints Star Schema Representation

457 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 457 Star Schema for Sales l Figure 13.17

458 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 458 Normalization of dimensional tables Multiple fact tables representing different aggregation levels Denormalization of the fact tables Table partitioning and replication Performance-Improving Techniques for Star Schema

459 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 459 Data Warehouse Implementation Road Map l Figure 13.21

460 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 460 Seeks to discover unknown data characteristics Automatically searches data for anomalies and relationships Data mining tools –Analyze data –Uncover problems or opportunities –Form computer models based on findings –Predict business behavior with models –Require minimal end-user intervention Data Mining

461 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 461 Extraction of Knowledge from Data l Figure 13.22

462 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 462 Data Mining Process l Figure 13.23

463 1 Chapter 14 Databases in Electronic Commerce Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

464 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 464 In this chapter, you will learn: What electronic commerce (e-commerce) is How e-commerce affects the new economy About the different e-commerce styles About the Internet architectural components required to conduct electronic commerce About database design and implementation issues for electronic commerce applications What Extensible Markup Language (XML) is and why it is important

465 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 465 Definition –Bring new products, services, or ideas to market –Support and enhance business operations (including sales of products/services over the Web) Generally identified with Internet use External evidence is corporate Web site Prime revenue source Not an end in itself What is Electronic Commerce?

466 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 466 Changed business environment New economy Benefits –Ability to provide quick and convenient comparison shopping –24X7X365 operations –Global access –Lower entry barriers –Increased customer market knowledge Disadvantages –Hidden costs –Technology is not perfect –Thin profit margins –Security, loss of privacy, service levels, and legal issues E-Commerce Impact

467 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 467 E-Commerce Styles l Figure 14.1

468 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 468 Managerial issues –Establishing partnerships Suppliers Distributors Vendors –Design and development of business plans Technological issues –Hardware and software –Well-planned architecture E-Commerce Architecture

469 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 469 E-Commerce Architecture (Con’t.) l Figure 14.2

470 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 470 Internet Basic Services Internet TCP/IP Router WWW Web Page HTML Hyperlink URL HTTP Web Browser Web Server Web Site Static Web Page Dynamic Web Page FTP E-Mail News and Discussion Group Services

471 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 471 Internet Basic Services l Figure 14.3

472 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 472 Business Enabling Services Search Services Security Site Monitoring and Data Analysis Load Testing, Balancing, and Web Caching Usability Testing Personalization Web Development Database Integration Transaction Processing Content Management Messaging Wireless Device Support

473 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 473 Security Procedures and technology uses –Protection against accidental and intentional access –Warrantee identity of transaction’s participants Buyer Seller –Protect transaction data from unauthorized modifications during Internet travel –Protect resources (data and computer) Customers’ personal data Privacy issues Property against criminal activities

474 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 474 Sample E-Commerce Transaction l Figure 14.4

475 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 475 Payment Processing Digital Cash –Digital equivalent of hard cash –Digital certificates verify identity of transaction participants –Low transaction costs –Lack of customer acceptance Credit Card purchasing –Most common for online purchasing –Secure Electronic Transaction (SET) Electronic wallets

476 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 476 Don’t reinvent the wheel No need for ‘new’ design techniques Scope –Facilitate sales of products and services –Show products and services –Conduct basic sales transactions –Customer service –Product returns –Web customer profiling Database Design for E-Commerce

477 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 477 Basic Business Rules Sell products –PRODUCT and CUSTOMER Tables Customer may place multiple orders –1:M relationship between CUSTOMER and ORDER Order contains multiple lines –1:M relationship between ORDER and ORDLINE Order lines refer to one product –1:M between PRODUCT and ORDLINE

478 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 478 Basic Business Rules (Con’t.) Customer browses catalog by category –Each PRODUCT belongs to PRODTYPE Customer places products in shopping cart –SHOPCART belongs to one CUSTOMER and references one or more PRODUCTS Customer checks out and enters credit card and shipping info –Added to ORDER After credit card authorization order created –SHOPCARD used to create ORDER with ORDLINEs

479 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 479 Basic Business Rules (Con’t.) Merchant offers shipping options –SHIPOPTION stores details Merchant offers many payment options –PMTOPTION stores details States may have different tax rates –Stored in STATE and TAXRATE

480 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 480 CUSTOMER Table Details for each registered customer Some customers prefer not to register Primary table contents –Name and address information –Login information –Credit card information –Billing information –Shipping information –Membership type

481 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 481 PRODUCT Table Central entity in DB Some customers prefer not to register Primary table contents –Product details –URL of image –Vendor ID –Reorder –Pricing –Alternate item May need a PRODOPT table for options within a particular product

482 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 482 ORDER Table Contains all customer orders After credit card approval order added to table One row for each new order Primary table contents –Order date –Customer ID –Payment and credit card information –Shipping info –Cost info –Status

483 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 483 PRODTYPE Table Describes product categories Multiple levels Primary table contents –Product type name –Product type parent l ORDLINE Table l Contains items in customer order l One product for each row l Primary table contents l Order ID l Product ID l Quantity l Tax

484 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 484 SHOPCART Table Temporarily store products during shopping activity Primary table contents –Product ID –Quantity l PMTTYPE Table l Payment information l Primary table contents l Payment name l Merchant ID used by processing systems

485 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 485 SHIPTYPE Table Stores different shipping option names Primary table contents –Shipping name –Cost l TAXRATE Table l Tax information l Primary table contents l Rate l State for that rate

486 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 486 STATE Table Stores state names Primary table contents –State ID –State name l PROMOTION Table l Stores information about promotions l Primary table contents l Promotion Name l Promotion details l Promotion pricing and quantity

487 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 487 PRICEWATCH Table Information about particular products customers hope to buy when the price drops Primary table contents –Customer information –Product information l PRODPRICE Table l Manages multilevel pricing based on quantity l Primary table contents l Product l Quantity l Pricing information

488 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 488 Meta-language Represents and manipulates data elements Facilitates exchange of structured documents over the Web World Wide Web Consortium (W3C) published standard definition in 1998 Allows definition of meta-tags to describe data elements Extensible Markup Language (XML)

489 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 489 XML Characteristics Allows definition of new tags Case sensitive –Tags must be well-formed –Proper nesting required Can use to enter comments XML or xml prefixes reserved for XML tags only Not a replacement for HTML

490 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 490 Contents of ProductList.xml l Figure 14.5

491 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 491 Document Type Definition (DTD) File with.dtd extension to describe XML elements Provides composition of database’s logical model Defines syntax rules for each XML document Defines valid tags

492 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 492 XML Schema Advanced data definition language used to describe structure of XML documents Checks for database types Validates data for out-of-range values XML Schema Definition (XSD) file uses syntax like XML document

493 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 493 Extensible Style Language (XSL) Specifies rules for display of XML data Two parts –Extensible Style Language Transformation (XSLT) General mechanism to extract and process data from one XML document and transform within another –XSL style sheets Defines presentation rules applied to XML elements Describes formatting options for different XML elements Limited browser support

494 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 494 Framework for XML Transformations l Figure 14.10

495 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 495 B2B exchanges Legacy system integration Web page development Database support Database meta-dictionaries XML databases XML services XML Applications

496 1 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

497 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 497 In this chapter, you will learn: How Internet databases are typically used About the architecture of Web-to-database middleware How Web-to-database middleware (ColdFusion) is used to integrate databases with the Internet What special considerations govern Web database development

498 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 498 Web Database Connectivity Allows rapid response to competitive pressures –New services –New products Customer support enhanced Fast effective information dissemination –Universal access –Local –Around the globe

499 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 499 Typical Uses of Internet l Table 15.2

500 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 500 Characteristics/Benefits of Internet Technology Hardware & software independence –Cost savings –Uses existing equipment –Platform independence and portability –No need for multiple platform development Common simple user interface –Reduced training –Reduced support

501 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 501 Characteristics/Benefits of Internet Technology (con’t.) Location Independence –Global access through Internet –Reduced costs for dedicated connections Rapid development at manageable costs –Development tools –Low entry costs –Available software & access tools

502 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 502 Web-to-Database Middleware Server-side extension –Interacts directly with Web server –Handles specific requests –Also known as Web-to-database middleware –Examples ColdFusion CGI API

503 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 503 Web-to-Database Middleware l Figure 15.1

504 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 504 Web Server Interfaces Common Gateway Interface (CGI) –Uses script files to connect to database –Perl, C++, VB Application Programming Interface (API) –Newer and more efficient –Uses DLLs –Memory resident and faster –Well known APIs Netscape (NSAPI) Internet Server API from Microsoft (ISAPI) WebSite API from O’Reilly (WSAPI)

505 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 505 API and CGI Web Server Interfaces l Figure 15.2

506 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 506 Web-to-Database Middleware Connection Methods Native SQL access middleware Use services of Open Database Connectivity (ODBC) Use Object Linking and Embedding Database (OLE DB) interface with Windows ODBC most common

507 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 507 ODBC to Access Databases l Figure 15.3

508 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 508 Web-to-Database Middleware Uses ODBC to Access Databases l Figure 15.4

509 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 509 Web Browser Located on the client computer End user Web interface Interprets HTML code received from Web server Presents page components in a standard way Client-side extensions –Plug-ins –Java and JavaScript –ActiveX and VBScript

510 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 510 ColdFusion Web application server Uses –Connect and query database from Web page –Present database data in a Web page –Create dynamic Web search pages –Create Web pages to insert, update, and delete data –Define required and optional relationships –Define required and optional form fields –Enforce referential integrity in form fields –Use simple and nested queries to represent business rules

511 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 511 How ColdFusion Works l Figure 15.5

512 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 512 How ColdFusion Works Server-side markup language –HTML extensions –ColdFusion Markup Language (CFML) Executed in interpreter mode Contain HTML, CFML May contain Java, JavaScript, or VBScript Client browser requests.cfm page from Web Server –ColdFusion application server executes.cfm script –Sends resulting output in HTML to Web Server –Web server sends to client browser

513 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 513 ColdFusion Tags CFQuery –Queries a database CFOutput –Displays data returned by query CFTable –Displays data in Tabular format

514 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 514 ColdFusion Dynamic Query Create script to generate form with criteria used in database search Create script to execute query and display results –Uses ColdFusion tags –Uses HTML

515 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 515 The Web as a Stateless System Web server does not know status of any client at any given time Request-reply model of communication Browser concerned only with current page Data processing requires additional software –Java, JavaScript, VBScript

516 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 516 INSERTs and UPDATEs with ColdFusion CFINSERT Tag –Adds records to database –Parameters DATASOURCE TABLENAME CFUPDATE Tag –Updates selected database contents –Parameters DATASOURCE TABLENAME

517 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 517 DELETEs with ColdFusion CFQUERY Tag –Uses SQL DELETE Statement –Parameters DATASOURCE TABLENAME

518 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 518 Internet Database: Special Considerations Involve more than just database-enabled Web applications Issues important to corporate databases –Data security –Transaction management –Client-side data validation –Operational and management challenges Database applications development most affected by Internet

519 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 519 Supported Data Types Integrated data from multiple sources –Word-processor documents –Pictures –Sounds –Movies Methods for storing and extracting data objects Overhead created by storage Client browser support of object being accessed Size of database considering multimedia and other data

520 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 520 Data Security Web Server Level –Secure transactions using encryption –TCP/IP protocol level –Firewalls RMDBS Vendors –Login authentication –Restrict access to particular SQL commands Web-to-database middleware –End user restrictions –Designer created algorithms Must support e-commerce applications

521 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 521 Transaction Management Concept is foreign to Web Dilemma created by request-reply model –Web cannot maintain open line between client and database –Recovery requires client maintain open communications Designers must ensure proper transaction management support at database server level ColdFusion uses CFTRANSACTION tag for transaction management support

522 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 522 Denormalization Web forms –Cannot use multiple data entry lines –1:M relationships problematic Solutions –Web programming languages –Java, JavaScript, VBScript

523 1 l Chapter 16 Database Administration Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

524 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 524 In this chapter, you will: Learn that data are a valuable business asset that requires careful management Learn why and how the database plays a critical role in an organization Learn that the introduction of a DBMS has important technological, managerial, and cultural organizational consequences Learn what the database administrator's managerial and technical roles are Be introduced to several database administration tools Examine various database administration strategies See how various database administration technical tasks are performed with Oracle

525 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 525 Data as a Corporate Asset Raw material used to produce information Valuable resource Information –Timely and accurate data can trigger beneficial actions –Basis for knowledge –Used in decision making

526 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 526 Data-Information-Decision Cycle l Figure 16.1

527 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 527 Databases in an Organization DBMS facilitates –Interpretation and presentation of data –Distribution of data and information –Data preservation and monitoring –Control over data duplication and use Supports managerial decision making –Top –Middle –Operational

528 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 528 Introduction of Database Big organizational change and challenge Process with three primary aspects –Technological –Managerial –Cultural Must focus on organizational needs

529 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 529 Roots in decentralized file systems Electronic Data Processing (EDP) or Data Processing (DP) Department Information systems (IS) department Evolution of Database Administration l Figure 16.2

530 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 530 Database administration created to handle complex data management tasks Database administrator (DBA) responsible for control of database Factors affecting DBA placement in organization –Management style –Size and complexity of operations –Geographic distribution of facilities General coordinator of all DBAs is systems administrator (SYSADM) Data administrator (DA) Evolution of Database Administration (Con’t.)

531 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 531 Placement of DBA Function l Figure 16.3

532 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 532 DBA Functional Organization l Figure 16.4

533 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 533 DA Versus DBA l Table 16.1

534 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 534 Summary of DBA Activities l Figure 16.6

535 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 535 DBA Skills l Table 16.2

536 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 536 DBA Activities and Services l Table 16.3

537 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 537 DBA Service: End-User Support User requirements gathering Conflict and problem resolution Finding solutions to information needs Ensuring quality and integrity of applications and data Building end-user confidence Managing the training and support of DBMS users

538 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 538 Policies –General statements of direction or action –Communicate and support DBA goals Standards –More detailed and specific than policies –Describe minimum requirement of DBA activity Procedures –Written instructions that describe steps for activity –Support and enhance work environment DBA Service: Policies, Procedures, & Standards

539 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 539 Authorization management –User access management –View definition –DBMS utilities access control –DBMS usage monitoring Security breaches –Preserved integrity Data recovery may not be necessary –Corrupted integrity Database must be recovered DBA Service: Security, Privacy, & Integrity

540 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 540 Database security officer (DSO) Disaster management –Periodic data and applications backups –Proper backup identification –Convenient and safe backup storage –Physical protection –Personal access control –Insurance coverage for the data in the database Data recovery and contingency plans must be tested and evaluated Backup and recovery may not cover all aspects of IS DBA Service: Data Backup and Recovery

541 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 541 Data useful in right hands at right time Current philosophy makes authorized data access easier Sophisticated query tools Web front ends Data democracy Cautions due to improper use of data DBA Service: Data Distribution and Use

542 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 542 DBMS and utilities evaluation, selection, and installation Design and implementation of databases and applications Testing and evaluation of databases and applications Operation of the DBMS, utilities, and applications Training and supporting users Maintenance of the DBMS, utilities, and applications DBA’s Technical Role

543 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 543 Integrated data dictionary –Included with the DBMS Stand-alone data dictionary –From third-party vendor Active data dictionary –Automatically updated by the DBMS Passive data dictionary –Created and updated by a batch process DB Administrative Tools: Data Dictionary

544 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 544 Data elements in all tables Tables defined in all databases Indexes defined for each database table Defined database specifics End users and administrators of database Programs that access database Access authorizations for all users Relationships among data elements DB Administrative Tools: Data Dictionary (Con’t.)

545 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 545 CASE is Computer-Aided Software Engineering Provides automated framework for Systems Development Life Cycle Classifications –Front-end CASE tools support planning, analysis, and design –Back-end CASE tools support coding and implementation DB Administrative Tools: CASE

546 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 546 Reduction in development time and costs Automation of the SDLC Standardization of the systems development methodologies Easier maintenance of application systems developed with CASE tools Improves communications among the DBA, applications designers, and end users DB Administrative Tools: CASE (Con’t.)

547 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 547 Information Engineering (IE) translates strategic goals of the company into data and applications Focuses on description of corporate data instead of the processes Output is Information Systems Architecture (ISA) –Serves as the basis for planning, development, and control of future IS Data Administration Strategy: Information Engineering

548 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 548 Forces Affecting Development of ISA l Figure 16.8

549 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 549 Management commitment Thorough company situation analysis End-user involvement Defined standards Training Small pilot project Critical Success Factors for IS Strategy

550 1 Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 550 Database Administration Using Oracle Security Manager Schema Manager Storage Manager SQL Worksheet Instance Manager l Figure 16.9


Download ppt "1 Chapter 1 File Systems and Databases Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel."

Similar presentations


Ads by Google