Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Introduction to the Teradata® RDBMS for UNIX® Version 2 Release 2.1 - NCR

NCR Introduction to the Teradata® RDBMS for UNIX® Version 2 Release 2.1 - NCR, 1998. - 315 p.
Download (direct link): inntroduktionteradata1998.pdf
Previous << 1 .. 41 42 43 44 45 46 < 47 > 48 49 50 51 52 53 .. 76 >> Next


IF you want to learn more about . . . THEN see this manual . . .
Physical database design Teradata RDBMS for UNIX Database Design and Administration

Introduction to the Teradata RDBMS for UNIX

9-13
Fault Tolerance

For More Information

9-14

Introduction to the Teradata RDBMS for UNIX
Concurrency Control and Recovery

Chapter 10

Concurrency Control and Recovery

Introduction to the Teradata RDBMS for UNIX
Concurrency Control and Recovery

Introduction to the Teradata RDBMS for UNIX
Concurrency Control and Recovery

About This Chapter

About This Chapter

Introduction

Concurrency Control

This chapter describes the topic of concurrency control in relational database management systems and how transaction journaling can be used to recover lost data or restore an inconsistent database to a consistent state.

The first part of this chapter deals with the concepts of transactions and locks.

This chapter also describes the closely related topics of concurrency control and recovery.

Concurrency control deals with preventing concurrently running processes from improperly inserting, deleting, or updating the same data. Concurrency control is maintained through two mechanisms:

• Transactions

• Locks

The second part of this chapter deals with recovery.

Recovery

Recovery is a process by which an inconsistent database is brought back to a consistent state. Transactions play the critical role in this process as well because they are used to “play back” a series of updates (using the term in its most general sense) to the database, either taking it back to some earlier state or bringing it forward to a current state.

Introduction to the Teradata RDBMS for UNIX

10-1
Concurrency Control and Recovery

The Concept of the Transaction

Introduction

Definition of a Transaction

Definition of Serializability

Transaction Semantics

ANSI Transactions

The Concept of the Transaction

This topic describes the concept of a transaction. Transactions are a mandatory facility for maintaining the integrity of a database while running multiple concurrent operations.

A transaction is a logical unit of work. It is both the unit of work and the unit of recovery. The statements nested within a transaction must either all happen or none happen. Transactions are atomic: there is no such thing as a partial transaction.

A set of transactions is said to be serializable if and only if it produces the same result as some arbitrary serial execution of those same transactions for arbitrary input.

A set of transactions can be correct only if it is serializable.

Serializability is achieved through the use of the Two-Phase Locking (2PL) protocol. The two phases are the growing phase and the shrinking phase.

In the growing phase, for any object, a transaction must first acquire a lock on that object before operating on it.

In the shrinking phase, a transaction must never acquire any more locks once it has released a lock. Lock release is an all-or-none operation.

The Teradata RDBMS supports both ANSI transaction semantics and its own transaction semantics.

Default transaction mode for a site is a system default parameter. The default can be overridden for a session.

The Teradata RDBMS returns an error when a COMMIT statement is issued by a transaction operating in Teradata semantics mode.

The ANSI COMMIT WORK statement is supported in ANSI transaction mode.

All ANSI transactions are implicit.

Either of the following events opens an ANSI transaction:

• First SQL statement executed in a session

10-2

Introduction to the Teradata RDBMS for UNIX
Rolling Back an ANSI Transaction

Concurrency Control and Recovery

The Concept of the Transaction

• First statement executed following the close of a previous transaction.

Transactions close when the application performs a COMMIT, ROLLBACK, or ABORT statement.

The last statement in a transaction must be a data definition statement (including DATABASE and SET SESSION, which are considered to be DDL statements in this context).

The statements BEGIN TRANSACTION and END TRANSACTION, along with the two-phase commit protocol, are not allowed for a session executing under ANSI transaction semantics.

When an application submits these statements in an ANSI situation, the database software generates an error.

ANSI rolls back the entire transaction under the following conditions when the current request:

• Results in a deadlock

• Performs a DDL statement that aborts

• Executes an explicit ROLLBACK or ABORT statement.

The ABORT and ROLLBACK statements are accepted in ANSI mode, including conditional forms of those statements.

When an errors for either a single or multistatement request, only that request is rolled back and the transaction remains open except in the following special circumstances:

When these statements are executed and are either unconditional or the specified condition is true, then the entire transaction is rolled back. This action does not result in a request-level rollback.
Previous << 1 .. 41 42 43 44 45 46 < 47 > 48 49 50 51 52 53 .. 76 >> Next