(01) The global coordinator initiates and commits the distributed transaction.
During execution of the SQL statements within the transaction, the
definition of the session tree is completed (-> dba_2pc_neighbors).
(02) The commit point site is determined (commit_point_strength) and the SCNs
(System Change Number) of the communicating nodes are coordinated.
The highest SCN at all nodes is determined. This will be the commit SCN
at the commit point site later on (-> highest global SCN -> global
integrity !!!).
(03) The global coordinator asks participating nodes other than the commit
point site to promise to commit or roll back (-> prepare message) the
transaction, even if there is a failure. If any node cannot prepare,
the transaction is rolled back.
(04) Every participating node allocates resources it needs to commit or roll
back the transaction if data is changed.
It saves redo records corresponding to changes made by the transaction
to its online redo log. This makes it possible to recover the database
back to the prepare state in case of an instance failure.
The node guarantees that locks held for the transaction are able to
survive a failure.
(05) All participating nodes place a distributed lock on modified tables
preventing reads/writes.
(06) All participating nodes respond with a prepared message to their
global/local coordinator and wait until a commit or rollback request is
received from the global/local coordinator.
After the nodes are prepared, the distributed transaction is said to be
in-doubt.
Note that all participating nodes need to be prepared for the two phase
commit to continue to the next phase (-> commit phase).
(07) The global coordinator instructs the commit point site to commit.
(08) The commit point site commits with the highest SCN (see step 02).
(09) The commit point site informs the global coordinator of the commit.
(10) The global/local coordinator instructs all the participating nodes
to commit.
(11) Every node commits the local portion of the distributed transaction and
releases locks.
(12) Every node records an additional redo entry in the local redo log
indicating that the transaction has commited.
(13) The participating nodes notify the global coordinator that they have
committed.
On completion of the commit phase, the data on all nodes of the distributed
system is consistent with one another.
(14) After receiving notice from the global coordinator that all nodes have
committed, the commit point site erases status information about this
transaction.
(15) The commit point site informs the global coordinator that it has erased
the status information.
(16) The global coordinator erases its own information about the transaction.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16158219/viewspace-541449/
,如需转载,请注明出处,否则将追究法律责任。