Module 6 Lecture
Module 6 Lecture
Ninth Edition
Chapter 6
Database Administration
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Learning Objectives (1 of 2)
2
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Learning Objectives (2 of 2)
3
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Data Administration Terms
4
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 5.27 Heather Sweeney Designs:
5
Database Design
Note: From the previous chapter showing the final database design for Heather Sweeney
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.1 The HSD Database in MySQL
6
Workbench
Environment
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Concurrency Control
8
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
10
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
11
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Lost Update Problem
12
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.5 Example of the Lost
13
Update Problem
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Resource Locking
14
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.6 Example of Concurrent
16
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Serializable Transactions
17
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Two-Phased Locking
18
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Deadlock
19
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.7 Examples of Deadlock
20
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Optimistic Versus Pessimistic
21
Locking
Learn the difference between optimistic and
pessimistic locking
• Optimistic locking assumes that no conflict will occur.
Data are read, the transaction processed, updates are
issued, and then a check is made to see if conflict
occurred. If a conflict occurred it is rolled back and
repeated until successful.
• Pessimist locking assumes that conflict will occur, thus
locks are issued, the transaction completed, and then the
locks are released.
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.8 Example of Optimistic
22
Locking
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.9 Example of Pessimistic
23
Locking
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
SQL Transaction Control Language
24
(TCL)
Learn the difference between optimistic and
pessimistic locking
• The SQL BEGIN TRANSACTION statement
• The SQL COMMIT TRANSACTION statement
• The SQL ROLLBACK TRANSACTION statement
Note: Exact SQL syntax varies between various DBMS products.
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.10 Example of Marking
25
Transaction Boundaries
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
ACID Transaction (1 of 3)
26
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
ACID Transaction (2 of 3)
27
Consistency
• Statement-level consistency requires that a statement apply to a set of
rows that is consistent from the beginning of the statement until the
end of the statement.
• Transaction-level consistency indicates that the set of rows will remain
consistent throughout the processing of all statements within the
transaction.
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
ACID Transaction (3 of 3)
28
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.11 Summary of Data Read
29
Problems
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.12 Summary of Isolation
30
Levels
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Cursor
31
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Cursor Types
32
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.13 Summary of Cursor
33
Types
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.14 Database Security
34
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.15 Creating the MySQL User
35
Login
Responsibilities
Understand the need for security and specific
tasks for improving database security
• Processing rights define who is permitted to do what, and
when they can do it.
• The individuals performing these activities have full
responsibility for the implications of their actions.
• An important principle of database security administration
is that administrative permissions are given to user groups
(also known as user roles) and not to individual users
unless necessary.
• Individuals are identified by a username and a password.
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.17 A Model of DBMS
38
Security
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.18 MySQL Administrative
39
Roles
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.20 Creating a New
41
Guidelines
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Application-Level Security
43
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Database Backup and Recovery
44
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Recovery via Reprocessing
45
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Recovery via Rollback & Rollforward
46
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Rollforward
47
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Rollback
48
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.22 Undo and Redo
49
Transactions
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.23 Transaction Log Example
50
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.24 Recovery Example
51
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Figure 6.25 Backing Up the HSD
52
Database
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Additional DBA Responsibilities (2 of 2)
54
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved
Copyright
55
Copyright © 2020, 2017, 2015 Pearson Education, Inc. All Rights Reserved