Database Processing: David M. Kroenke’s Chapter Nine: Part One

Slides:



Advertisements
Similar presentations
Managing Multi-User Databases (1) IS 240 – Database Management Lecture #18 – Prof. M. E. Kabay, PhD, CISSP Norwich University
Advertisements

Indra Budi Transaction Indra Budi
Chapter 12 Managing Multi-user Databases David M. Kroenke Database Processing © 2000 Prentice Hall.
Chapter 16 Concurrency. Topics in this Chapter Three Concurrency Problems Locking Deadlock Serializability Isolation Levels Intent Locking Dropping ACID.
Database Administration Chapter Six DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
Data and Database Administration Chapter 12. Outline What is Concurrency Control? Background Serializability  Locking mechanisms.
Database Administration Chapter Six DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Transaction Management and Concurrency Control
Prentice Hall © COS 346 Day Agenda Questions? Assignment 8 Due Assignment 9 posted –Due April 2:05 PM Quiz 2 Today –SQL Chaps 2-19.
10 1 Chapter 10 Transaction Management and Concurrency Control Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 David M. Kroenke Database Processing Chapter 9 Managing Multi- User.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 9-1 COS 346 Day 19.
Transaction Management
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 11 Managing Multi-User Databases.
COS 346 DAY 17.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 COS 346 Day 18.
Database Administration
Database Administration Chapter Six DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Database Administration Part 1 Chapter Six CSCI260 Database Applications.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Transaction Management and Concurrency Control
1 IT420: Database Management and Organization Transactions 31 March 2006 Adina Crăiniceanu
© 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 CHAPTER 11: DATA AND DATABASE ADMINISTRATION Modern Database Management 11 th Edition Jeffrey.
Database Administration
Multi-user Database Processing Architectures Architectures Transactions Transactions Security Security Administration Administration.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 9-1 Managing Multiuser Databases.
Recovery & Concurrency Control. What is a Transaction?  A transaction is a logical unit of work that must be either entirely completed or aborted. 
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Nine: Managing Multiuser Databases 9-1 KROENKE.
1 IT420: Database Management and Organization Session Control Managing Multi-user Databases 24 March 2006 Adina Crăiniceanu
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 9/1 Copyright © 2004 Please……. No Food Or Drink in the class.
© 2002 by Prentice Hall 1 Database Administration David M. Kroenke Database Concepts 1e Chapter 6 6.
Fundamentals, Design, and Implementation, 9/e Chapter 9 Managing Multi-User Databases.
1 IT420: Database Management and Organization Managing Multi-user Databases 29 March 2006 Adina Crăiniceanu
© 2006 ITT Educational Services Inc. Course Name: IT390 Business Database Administration Unit 8 Slide 1 IT 390 Business Database Administration Unit 8:
KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall 6-1 Chapter Objectives Understand the need for and importance of database.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Nine: Managing Multiuser Databases 9-1 KROENKE.
Managing Multi-User Databases. Mutli-User Issues n Concurrency Control n Database Reliability n Database Security n Database Administration.
Transaction Processing Concepts
9 1 Chapter 9_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
10 1 Chapter 10_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
10 Transaction Management and Concurrency Control MIS 304 Winter 2005.
©Bob Godfrey, 2002, 2005 Lecture 17: Transaction Integrity and Concurrency BSA206 Database Management Systems.
3 Database Systems: Design, Implementation, and Management CHAPTER 9 Transaction Management and Concurrency Control.
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 17.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Nine: Managing Multiuser Databases.
Chapter 5 Managing Multi-user Databases 1. Multi-User Issues Database Administration Concurrency Control Database Security Database Recovery Page 307.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
CSC314 Day 16 Transaction processing Concurrency Control 1.
Copyright © 2016 Pearson Education, Inc. CHAPTER 12: DATA AND DATABASE ADMINISTRATION Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman,
Chapter 8 Database Redesign
David M. Kroenke and David J
Transaction Management and Concurrency Control
Functions of a Database Management System
Database Administration
Managing Multi-user Databases
Chapter 9 Managing Multi-User Databases
Multi-User Databases Chapter 9.
Transaction Properties
Database Processing: David M. Kroenke’s Chapter Nine: Part Two
Chapter 10 Transaction Management and Concurrency Control
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Database Administration
Database Processing: David M. Kroenke’s Chapter Nine: Part Two
CONCURRENCY Concurrency is the tendency for different tasks to happen at the same time in a system ( mostly interacting with each other ) .   Parallel.
Presentation transcript:

Database Processing: David M. Kroenke’s Chapter Nine: Part One Fundamentals, Design, and Implementation Chapter Nine: Managing Multiuser Databases Part One DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Database Administration All large and small databases need database administration Data administration refers to a function concerning all of an organization’s data assets Database administration (DBA) refers to a person or office specific to a single database and its applications DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

DBA Tasks Managing database structure Controlling concurrent processing Managing processing rights and responsibilities Developing database security Providing for database recovery Managing the DBMS Maintaining the data repository DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Managing Database Structure DBA’s tasks: Participate in database and application development Assist in requirements stage and data model creation Play an active role in database design and creation Facilitate changes to database structure Seek community-wide solutions Assess impact on all users Provide configuration control forum Be prepared for problems after changes are made Maintain documentation DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Concurrency Control Concurrency control ensures that one user’s work does not inappropriately influence another user’s work No single concurrency control technique is ideal for all circumstances Trade-offs need to be made between level of protection and throughput DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Atomic Transactions A transaction, or logical unit of work (LUW), is a series of actions taken against the database that occurs as an atomic unit Either all actions in a transaction occur or none of them do DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Errors Introduced Without Atomic Transaction DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Errors Prevented With Atomic Transaction DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Concurrent Transaction Concurrent transactions refer to two or more transactions that appear to users as they are being processed against a database at the same time In reality, CPU can execute only one instruction at a time Transactions are interleaved meaning that the operating system quickly switches CPU services among tasks so that some portion of each of them is carried out in a given interval Concurrency problems: lost update and inconsistent reads DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Concurrent Transaction Processing DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Lost-Update Problem DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Resource Locking Resource locking prevents multiple applications from obtaining copies of the same record when the record is about to be changed DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Lock Terminology Implicit locks are locks placed by the DBMS Explicit locks are issued by the application program Lock granularity refers to size of a locked resource Rows, page, table, and database level Large granularity is easy to manage but frequently causes conflicts Types of lock An exclusive lock prohibits other users from reading the locked resource A shared lock allows other users to read the locked resource, but they cannot update it DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Concurrent Processing with Explicit Locks DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Serializable Transactions Serializable transactions refer to two transactions that run concurrently and generate results that are consistent with the results that would have occurred if they had run separately Two-phased locking is one of the techniques used to achieve serializability DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Two-phased Locking Two-phased locking Transactions are allowed to obtain locks as necessary (growing phase) Once the first lock is released (shrinking phase), no other lock can be obtained A special case of two-phased locking Locks are obtained throughout the transaction No lock is released until the COMMIT or ROLLBACK command is issued This strategy is more restrictive but easier to implement than two-phased locking DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Deadlock Deadlock, or the deadly embrace, occurs when two transactions are each waiting on a resource that the other transaction holds Preventing deadlock Allow users to issue all lock requests at one time Require all application programs to lock resources in the same order Breaking deadlock Almost every DBMS has algorithms for detecting deadlock When deadlock occurs, DBMS aborts one of the transactions and rollbacks partially completed work DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Deadlock DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Optimistic versus Pessimistic Locking Optimistic locking assumes that no transaction conflict will occur: DBMS processes a transaction; checks whether conflict occurred: If not, the transaction is finished If so, the transaction is repeated until there is no conflict Pessimistic locking assumes that conflict will occur: Locks are issued before a transaction is processed, and then the locks are released Optimistic locking is preferred for the Internet and for many intranet applications DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Optimistic Locking DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Pessimistic Locking DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Declaring Lock Characteristics Most application programs do not explicitly declare locks due to its complication Instead, they mark transaction boundaries and declare locking behavior they want the DBMS to use Transaction boundary markers: BEGIN, COMMIT, and ROLLBACK TRANSACTION Advantage If the locking behavior needs to be changed, only the lock declaration need be changed, not the application program DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

Marking Transaction Boundaries DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall

David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10th Edition) End of Presentation: Chapter Nine Part One DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall