CSU CS430 Module 11, 12 and 13

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which of the following are true about parsing the log during the Analysis phase?

All options

A set of transactions fail to make progress due to a cycle of lock requests. This problem is best described by which term?

Deadlock

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?

Rigorous two phase locking

What is a waits-for graph used for?

To detect deadlock cycles.

Which of the following is true about checkpointing?

a) A fuzzy checkpoint is one where the system is not quiesed. b) A checkpoint is like a snapshot of the DBMS state. d) Taking a checkpoint periodically reduces the amount of work to be done during restart. c) When a system comes back after a crash, the restart process begins by locating the most recent checkpoint record.

What tasks are performed during the Analysis phase of the ARIES algorithm?

a) A superset of the pages in the buffer pool are determined that were dirty at the time of the crash. b) The point in the log is determined at which to start the Redo phase. d) The transactions that were active at the time of the crash and must be undone are determined.

Which of the following are valid phases of the Aries recovery algorithm?

a) Redo b) Undo d) Analysis

During the redo phase, a logged action must be redone unless one of the following conditions holds:

a) The affected page is not in the dirty page table e) The pageLSN stored on the page on disk is greater than or equal to the LSN of the log record being checked. d) The affected page is in the dirty page table, but the recLSN for the entry is greater than the LSN of the log record being checked.

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:

aborted

The initial state; the state a transaction stays in while it is executing:

active

The state after the transaction has successfully completed:

committed

The policy that allows a transaction to commit even if it has modified some blocks that have not yet been written back to disk is called the __________ policy.

no-force

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? Group of answer choices

- If all checks are valid, T writes O, and WTS(o) is set to TS(T). -If TS(T) < RTS(O), the write action conflicts with the most recent read action of O, and T is aborted and restarted -If TS(T) < WTS(O), the Thomas Write Rule allows us to ignore the outdated write.

Which of the following are reasons to allow transactions to run concurrently rather than serially?

- Improved throughput and resource utilization. - Reduced waiting time -Multi-user support

Which of the following is true about a serializable schedule?

-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. -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.

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)CommitCommit

-Conflict Serializable -Recoverable

Which of the following is necessary for two schedules to be view equivalent?

-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. -If Ti reads the initial value of object A in S1, it must also read the initial value of A in S2. -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.

Which of the following actions does the lock manger take upon receiving a lock request from a transaction?

-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. -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. -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.

Which of the following is true about the lock manager?

-It maintains a lock table, which is a hash table with the data object identifier as the key. -It is the part of the DBMS that keeps track of the locks issued to transactions

Multigranular locking schemes are particularly useful in applications that include a mix of:

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

Which of the following are contained in a lock table entry for an object - which can be a page, a record, etc. ? Group of answer choices

-The number of transactions currently holding a lock on the object. - The nature of the lock (shared or exclusive). -The number of locks held by a transaction

What can you say about a schedule whose precedence graph contains no cycles?

-The schedule is conflict serializable. -The schedule is view serializable.

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?

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

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:

-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 -Ti complete before Tj starts its write phase and Ti does not write any database object read by Tj. -Ti completes all three phases before Tj begins.

Match the phase in optimistic concurrency control to its action.

1. Read 2. Validation 3. Write

Match the term associated with the log to its definition. 1. trail or journal 2. log seqence number 3. pageLSN 4. prevLSN 5. transID 6. type

1. a) A history of actions executed by the dbms. 2. c) Unique id assigned to every log record. 3. d) Contained in every page of the database, this describes LSN of the most recent log record that describes a 4. e) The LSN of the last record written by this transaction. 5. f) The transaction id 6. b) The type of the log record.

Match the ARIES phase to it's description

1. a) Identifies dirty pages in the buffer pool and active transactions at the time of the crash. 2. c) Repeats all actions, starting from an appropriate point in the log, and restores the database state to what it was 3. b) Undoes the actions of the transactions that did not commit, so the database reflects only the actions of

Match the fields in an update log record to its description. 1. pageID 2. length 3. offset 4. before-image 5. after-image

1. a) The page id of the modified page. 2. e) Length in bytes of the change. 3. d) The offset within the record of the change. 4. b) The value of the changed bytes before the change. 5. c) The value of the changed bytes after the change.

Match the steps to checkpointing in ARIES to their description.

1. a) The record written to indicate when the checkpoint starts. 2. d) Identifies all contents in the transaction table and the dirty page table. 3. c) Contains all contents of the current transaction table and the dirty page table. 4. b) A special record is written that contains the LSN of the last begin_checkpoint record.

Match the principle behind the recovery algorithm to its description. 1. Write ahead logging 2. Repeating history during redo 3. Logging changes during undo

1. b) Any change to a database object is first recorded in the log; the record in the log must be written to stable 2. a) On restart following a crash, the recovery system retraces all actions of the DBMS before the crash and brings 3. c) Changes made to the database while undoing a transaction are logged to ensure such an action is not repeated.

Match the fields found in a Compensation Log Record (CLR) to their description. 1. undoNextLSN 2. transiD 3. pageID 4. before-image 5. after-image

1. c) The LSN of the next log record that is to be undoen for the transaction that write the current update record 2. d) The transaction id of the update record being undone 3. a) The page of the change being undone 4. b) The image that existed after the update record being undone was finished 5. e) The image that existed before the update record being undone was finished

Which of the following best describes a schedule?

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

After a crash, the transaction table is rebuilt during which phase?

Analysis

A transaction is which of the following.

Any one execution of a user program in a DBMS.

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?

At the time the transaction starts up.

Match the transaction property to its definition.

Atomicity -Either all the operations Consistency - execution of a transaction Isolation - Even though multiple transactions Durability - After a transaction completes

The state after the discovery that normal execution can no longer proceed: Group of answer choices

Failed

A compensation log record (CLR) is written just after the change recorded in an update log record is undone.

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

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 database, a write() operation ensures the immediate write of the variable to persistent storage.

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

The log, sometimes called the trail or journal, is a history of actions executed by the lock manager.

False

The recLSN field in the dirty page table identifies the latest change to page P that may not have been written to disk.

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

Two schedules are said to be conflict equivalent if they do which of the following.

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.

When a compensation log record (CLR) is written, what is the field undoNextLSN set to?

LSN of the next log record that is to be undone for the transaction that wrote the update record.

When a transaction holds a shared lock on an object, and wants to acquire an exclusive lock, it ussues a:

Lock upgrade

A set of rules that we require each transaction to following while acquiring and releasing locks is called what?

Locking protocol

How many valid serial schedules exist for a net of N transactions?

N!

A DBMS interleaves the actions of several transactions to achieve which of the following:

None of the above

During the Undo phase of the ARIES recovery algorithm, a set called toUndo is built. What is toUndo initialized to?

None of the above

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.

None of the above

Which of the following is not a transaction state?

None of the answers provided

What is the lowest isolation level allowed by SQL?

Read uncommitted

Match the isolation level to its specification:

Serializable - Ensures Repeatable read - Allows only committed data to be read and requires ... Read committed - Allows only committed data to be read. Read uncommitted - Allows uncommitted data to be read

Match the lock type in multigranular locking to its associated action.

Shared lock - Used only when reading an object is required Exclusive lock - Used when writing an object is required Intention Shared (IS) - Used to lock the ancestors of an object being locked in shared mode Intention Exclusive (IX) - Used to lock the ancestors of an object being locked in exclusive mode Shared Intention Exclusive (SIX) - Logically equivalent to holding both a shared and an intention exclusive lock

The difference between two-phase locking protocol and strict two-phase locking protocol is:

That under strict two-phase locking protocol, all exclusive locks must be held until the commit.

Who is responsible for ensuring durability (and atomicity)?

The recovery system

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

True

Aborting a transaction is just a special case of the Undo phase of restart in which a single transaction is undone.

True

An audit trail is a log of all changes (inserts/deletes/updates) to the database, along with information such as which user performed the action and when the change was performed

True

If during the Redo phase a logged action must be redone, the logged action is reapplied, and the pageLSN on the page is set to the LSN of the redone log record.

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

One of the key factors to the success of the recovery algorithm is the Write Ahead Log (WAL) protocol. WAL forces all log records up to and including the one with LSN equal to the pageLSN to stable storage before writing the page to disk.

True

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

True

Strict 2 phase locking protocol allows only conflict serializable schedules.

True

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

True

The log tail - which is the most recent portion of the log, is kept in main memory and is periodically forced to stable storage. This allows log records and data records to be written to the disk at the same granularity.

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

Match the terms to their definition: Volatile storage Non-volatile storage Stable storage

Volatile storage: information that does not survive a system crash Non-volatile storage: information that survives a system crash Stable storage: information that is never lost

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?

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

Which of the following is true about a serializable 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. AND 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.

Which of the following are true about the transaction table used in ARIES?

b) Contains one entry for every active transaction c) Each entry in the transaction table contains (among other things) the transaction id, the status, and the LastLSN - the LSN of the most recent log entry for this transaction. d) The status of a transaction can be in progress, committed, aborted.

Which of the following are true about the dirty page table used by the ARIES algorithm?

b) Contains one entry for every dirty page in the buffer pool. c) Contains a field called recLSN which identifies the earliest log record that might have to be redone for this page during the restart from a crash. a) Is reconstructed during the Analysis phase of the recovery algorithm. e) Contains one entry for every page in the buffer pool, with a bit describing whether it is dirty or not.

Which of the following actions are done when processing the log during the Undo phase of the ARIES algorithm?

b) The goal of the phase is to undo the actions of all transactions active at the time of the crash. c) The log is scanned backward from the end of the log

The recovery manager is responsible for ensuring which of the following transaction properties.

c) Durability d) Atomicity

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

concurrency

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.

conflict

If transaction T1 holds a read lock on data item A and is requesting a write lock on B, while at the same time transaction T2 holds a read lock on B and is requesting a write lock on A - this situation is known as

deadlock

In a real database system, the write operation updates the data on disk:

eventually

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

exclusive

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

exclusive

The state after the final statement has been executed:

partially committed

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.

recoverable


Set pelajaran terkait

Management 101: Cengage Chapter 2

View Set

DOMANDE AREA TP TRATTAMENTO UNGUEALE

View Set

Arithmetic Sequences, Geometric Sequences

View Set

Ch 13 Small Business Accounting: Projecting and Evaluating Performance

View Set

Disorders of Neuromuscular Function

View Set

CSC 415 Operating Systems All Units

View Set

N128 Week 2 - Adaptive Quizzing #2

View Set