Ch 10 Flashcards

1
Q

Transaction

A

A transaction is a logical unit of work that must be entirely completed or entirely aborted; no intermediate states are acceptable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Consistent database state

A

A consistent database state is one in which all data integrity constraints are satisfied.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Database request

A

A database request is the equivalent of a single SQL statement in an application program or transaction. E.g. if a transaction is composed of two UPDATE and one INSERT statement, the transaction uses three database requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Atomicity

A

Atomicity requires that all operations (SQL requests) of a transaction be completed; if not, the transaction is aborted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Consistency

A

Consistency indicates the permeance of the database’s consistent state. A transaction takes a database from one consistent state to another. When a transaction is completed, the database must be in a consistent state; if any of the transaction parts violates an integrity constraint, the entire transaction is aborted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Isolation

A

Isolation means that the data used during the execution of a transaction cannot be used by a second transaction until the first one is completed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Durability

A

Durability ensures that once transaction changes are done and committed, they cannot be undone or lost, even in the event of a system failure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Serializability

A

Serializability ensures that the schedule for the concurrent execution of the transactions yields consistent results. This property is important in multiuser and distributed databases in which multiple transactions are likely to be executed concurrently. Naturally, if only a single transaction is executed, serializability is not an issue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Transaction log

A

A DBMS uses a transaction log to keep track of all transactions that update the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Concurrency control

A

Coordinating the simultaneous execution of transactions in a multiuser database system is known as concurrency control. The objective of concurrency control is to ensure the serializability of transactions in a multiuser database environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Lost update

A

The lost update problem occurs when two concurrent transactions are updating the same data element and one of the updates is lost (overwritten by the other transaction).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Uncommitted data

A

The phenomenon of uncommitted data occurs when two transactions are executed concurrently and the first transaction is rolled back after the second transaction has already accessed the uncommitted data - thus violating the isolation property of transactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Inconsistent retrievals

A

Inconsistent retrievals occur when a transaction accesses data before and after one or more other transactions finish working with such data. E.g. an inconsistent retrieval would occur if transaction T1 calculated some summary (aggregate) function over a set of data while another transaction (T2) was updating the same data. The problem is that the transaction might read some data before they are changed and other data after they are changed, thereby yielding inconsistent results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Scheduler

A

The scheduler is a special DBMS process that establishes the order in which the operations are executed within concurrent transactions. The scheduler interleaves the execution of database operations to ensure serializability and isolation of transactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Serializable schedule

A

The scheduler’s main job is to create a serializable schedule of a transaction’s operations, in which the interleaved execution of the transactions yields the same results as if the transactions were executed in serial order one after another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Lock

A

A lock guarantees exclusive use of a data item to a current transaction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Pessimistic locking

A

The use of locks based on the assumption that conflict between transactions is likely is often referred to as pessimistic locking.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Lock manager

A

All lock information is handled by a lock manager, which is responsible for assigning and policing the locks used by the transactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Lock granularity

A

Lock granularity indicates the level of lock use. Locking can take place at the following levels: database, table, page, row, or even field (attribute).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Database-level lock

A

In a database-level lock, the entire database is locked, thus preventing the use of any tables in the database by transaction T2 while transaction T1 is being executed.

21
Q

Table-level lock

A

In a table-level lock, the entire table is locked, preventing access to any row by transaction T2 while transaction T1 is using the table. If a transaction requires access to several table, each table may be locked.

22
Q

Page-level lock

A

In a page-level lock, the DBMS locks an entire diskpage. A diskpage, or page, is the equivalent of a diskblock, which can be described as a directly addressable section of a disk.

23
Q

Row-level lock

A

A row-level lock is much less restrictive than the locks previously discussed. The DBMS allows concurrent transactions to access different rows of the same table even when the rows are located on the same page. Although the row-level locking approach improves the availability of data, its management requires high overhead because a lock exists for each row in a table of the database involved in a conflicting transaction.

24
Q

Field-level lock

A

The field-level lock allows concurrent transactions to access the same row as long as they require the use of different fields (attributes) within that row.

25
Q

Binary lock

A

A binary lock has only two states: locked (1) and unlocked (0). If an object such as a database, table, page or row is locked by a transaction, no other transaction can use that object. If an object is unlocked, any transaction can lock the object for its use.

26
Q

Exclusive lock

A

An exclusive lock exists when access is reserved specifically for the transaction that locked the object.

27
Q

Shared lock

A

A shared lock exists when concurrent transactions are granted read access on the basis of a common lock. A shared lock produces no conflict as long as all the concurrent transactions are read-only.

28
Q

Mutual exclusive rule

A

The exclusive lock is granted if and only if no other locks are held on the data item (this condition is known as the mutual exclusive rule: only one transaction at a time can own an exclusive lock on an object).

29
Q

Deadlock/deadly embrace

A

A deadlock occurs when two transactions wait indefinitely for each other to unlock data.

30
Q

Two-phase locking (2PL)

A

Two-phase locking defines how transactions acquire and relinquish locks. Two-phase locking guarantees serializability, but it does not prevent deadlocks.

31
Q

Time stamping

A

The time stamping approach to scheduling concurrent transactions assigns a global, unique time stamp to each transaction. The time stamp produces an explicit order in which transactions are submitted to the DBMS. Uniqueness ensures that no equal time stamp values can exist, and monotonicity ensures that time stamp values always increase.

32
Q

Wait/die scheme

A

In short, in the wait/die scheme, the older transaction waits for the younger one to complete and release its locks.

33
Q

Wound/wait scheme

A

In short, in the wound/wait scheme, the older transaction rolls back the younger transaction and reschedules it.

34
Q

Optimistic approach

A

The optimistic approach is based on the assumption that the majority of database operations do not conflict. The optimistic approach requires neither locking nor time stamping techniques. Instead, a transaction is executed without restrictions until it is committed.

35
Q

Dirty read

A

Dirty read: a transaction can read data that is not yet committed.

36
Q

Nonrepeatable read

A

Nonrepeatable read: a transaction reads a given row at time t1, and then it reads the same row at time t2, yielding different results. The original row may have been updated or deleted.

37
Q

Phantom read

A

Phantom read: a transaction executes a query at time t1, and then it runs the same query at time t2, yielding additional rows that satisfy the query.

38
Q

Read Uncommitted

A

Read Uncommitted will read uncommitted data from other transactions. At this isolation level, the database does not place locks on the data, which increases transaction performance but at the cost of data consistency.

39
Q

Read Committed

A

Read Committed forces transaction to read only committed data. This is the default mode of operation for most databases.

40
Q

Repeatable Read

A

The Repeatable Read isolation level ensures that queries return consistent results. This type of isolation level uses shared locks to ensure other transactions do not update a row after the original query reads it.

41
Q

Serializable

A

The Serializable isolation is the most restrictive level defined by the ANSI SQL standard.

42
Q

Database recovery

A

Database recovery restores a database from a given state (usually inconsistent) to a previously consistent state.

43
Q

Atomic transaction property

A

Recovery techniques are based on the atomic transaction property: all portions of the transaction must be treated as a single, logical unit of work in which all operations are applied and completed to produce a consistent database.

44
Q

Write-ahead-log protocal

A

The write-ahead-log protocol ensures that transaction logs are always written before any database data are actually updated. This protocol ensures that, in case of a failure, the database can later be recovered to a consistent state using the data in the transaction log.

45
Q

Redundant transaction logs

A

Redundant transaction logs (several copies of the transaction log) ensure that a physical disk failure will not impair the DBMS’s ability to recover data.

46
Q

Buffers

A

Database buffers are temporary storage areas in primary memory used to speed up disk operations. To improve processing time, the DBMS software reads the data from the physical disk and stores a copy of it on a “buffer” in primary memory. When a transaction updates data, it actually updates the copy of the data in the buffer because that process is much faster than accessing the physical disk every time. Later, all buffers that contain updated data are written to a physical disk during a single operation, thereby saving significant processing time.

47
Q

Checkpoints

A

Database checkpoints are operations in which the DBMS writes all of its updated buggers in memory (also known as dirty buffers) to disk. While this is happening, the DBMS does not execute any other requests. A checkpoint operation is also registered in the transaction log. As a result of this operation, the physical database and the transaction log will be in sync.

48
Q

Deferred-write technique

A

When the recovery procedure uses a deferred-write technique (also called a deferred update), the transaction operations do not immediately update the physical database. Instead, only the transaction log is updated. The database is physically updated only with data from committed transactions, using information from the transaction log.

49
Q

Write-through technique

A

When the recovery procedure uses a write-through technique (also called an immediate update), the database is immediately updated by transaction operations during the transaction’s execution, even before the transaction reaches its commit point.