Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multi-User Databases Chapter 9.

Similar presentations


Presentation on theme: "Multi-User Databases Chapter 9."— Presentation transcript:

1 Multi-User Databases Chapter 9

2 Terminology Data administration Database administration
Database administrator or DBA Facilitates the development and use of the database Balances the conflicting goals of Protecting the database Maximizing its availability and benefit to users 1. Refers to a function that applies to an entire organizations Is a management oriented functions It is concerted with corporate data privacy and security issues 2. Is concerned with technical issues specific to a particular database includeing applications that process the database 3. Refers to the office or the manager

3 Tasks of DBA

4 Managing Database Structure
Participating in initial database design Participating in initial database implementation Controlling and managing changes to the database Developing procedures and policies by which users an register their needs for changes Documenting the database structure Documnent: changes, when they were made, record of test procedures and test runs

5 Summary of DBA’s responsibilities for managing database structure

6 Problems

7 Solution

8 Transactions Transactions Logical units of work Atomic
Logical Units of work - suppose have three actions to occur when recording a new order and only 2 happen because of insufficient file space… either all three should be done or none. Customer: increase amount due Salesperson : increase commission due Insert new order row into database Atomic is a synonym

9 Concurrency Control Needed to ensure that one user’s work does not interfere with another Concurrent transactions Concurrent transactions are not simultaneous They are interleaved

10 Processing different data
Processing different data – no problem

11 Processing Same Data Look at order or processing
Potential problem of LOST UPDATE or CONCURRENT UPDATE Another potential problem is the INCONSISTENT READ PROBLEM User A reads data that have been processed by a PORTION of a transaction.

12 Resource Locking

13 Locks Implicit Explict Lock granularity Lock types Lock styles
Desired results Implicit – done by database Explicit – placed by command Lock granularity – groups of rows within a table, the whole table, the whole dataabase large granularity is easy to administer but cause conflicts small granularity – difficult to administer but fewer conflicts Lock types exclusive – locks item from ANY other access Shared lock – locked from change but not from read Desirable results Serializable – results same as if they had been processed sequentially achieved by two-phased locking – obtain locks as needed but as soon as one released no others can be obtained – GROWING phase when locks are obtained SHRINKING phase when locks are released Optimistic – assumes no conflict will occur Pessimistic – conflict will occur – locks are issued and then freed

14 Deadlock – Deadly embrace
Deadlock: prevention, detection, correction DBMS has algorithms for breaking deadlock Need to detect Need to get rid of deadlock - correct Generally cancel one of transactions

15 Optimistic Locking

16 Pessimistic locking

17 Transaction Boundaries

18 Some useful terminology
Transaction-level consistency Dirty read Nonrepeatble reads Phantom reads Isolation levels – see figure 9-10 Scrollable cursor Static cursor Keyset Dynamic cursor

19 Database Security Illustration
Rights Responsibilities

20 Database Recovery Recovery via reprocessing
Recovery via rollback/rollforward Necessity for a log


Download ppt "Multi-User Databases Chapter 9."

Similar presentations


Ads by Google