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

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 .. 44 45 46 47 48 49 < 50 > 51 52 53 54 55 56 .. 76 >> Next

If there are a large number of rows to be processed, the AMP recovers offline. The RDBMS sends updates to the offline AMP in background mode.

If the AMP needs to process only a few rows, then the recovery is done online.

Once all updates are made, the AMP is considered to be fully online.

Introduction to the Teradata RDBMS for UNIX

Concurrency Control and Recovery

Two-Phase Commit

Two-Phase Commit

Two-phase commit (2PC) is a protocol for ensuring transaction commitment in a distributed database environment. Two-phase commit for the Teradata RDBMS is supported by default only in MVS environments running either IMS or CICS databases. ANSI transaction semantics do not permit use of the two-phase commit protocol.

The Teradata RDBMS implements the participant side, while IMS and CICS implement a coordinator. Any user can write custom coordinator software and implement 2PC with the Teradata RDBMS and any other DBMS that also supports the participant side.

The protocol ensures that all participants in a distributed transaction agree on whether to commit a transaction or not before proceeding.

A participant is a database manager that performs some work on behalf of the transaction and that commits or aborts database transactions in a distributed environment.

Any number of participants can engage in a two-phase commit operation.

A participant is defined as being in doubt from the time it votes to commit or abort until the time it receives a commit or abort instruction from the coordinator.

A coordinator is a controlling database manager with respect to the distributed situation.

The coordinator is never in doubt. Selection of the coordinator is arbitrary, but with respect to the Teradata RDBMS it is always either IMS or CICS.

There can be only one coordinator per transaction at one time.

The two-phase commit protocol was developed to ensure that Two-Phase Commit multiple transaction postings in distributed environments are

always either committed or aborted.

In the Teradata environment, the Teradata database manager is always a participant, while the IMS or CICS database manager is always the coordinator.

In phase 1 of 2PC, the coordinator requests all participants to vote to commit or abort or go into a state where they can either commit or rollback.


Introduction to the Teradata RDBMS for UNIX
Concurrency Control and Recovery

Two-Phase Commit

When a participant reaches this state, it sends an OK message to the coordinator.

If the coordinator does not receive such a message (or if it times out), then it assumes failure.

After all participants in the transaction send an OK message back to the coordinator, phase 2 begins when the coordinator broadcasts a commit command to all participants.

If all participants do not send an OK, then the coordinator broadcasts a rollback command.

The following diagram illustrates the major components and interfaces of 2PC in the Teradata environment.

Figure 10-2

Two-phase Commit Processing

Application- Application-

participant interface coordinator interface

participant interface


Introduction to the Teradata RDBMS for UNIX

Concurrency Control and Recovery

Two-Phase Commit

Limitations on Number of Sessions

The following table explains the functions of the various interfaces illustrated by the diagram.

Interface Function
Application-participant Requests 2PC sessions.
Coordinator-participant 2PC protocol. Handles vote requests and abort and commit messages.
Participant-coordinator Manages communications from participant to coordinator including responses to requests for session information.
Application-coordinator Initiates commit requests.

The number of sessions supported with 2PC varies by application development tool as detailed in the following table.

Application Development Tool Number of Sessions Supported
CLI Version 2 Multiple
Preprocessor2 One


Introduction to the Teradata RDBMS for UNIX
Concurrency Control and Recovery

Two-Phase Commit

The following picture illustrates 2PC processing as a function of

Two-Phase Commit time.


Figure 10-3

Two-phase Commit Processing as a Function of Time

Phase1 Phase 2

Transaction in doubt




Participant possibly in doubt




Introduction to the Teradata RDBMS for UNIX

Concurrency Control and Recovery

For More Information

For More Information

For more information on the topics presented in this chapter, see the following Teradata manuals.

IF you want to learn more about . . . THEN see this manual . . .
Specifying transactions in an embedded SQL program Teradata RDBMS for UNIX SQL Reference Teradata Application Programming With Embedded SQL for C, COBOL, and PL/I
Two-phase commit Teradata RDBMS for UNIX Database Design and Administration Teradata TDP Reference Teradata Client for MVS Installation Guide
Previous << 1 .. 44 45 46 47 48 49 < 50 > 51 52 53 54 55 56 .. 76 >> Next