What are the Transaction properties/components?
Atomicity
Consistency
Isolation
Durability
Explain the Transaction Management with SQL
What is the definition of a Transaction Log and what is its function?
A DBMS table that contains a description of all database transactions. The information stored in the log is used by the DBMS to recover the database after a transaction is aborted or after a system failure.
What are the 3 main problems of Concurrency Control?
Lost Updates
Uncommitted Data
Inconsistent Retrievals
What is the Scheduler?
DBMS component that establishes the order in which concurrent database
operations are executed. The scheduler interleaves the execution of the database operations to ensure the serializability of transactions.
What is a Lock?
a mechanism used in concurrency control to guarantee the exclusive use of a data element
to the transaction that owns the lock.
e.g. if the data element X is currently locked by
transaction T1, transaction T2 will not have access to the data element X until T1 releases its lock.
A data item can only be in two states: locked (used by transaction) unlocked (free to use)
What is Lock Granularity and what are the different levels?
Refers to the size of the database object that a single lock is placed upon.
Its different levels:
- Database level (DB is locked)
- Table level (table locked)
- Page-level (diskpage locked)
- Row level ( one row locked)
- Field level (one field in one row locked)
What are the last 2 Lock types?
Exclusive lock
- one of two lock types used to enforce concurrency control
- exists when access to a data item is specifically reserved for the transaction that
locked the object.
- must be used when a potential for conflict exists
- e.g one or more transactions must update (WRITE) a data item. Therefore, an exclusive lock is issued
only when a transaction must WRITE (update) a data item and no locks are currently held on that
data item by any other transaction.
What is a Deadlock?
A condition where two transactions wait for each other to access/unlock a data source
What are the 3 Deadlock Control techniques?
Prevention
Detection
- if deadlock found, one of the transactions is aborted while other continues
Avoidance
- avoids rollback of conflicting transactions by requiring that locks be obtained in succession
What is the Optimistic Approach with Concurrency Control?
What is Database Recovery Management?