DBSQL 7-1 Copyright © Genetic Computer School 2009 Chapter 7 Transaction Management, Database Security and Recovery.

Slides:



Advertisements
Similar presentations
Lecture plan Transaction processing Concurrency control
Advertisements

Chapter 16: Recovery System
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 16.
TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
CSC271 Database Systems Lecture # 32.
Lock-Based Concurrency Control
1 CSIS 7102 Spring 2004 Lecture 8: Recovery (overview) Dr. King-Ip Lin.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
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
Concurrency Control. R/RR/W W/W User 2 ReadWrite User 1 Read Write R/W: Inconsistent Read problem. W/W: Lost Update problem.
Quick Review of May 1 material Concurrent Execution and Serializability –inconsistent concurrent schedules –transaction conflicts serializable == conflict.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
What is a Transaction? Logical unit of work
Transaction Management
1 Transaction Management Database recovery Concurrency control.
DBMS Functions Data, Storage, Retrieval, and Update
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.
System Catalogue v Stores data that describes each database v meta-data: – conceptual, logical, physical schema – mapping between schemata – info for query.
Transaction Management and Concurrency Control
Transactions and Recovery
© 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 CHAPTER 11: DATA AND DATABASE ADMINISTRATION Modern Database Management 11 th Edition Jeffrey.
Multi-user Database Processing Architectures Architectures Transactions Transactions Security Security Administration Administration.
1 Transaction Management Overview Chapter Transactions  Concurrent execution of user programs is essential for good DBMS performance.  Because.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Chapter 18.
1 Transactions BUAD/American University Transactions.
1 Database Systems CS204 Lecture 21 Transaction Processing I Asma Ahmad FAST-NU April 7, 2011.
Security and Transaction Nhi Tran CS 157B - Dr. Lee Fall, 2003.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Reliability and Security in Database Servers By Samuel Njoroge.
Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke1 Transaction Management Overview Lecture 21 Ramakrishnan - Chapter 18.
Transaction Processing Concepts. 1. Introduction To transaction Processing 1.1 Single User VS Multi User Systems One criteria to classify Database is.
Transaction processing Book, chapter 6.6. Problem: With a single user…. you run a query, you get the results, you run the next, etc. But database life.
D ATABASE A DMINISTRATION L ECTURE N O 3 Muhammad Abrar.
Database Systems/COMP4910/Spring05/Melikyan1 Transaction Management Overview Unit 2 Chapter 16.
1 IT420: Database Management and Organization Session Control Managing Multi-user Databases 24 March 2006 Adina Crăiniceanu
11/7/2012ISC329 Isabelle Bichindaritz1 Transaction Management & Concurrency Control.
Database Security Outline.. Introduction Security requirement Reliability and Integrity Sensitive data Inference Multilevel databases Multilevel security.
Introduction to Database Systems1. 2 Basic Definitions Mini-world Some part of the real world about which data is stored in a database. Data Known facts.
© 2002 by Prentice Hall 1 Database Administration David M. Kroenke Database Concepts 1e Chapter 6 6.
The Relational Model1 Transaction Processing Units of Work.
MBA 664 Database Management Dave Salisbury ( )
Database Systems Recovery & Concurrency Lecture # 20 1 st April, 2011.
TM 13-1 Copyright © 1999 Addison Wesley Longman, Inc. Data and Database Administration.
Chapter 20 Transaction Management Thomas Connolly, Carolyn Begg, Database System, A Practical Approach to Design Implementation and Management, 4 th Edition,
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_JDBC_MySQL 1 Transations.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
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.
18 September 2008CIS 340 # 1 Last Covered (almost)(almost) Variety of middleware mechanisms Gain? Enable n-tier architectures while not necessarily using.
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.
SYSTEMS IMPLEMENTATION TECHNIQUES TRANSACTION PROCESSING DATABASE RECOVERY DATABASE SECURITY CONCURRENCY CONTROL.
Copyright © 2016 Pearson Education, Inc. CHAPTER 12: DATA AND DATABASE ADMINISTRATION Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman,
TM 13-1 Copyright © 1999 Addison Wesley Longman, Inc. Data and Database Administration.
Transaction Management and Concurrency Control
Managing Multi-user Databases
Transaction Management
Transaction Properties
Chapter 10 Transaction Management and Concurrency Control
Database Security Transactions
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Database Administration
Presentation transcript:

DBSQL 7-1 Copyright © Genetic Computer School 2009 Chapter 7 Transaction Management, Database Security and Recovery

DBSQL 7-2 Copyright © Genetic Computer School, Singapore 2009 Chapter 7 Overview Transaction Management Concurrency Control Database Security Database Recovery

DBSQL 7-3 Copyright © Genetic Computer School, Singapore 2009 Transaction Management

DBSQL 7-4 Copyright © Genetic Computer School, Singapore 2009 Transaction Management Transaction is the execution of a program that access and changes the database. Once a transaction is committed it is said to be that the database is in its consistent state.

DBSQL 7-5 Copyright © Genetic Computer School, Singapore 2009 Transaction Concept ACID Properties Transaction Operation Transaction State Concurrent access to data

DBSQL 7-6 Copyright © Genetic Computer School, Singapore 2009 ACID Properties Atomicity Consistency Isolation Durability

DBSQL 7-7 Copyright © Genetic Computer School, Singapore 2009 Cont’ A tomicity C onsistency I solation D urability All the transaction task is performed or not performed at all The system is consistent at the end of a transaction A transaction should not make its updates visible to other transactions until it is committed When a transaction has made a change to the database state and the change is committed, this change is permanent and should be available to all other transactions

DBSQL 7-8 Copyright © Genetic Computer School, Singapore 2009 Transaction Operation BEGIN_TRANSACTION READ or WRITE END_TRANSACTION COMMIT_TRANSACTION ROLLBACK UNDO REDO

DBSQL 7-9 Copyright © Genetic Computer School, Singapore 2009 Transaction State A transaction goes into an active state immediately after it stars execution, where it can issue READ and WRITE operations. When the transaction ends, it moves to the partially committed state. At this point, some concurrency control techniques require that certain checks are made to ensure that the transaction did not interfere with other executing transactions.

DBSQL 7-10 Copyright © Genetic Computer School, Singapore 2009 Concurrent Access of data Many computer systems can be used simultaneously by more than one user. This is made possible by multiprogramming, a technique that allows the computer to run multiple program (or transactions) at the same time. Due to speed at which these commands are executed, the impression of concurrent use is given to the users. This process is known as interleaving An important issue is that more than one application may attempt to access the same data item. As a result, data stored in a multi-user DBMS can be damaged or destroyed. To overcome this problem, concurrency control techniques have been developed to protect data from incorrect changes caused by transactions running simultaneously

DBSQL 7-11 Copyright © Genetic Computer School, Singapore 2009 Problems when concurrent access is executed The lost update problem The uncommitted dependency problem The inconsistency analysis problem

DBSQL 7-12 Copyright © Genetic Computer School, Singapore 2009 Concurrency Control

DBSQL 7-13 Copyright © Genetic Computer School, Singapore 2009 Concurrency Control Locks Types of Locking Locking Protocol Deadlock Oracle concurrency control

DBSQL 7-14 Copyright © Genetic Computer School, Singapore 2009 Concurrency Control Concurrency Control is the control on the Database and Transaction which are executed concurrently to ensure that each Transaction completed healthy. Concurrently control is concerned with preventing loss of data integrity due to interference between users in a multi- user environment.

DBSQL 7-15 Copyright © Genetic Computer School, Singapore 2009 Lock-Based Method The best method to control the concurrent access to the Database Objects by providing suitable permissions to the Transactions. Also it is the only method which takes less cost of Time and less program complexity in terms of code development.

DBSQL 7-16 Copyright © Genetic Computer School, Singapore 2009 Cont’ Database Object Lock Database Object is the small data element, the value of which one is altered during the execution of transactions. Lock is a small object associated with Database Object which gives the information about the type of operations allowed on a particular Database Object. It can be termed as type of permission provided by the transaction manager to the transactions to do a particular operation on a Database Object.

DBSQL 7-17 Copyright © Genetic Computer School, Singapore 2009 Types of Lock Shared Locks (S locks) Exclusive Locks (X locks) Uses of Locking Lost update Uncommitted dependency Inconsistent analysis

DBSQL 7-18 Copyright © Genetic Computer School, Singapore 2009 Locking Protocols Basic 2PL Conservative 2PL Strict 2PL

DBSQL 7-19 Copyright © Genetic Computer School, Singapore 2009 Deadlock Deadlock occurs mainly due to the Lock-Based Concurrency Control. The exclusive lock type will isolate one particular Database Object from the access other transactions. This will isolate one particular Database Object from the access of other transaction. This will suspend all the transactions who request Shared lock on that particular Database Object until the transaction which hold Exclusive lock on that object is completed. This will create a loop in Database which leads to Deadlock within transactions. This will leave the Database in inconsistent state.

DBSQL 7-20 Copyright © Genetic Computer School, Singapore 2009 Oracle Concurrency Control SET TRANSACTION READ COMMITTED SET TRANSACTION SERIALIZABLE SET TRANSACTION READ ONLY

DBSQL 7-21 Copyright © Genetic Computer School, Singapore 2009 Example TRANSACTION 1 TRANSACTION 2 Time Start check seat availability Startcheck seat availability Make reservation seat x commit TRANSACTION 1 TRANSACTION 2 Time Start read price item x Startread/change price item x create order commit

DBSQL 7-22 Copyright © Genetic Computer School, Singapore 2009 Database Security

DBSQL 7-23 Copyright © Genetic Computer School, Singapore 2009 Database Security Database security issues are often lumped together with data integrity issues, but the two concepts are really quite distinct. Security refers to the protection of data against unauthorized disclosure, alteration, or destruction; integrity refers to the accuracy or validity of that data.

DBSQL 7-24 Copyright © Genetic Computer School, Singapore 2009 The need for security Multiple users tried to access the data at the same time so in order to maintain consistency security is needed Because of the advancement of internet and to protect data from hackers and crackers. The plastic card (credit card) is popular so data must be safe.

DBSQL 7-25 Copyright © Genetic Computer School, Singapore 2009 Database Security System The person responsible for data security is usually the database administrator (DBA). The database security system stores authorization rules and enforces them for each database access. When a group of users, access data in the database then a privilege can be given to the said group rather than individual users. Database security involves allowing and disallowing users from performing actions on the database and the objects within it

DBSQL 7-26 Copyright © Genetic Computer School, Singapore 2009 Classification of Security Physical refers to the security of the hardware associated with the system and the protection of the site where the computer resides Logical refers to the security measures residing in the operating system or the DBMS designed to handle threats to the data.

DBSQL 7-27 Copyright © Genetic Computer School, Singapore 2009 Cont’ Design Level Should be simple Has to be normalized Decide privilege for each group Create unique view for each users or group Maintenance Level Operating system issues and availability Confidentiality and accountability Encryption Authentication schemes

DBSQL 7-28 Copyright © Genetic Computer School, Singapore 2009 Database Recovery

DBSQL 7-29 Copyright © Genetic Computer School, Singapore 2009 Database Recovery Failure Classification Recovery Facilities Recovery Techniques Advance Recovery Techniques

DBSQL 7-30 Copyright © Genetic Computer School, Singapore 2009 Database Recovery Brings the database from the temporary inconsistent state to a consistent state. Database recovery can also be defined as mechanisms for restoring a database quickly and accurately after loss or damage. Database are damaged due to: Human error Hardware error Incorrect or invalid data Program errors Viruses Natural catastrophe

DBSQL 7-31 Copyright © Genetic Computer School, Singapore 2009 Recovery Facilities Back-up mechanism Logging Facilities Checkpoint Facilities Recovery Manager

DBSQL 7-32 Copyright © Genetic Computer School, Singapore 2009 Recovery Techniques Deferred update Immediate update Shadow paging

DBSQL 7-33 Copyright © Genetic Computer School, Singapore 2009 Advance Recovery Technique Crash Recovery Recovery Manager  Ensures transaction atomicity and durability Saving Steal Forcing