Understand Distributed transaction & Two-Phase commit in Oracle

Understand Distributed transaction & Two-Phase Commit

A Distributed transaction includes one or more statements that, individually or as a group, update data on two or more distinct nodes of a distributed database.
A distributed transaction is considered committed after all non-commit-point sites are prepared, and the transaction has been actually committed at the commit point site.

Distributed Transaction terms:
Session Tree:
The database defines a session tree of all nodes participating in the distributed transaction.
Client which refer information from another database node.
Database Server:
Database Server which host a database from which a client request data.
Local Coordinator:
A node that refer to another node for data to complete its transaction.
Global coordinator:
Node from which transaction is originating.
Commit Point:
System always choose one node to be commit point site.

Two-Phase Commit Mechanism

In Distributed Environment alerting data involves the multiple databases. In this committing or rolling is managed as a complete process means the entire transaction commits or the entire transaction rolls back. For maintain the integrity of data in a distributed transaction using the two-phase commit mechanism.

It includes phases:
Prepare Phase: global coordinator ask all Participating nodes other than commit site to promise for commit or rollback the transaction. if any node is cannot prepare then completed transaction is rollback.
Commit Phase: All nodes informed the coordinator at commit site that they are prepared and having all the needed resources for commit the transactions then coordinator ask commit site to commit. After commit all participating ask for commit the transaction.
Forget Phase: After got conformation from all nodes by the coordinator that they all are committed then commit site forget the transaction.

For more info: Understand In Doubt Transaction

1 thought on “Understand Distributed transaction & Two-Phase commit in Oracle

  1. Pingback: Understand Distributed Database in Oracle | Smart way of Technology

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.