首页 > IT基础架构 > 网络安全 > The Two-Phase Commit Mechanism (149)

The Two-Phase Commit Mechanism (149)

原创 网络安全 作者:tsinglee 时间:2007-11-06 10:00:28 0 删除 编辑

In a distributed database, Oracle must coordinate transaction control over a
network and maintain data consistency, even if a network or system failure

A distributed transaction is a transaction that includes one or more statements
that update data on two or more distinct nodes of a distributed database.

A two-phase commit mechanism guarantees that all database servers participating
in a distributed transaction either all commit or all undo the statements in the
transaction. A two-phase commit mechanism also protects implicit DML operations
performed by integrity constraints, remote procedure calls, and triggers.

The Oracle two-phase commit mechanism is completely transparent to users who
issue distributed transactions. In fact, users need not even know the
transaction is distributed. A COMMIT statement denoting the end of a transaction automatically
triggers the two-phase commit mechanism to commit the transaction. No coding or
complex statement syntax is required to include distributed transactions within
the body of a database application.

The recoverer (RECO) background process automatically resolves the outcome of
in-doubt distributed transactions—distributed transactions in which the commit
was interrupted by any type of system or network failure. After the failure is
repaired and communication is reestablished, the RECO process of each local Oracle database
automatically commits or rolls back any in-doubt distributed transactions
consistently on all involved nodes.

In the event of a long-term failure, Oracle allows each local administrator to
manually commit or undo any distributed transactions that are in doubt as a result of the
failure. This option enables the local database administrator to free any locked
resources that are held indefinitely as a result of the long-term failure.

If a database must be recovered to a point in the past, Oracle’s recovery
facilities enable database administrators at other sites to return their databases to the
earlier point in time also. This operation ensures that the global database remains

1. 分布式事务指同一个事务中的一个或多个 SQL 语句同时更新分布在分布式数据库中不同节点的数据.
2. 两层提交机制可以保证所有参与分布式事务的数据库或者同时提交 ,或者同时撤销事务中SQL语句的操作.
两步提交机制还确保了由完整性约束 ,远程过程调用 ,及触发器执行的隐式 DML 操作正常工作.
3. 拿不准的分布式事务指因为各种系统或网络故障而阻碍了提交操作的分布式事务.


来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

上一篇: Commit Comment (148)
请登录后发表评论 登录
  • 博文量
  • 访问量