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

Teradata RDBMS Database Administration - NCR

NCR Teradata RDBMS Database Administration - NCR , 2004. - 616 p.
Download (direct link): teradatadatabaseadmin2004.pdf
Previous << 1 .. 99 100 101 102 103 104 < 105 > 106 107 108 109 110 111 .. 218 >> Next

To terminate a transaction, an application can execute an ABORT/ROLLBACK statement or a COMMIT statement (see "In-Doubt Transactions" on page 7-22). A BEGIN or END TRANSACTION statement in ANSI mode generates an error.

For more details on ANSI mode, see Teradata RDBMS SQL Reference, Volume 1.

Teradata Mode

In Teradata mode, the Teradata RDBMS also automatically terminates transactions to preserve data integrity. If the system detects a statement error, deadlock, or a privilege or table constraint violation, and all statements in a request cannot complete successfully, the system:

Aborts the entire transaction

Backs out any changes to the database up to that point

Releases locks

Discards partially accumulated results (spool files)

Returns an error response to the user

In Teradata Mode, transactions can be nested. That is, a transaction can contain another transaction. In a group of nested transactions, all transactions must complete successfully. If an error occurs anywhere within nested transactions, the system rolls back all changes made to the database to the point at which the first transaction began.

The COMMIT statement generates an error. If the SQL flagger is enabled, BEGIN/END TRANSACTION is flagged as non-ANSI.

7 - 16

Teradata RDBMS Database Administration 7 - 15 Chapter 7: Protecting Data

2-Phase Commit (2PC) Protocol

2-Phase Commit (2PC) Protocol

2PC protocol is used by multiple systems which do not share the same locking and recovery mechanism to perform update transactions. Such systems, especially with more than one database management system, use 2PC to safeguard data in case of a failure.

A transaction using 2PC does not commit or roll back changes on its own, but does so only at the direction of an external coordinator. 2PC guarantees that all Teradata RDBMS update transactions either commit or rollback.

The 2PC protocol allows customers to develop Customer Information Control System (CICS) and Information Management System (IMS) applications that can update one or more Teradata RDBMSs and/or non-Teradata RDBMSs a synchronized manner. The result is that all updates requested in a defined unit of work either succeed or fail.

Participant and Coordinator

A coordinator manages processing for 2PC. When an application issues a commit or abort, the coordinator ensures that all participants either commit or abort.

A participant is a database manager that performs some work on behalf of the transaction, and commits or aborts changes to the database. A participant also can be a coordinator of participants at a lower level. In this case, the coordinator/participant relays a vote request to its participants, and sends its vote to the coordinator only after determining the outcome of its participants.

Note that the Teradata RDBMS is always a participant; it cannot be a coordinator. Also, Teradata RDBMS transaction management differs between 2PC sessions and non-2PC sessions.

For the rest of this section, assume that one application is connected to the Teradata RDBMS as a participant, and one application is designated as the coordinator.

2PC Protocol Requirements

To participate in the 2PC protocol with the Teradata RDBMS, an application or coordinator must be able to execute the following functions via the CLI:

Request a vote from the Teradata RDBMS

Issue a termination request

Teradata RDBMS Database Administration

7 - 17 Chapter 7: Protecting Data

2-Phase Commit (2PC) Protocol

If a session is in 2PC mode, each transaction is implicitly started when one of the following occurs:

A valid Teradata SQL request (a syntactically and semantically correct Data Manipulation Language (DML) statement) is received initially for the session.

Note: DDL statements, COMMENT, SET SESSION COLLATION, the DATABASE statement, and the CHECKPOINT statement are not allowed in 2PC mode.

A valid Teradata SQL request is received for the session after correct termination of a previous transaction.

TDP and the Teradata RDBMS provide functions to handle the resolution of in-doubt transactions following a Teradata RDBMS reset or coordinator crash. These functions, which the coordinator initiates automatically or that you can initiate manually from a client terminal or the Teradata RDBMS console, include the following:

Produce a list of coordinators having in-doubt transactions.

Produce a list of in-doubt transactions for a particular coordinator.

Accept directives causing in-doubt transactions to be committed or aborted.

In 2PC mode, sessions may use only the syncpoint facilities of the coordinator. Sessions cannot use the BEGIN TRANSACTION, END TRANSACTION, and COMMIT WORK statements except in nested transactions.

2PC Protocol Components and Interfaces

The main components and interfaces involved with 2PC protocol are shown below.

Participant Interface (CPI)


7 - 18

Teradata RDBMS Database Administration 7 - 17 Chapter 7: Protecting Data
Previous << 1 .. 99 100 101 102 103 104 < 105 > 106 107 108 109 110 111 .. 218 >> Next