Summer CS 430 Chapter 14&15 Practice Quiz

Ace your homework & exams now with Quizwiz!

Match the terms to their definition: 1. Volatile storage 2. Non-volatile storage 3. Stable storage Definitions: a) Information that does not survive a system crash. b) Information kept in the cloud. c) Information that is never lost. d) Information that survives a system crash.

1. a) Information that does not survive a system crash. 2. d) Information that survives a system crash. 3. c) Information that is never lost.

Match the phase in optimistic concurrency control to its action. 1. Read 2. Validation 3. Write Definitions: a) If validations determines there are no possible conflicts, the changes to the data objects made by the transaction. b) The transaction executes, reading values from the database and writing to a private workspace c) If the transaction decides to commit, the DBMS checks whether the transaction could possibly have conflicted

1. b) The transaction executes, reading values from the database and writing to a private workspace 2. c) If the transaction decides to commit, the DBMS checks whether the transaction could possibly have conflicted MAYBE 3. a) If validations determines there are no possible conflicts, the changes to the data objects made by the transaction.

The difference between two-phase locking protocol and strict two-phase locking protocol is: a) That under strict two-phase locking protocol, an aborted transaction is not allowed. b) That under strict two-phase locking protocol, all locks acquired are exclusive locks. c) That under two-phase locking protocol, you may acquire a lock while in the shrinking phase. d) That under two-phase locking protocol, you may release a lock while in the growing phase. e) That under strict two-phase locking protocol, all exclusive locks must be held until the commit.

NOT a) That under strict two-phase locking protocol, an aborted transaction is not allowed. b) That under strict two-phase locking protocol, all locks acquired are exclusive locks.

We can prevent deadlocks by giving each transaction a priority and ensuring that lower transactions are not allowed to wait for higher priority transactions. One way is to assign timestamps to each transaction. When are these timestamps assigned? a) Each time a transaction requests a lock. b) At the time the transaction starts up. c) Each time a transaction requests and releases a lock. d) At the time the deadlock is detected.

NOT c) a) Each time a transaction requests a lock.

A lock protocol assumes that all locks be two-phase and that all locks be held until the transaction commits. Which term below would best describe this protocol? a) Rigorous two phase locking b) None of the answers provided c) Timestamp-based locking d) Strict two phase locking e) Phase Locking

NOT d) Strict two phase locking b) None of the answers provided

A ___________ schedule is one where, for each pair of transactions T1 and T2, such that T1 reads a data item previously written by T2, the commit operation of T2 appears before the commit operation of T1.

NOT serializable

We say that two operations _________ if the operations are by different transactions on the same data item and at least one of them is a write operation.

NOT serializable

If a transaction T has obtained an ______ lock on item Q, then T can both read and write Q.

NOT shared read-write

The database system must control the interaction among concurrent transaction to prevent them from destroying the consistency of the database. This is done through a variety of mechanisms called the ______ -control schemes.

NOT timestamp

A schedule is conflict serializable if it is conflict equivalent to some serial schedule.

True

In a two-phase locking protocol, transactions are required to obtain locks (and not release them) during the growing phase, and release locks (but not obtain them) during the shrinking phase.

True

Starvation occurs when a transaction is unable to ever acquire the resources (locks) necessary for it to complete.

True

The DBMS sees a transaction as a series of reads, writes, and a commit/abort.

True

Using multigranularity locking, if a node is locked in SIX mode, The sub-tree rooted by that node is locked explicitly in shared mode, and explicit locking is done at the lower level of the tree with exclusive locks.

True

Which of the following are contained in a lock table entry for an object - which can be a page, a record, etc. ? a) A pointer to a queue of lock requests. b) The nature of the lock (shared or exclusive). c) The number of locks held by a transaction. d) A pointer to a queue of granted locks. e) The number of transactions currently holding a lock on the object.

a) A pointer to a queue of lock requests. b) The nature of the lock (shared or exclusive). AND

Which properties does the following schedule have? T1 T2 ----------- ----------- R(A) W(A) R(A) W(A) R(B) W(B) R(B) W(B) Commit Commit a) Recoverable b) Serial c) Conflict Serializable d) Cascadeless

a) Recoverable c) Conflict Serializable

Which of the following are reasons to allow transactions to run concurrently rather than serially? a) Reduced waiting time. b) Multi-user support. c) Inaccuracy when transactions are run serially. d) Increased reliability. e) Improved throughput and resource utilization.

a) Reduced waiting time. AND AND

In the validation phase of optimistic concurreny control, timestamps are assigned to the transactions and a set of criterion is applied to see whether the time-stamp ordering of transactions is equivalent to some serial order. For every pair of transactions Ti and Tj such that TS(Ti) ≤ TS(Tj), one of the following selections must hold: a) Ti completes all three phases before Tj begins. b) Ti completes its read phase before Tj completes its read phase and Ti does not write any database object that is either read or written by Tj c) Tj completes all three phases before Ti begins. d) Ti complete before Tj starts its write phase and Ti does not write any database object read by Tj.

a) Ti completes all three phases before Tj begins. AND AND

What is a waits-for graph used for? a) To avoid deadlock cycles. b) To identify transactions. c) To detect deadlock cycles. d) To break deadlock cycles.

a) To detect deadlock cycles.

In a deadlock prevention system using timestamps, there are two policies the lock manager can use to prevent deadlock if Ti requests a lock that Tj holds. Which of the following are they? a) Wound-wait: if Ti has a higher priority, abort Tj; otherwise, Ti waits. b) Wound-wait: if Ti has a higher priority, abort Ti; otherwise, Tj waits. c) Wait-die - if Ti has a higher priority, it is allowed to wait; otherwise it is aborted. d) Wait-die - if Ti has a lower priority, it is allowed to wait; otherwise it is aborted.

a) Wound-wait: if Ti has a higher priority, abort Tj; otherwise, Ti waits. c) Wait-die - if Ti has a higher priority, it is allowed to wait; otherwise it is aborted.

1. The state after the discovery that normal execution can no longer proceed: 2. The state after the final statement has been executed: 3. The initial state; the state a transaction stays in while it is executing: 4. The state after the transaction has successfully completed: 5. The state after the transaction has been rolled back and the database has been restored to its state prior to the start of the transaction: a) rolled back b) active c) failed d) committed e) partially committed f) terminated g) aborted

1. NOT: g) aborted c) failed f) terminated a) rolled back e) partially committed 2. NOT b) active d) committed 3. b) active 4. d) committed 5. NOT a) rolled back c) failed

Match the isolation level to its specification: 1. Serializable 2. Repeatable read 3. Read committed 4. Read uncommitted a) Allows only committed data to be read, but does not require repeatable reads. b) Allows only committed data to be read and requires that between two reads of an item by a transaction, no other c) Allows uncommitted data to be read. d) Ensures serializable execution.

1. Serializable d) Ensures serializable execution. 2. Repeatable read b) Allows only committed data to be read and requires that between two reads of an item by a transaction, no other 3. Read committed a) Allows only committed data to be read, but does not require repeatable reads. 4. Read uncommitted c) Allows uncommitted data to be read.

Match the lock type in multigranular locking to its associated action. 1. Shared lock (S) 2. Exclusive lock (X) 3. Intention shared (IS) 4. Intention exclusive (IX) 5. Shared intention exclusive (SIX) a) Used when writing an object is required. b) Logically equivalent to holding both a shared(S) and intention exclusive (IX) lock. c) Used when only reading an object is required. d) Used to lock the ancestors of a object being locked in shared mode. e) Used to lock the ancestors of an object being locked in exclusive mode.

1. Shared lock (S) 2. Exclusive lock (X) 3. Intention shared (IS) 4. Intention exclusive (IX) 5. Shared intention exclusive (SIX) b) Logically equivalent to holding both a shared(S) and intention exclusive (IX) lock.

Which of the following is true about a serializable schedule? a) A serializable schedule is one in which the transactions are required to run in serial order. b) A serializable schedule of a set S of committed transactions is a schedule whose effect on any consistent database instance is guaranteed to be identical to that of some serial schedule over S. c) A schedule is only serializable if T1 precedes T2 precedes T3 and so on... d) The database instance that results from from executing a schedule that is a serializable schedule is identical to the database instance that results from executing the transactions in some serial order. e) The database administrator approves the schedule.

b) A serializable schedule of a set S of committed transactions is a schedule whose effect on any consistent database instance is guaranteed to be identical to that of some serial schedule over S. d) The database instance that results from from executing a schedule that is a serializable schedule is identical to the database instance that results from executing the transactions in some serial order.

A set of transactions fail to make progress due to a cycle of lock requests. This problem is best described by which term? a) Wound-wait b) Deadlock c) Starvation d) None of the answers provided e) Lock compatibility

b) Deadlock

Which of the following is necessary for two schedules to be view equivalent? a) If Ti reads a value of A written by Tj in S1 it must also write the value of A written by tj in S2. b) If Ti reads the initial value of object A in S1, it must also read the initial value of A in S2. c) For each data object A, the transaction (if any) that performs the final write on A in S1 must also perform the final write on A in S2. d) For each data object A, the transaction (if any) that performs the final write on A in S1 must also perform the initial write on A in S2. e) If Ti reads a value of A written bu Tj in S1 it must also read the value of A written by tj in S2.

b) If Ti reads the initial value of object A in S1, it must also read the initial value of A in S2. AND AND NOT a) If Ti reads a value of A written by Tj in S1 it must also write the value of A written by tj in S2. d) For each data object A, the transaction (if any) that performs the final write on A in S1 must also perform the initial write on A in S2.

When a transaction holds a shared lock on an object, and wants to acquire an exclusive lock, it ussues a: a) Lock correction. b) Lock upgrade. c) Commit. d) Abort. e) Lock transversal.

b) Lock upgrade.

How many valid serial schedules exist for a net of N transactions? a) N b) N! c) N + N d) N * N

b) N!

The act of granting an exclusive lock to a transaction that holds a shared lock - called a lock upgrade - fails under which of the following conditions. a) If no other transactions hold any locks. b) None of the above. c) If a transaction other than the one requesting the lock upgrade holds an exclusive lock. d) If no other transaction holds an exclusive lock on the object. e) If no other transaction holds a shared lock on the object.

b) None of the above.

What can you say about a schedule whose precedence graph contains no cycles? a) The schedule is view serializable. b) The schedule is conflict serializable. c) The schedule is recoverable. d) The schedule avoids cascading rollbacks.

b) The schedule is conflict serializable. AND\

A precedence graph - also known as a serializability graph - captures all the potential conflicts between transactions in a schedule. Which of the following is true about a precedence graph? a) There exists an node for all aborted transactions in S. b) There exists an edge from Ti to Tj if an action of Ti precedes and conflicts with one of Tj's actions. c) There exists a node for each transaction in S. d) There exists a node for each committed transaction in S. e) There exists an edge from Ti to Tj if an action of Ti succeeds and conflicts with one of Tj's actions.

b) There exists an edge from Ti to Tj if an action of Ti precedes and conflicts with one of Tj's actions. d) There exists a node for each committed transaction in S.

In a real database system, the write operation updates the data on disk: a) when the lock is obtained b) eventually c) at the next checkpoint d) immediately

b) eventually

A transaction is which of the following. a) A programming language to access a DBMS. b) A DML necessary for querying c) Any one execution of a user program in a DBMS. d) A DDL necessary for querying. e) A file system construct for maintenance.

c) Any one execution of a user program in a DBMS.

When timestamp-based concurrency control is used, transactions are assigned a timestamp when they begin. This timestamp is used to ensure conflict serializability. When a transaction wants to write an object O, which of the following are checks done to ensure serializability? a) If TS(T) < RTS(O), the write action conflicts with the most recent read action of O, and T is aborted and restarted b) If all checks are valid, T writes O, and RTS(O) is set to TS(T). c) If TS(T) < WTS(O), the Thomas Write Rule allows us to ignore the outdated write. d) If all checks are valid, T writes O, and WTS(o) is set to TS(T). e) If TS(T) < WTS(O), the Thomas Write Rule allows us to go ahead and perform the write.

c) If TS(T) < WTS(O), the Thomas Write Rule allows us to ignore the outdated write. d) If all checks are valid, T writes O, and WTS(o) is set to TS(T). NOT e) If TS(T) < WTS(O), the Thomas Write Rule allows us to go ahead and perform the write.

Two schedules are said to be conflict equivalent if they do which of the following. a) Involve a similar set of actions of the same transactions and they order every pair of conflicting action of two committed transactions in the same way. b) Involve different actions between the same set of transactions and order every pair of conflicting actions of these transactions in non-conflicting order. c) Involve the same set of actions of the same transactions and they order every pair of conflicting actions of two committed transactions in the same way. d) Involve the same set of actions of two different sets of transactions and they order every pair of conflicting actions of these transactions in non-conflicting order. e) None of the above.

c) Involve the same set of actions of the same transactions and they order every pair of conflicting actions of two committed transactions in the same way.

Which of the following is true about the lock manager? a) It maintains a lock table, which is a hash table with the data object identifier as the key. b) It is the part of the DBMS that keeps track of the locks issued to transactions. c) It is responsible for concurrency control at the transaction level. d) It is managed by the lock table manager, responsible for managing the lock table.

c) It maintains a lock table, which is a hash table with the data object identifier as the key. b) It is the part of the DBMS that keeps track of the locks issued to transactions. NOT d) c) It is responsible for concurrency control at the transaction level.

What is the lowest isolation level allowed by SQL? a) Read committed b) Serializable c) Read uncommitted d) Repeatable read

c) Read uncommitted

A DBMS interleaves the actions of several transactions to achieve which of the following: a) Atomicity b) Durability c) Isolation d) Consistency e) None of the above

d) Consistency NOT c) Isolation

Which of the following actions does the lock manger take upon receiving a lock request from a transaction? a) If the requested lock cannot be immediately granted, the lock request is added to the queue of lock requests for this object and the transaction is aborted. b) If the requested lock cannot be immediately granted, the lock request is added to the queue of lock requests for this object and the transaction is suspended. c) If an exclusive lock is requested and no transaction currently holds a lock on the object (which also implies the queue of requests is empty), the lock manager grants the lock and updates the lock table entry for the object. d) If a shared lock is requested, the queue of requests is empty, and the object is not currently locked in exclusive mode, the lock manager grants the lock and updates the lock entry table for the object.

d) If a shared lock is requested, the queue of requests is empty, and the object is not currently locked in exclusive mode, the lock manager grants the lock and updates the lock entry table for the object. AND AND NOT a) If the requested lock cannot be immediately granted, the lock request is added to the queue of lock requests for this object and the transaction is aborted.

Which of the following is not a transaction state? a) Active. b) Aborted. c) Committed. d) None of the answers provided

d) None of the answers provided

Multigranular locking schemes are particularly useful in applications that include a mix of: a) Long transactions that produce reports from an entire set of files b) Short transactions that access many data items c) Long transactions that involve many writes d) Short transactions that only access a few items

d) Short transactions that only access a few items a) Long transactions that produce reports from an entire set of files

Which of the following best describes a schedule? a) None of the above. b) A list of data items being modified in the system, and the order in which those modifications occur. c) A minimal set of attributes whose values identify an entity in a set. d) A list of transactions currently executing in the sustem, and the order in which the transactions occur. e) A list of actions (reading, writing, aborting, committing) from a set of transactions and the order in which the actions occur.

e) A list of actions (reading, writing, aborting, committing) from a set of transactions and the order in which the actions occur.

A set of rules that we require each transaction to following while acquiring and releasing locks is called what? a) Lock termination rules. b) Precedence protocol. c) Djkstra's rules. d) Lock acquisition rules. e) Locking protocol.

e) Locking protocol.

If a transaction T has obtained a ______ lock on item Q, then T can read but not write Q.

read

Using multigranularity locking, if a node is locked in IX mode, explicit locking is done at the lower level of the tree, but only with shared locks.

False

When using timestamp-based concurrency control, every data object has a read and a write timestamp associated with it. These are set to the TS of the last transaction to successfully perform that operation on that object.

False

A schedule is view serializable if and only if it is view equivalent to some conflict serializable schedule.

False

A transaction is a single operation that performs multiple logical functions within a database.

False

Ensuring atomicity is the responsibility of the system administrator.

False

Every serializable schedule is conflict serializable.

False

If a lock is acquired on the entire database before each transaction starts, and released when it is committed, a conflict serializable schedule is created, but not a view serializable one.

False

In a timestamp concurrency control system, timestamps are assigned by the system administrator before the transaction begins.

False

Multiversion concurrency control is rarely used in today's systems.

False


Related study sets

ENTR 187 - Entrepreneurship - Sac State - Dr. VanVo

View Set

Env Chem - Unit 2 Greenhouse Effect Review

View Set

Chapter 18: Care of Patients with Arthritis and Other Connective Tissue Diseases

View Set

Money & Banking Chapter 5 The Structure of Interest Rates

View Set