Overview of Transaction Management (142)

tsinglee發表於2007-11-05

A transaction in Oracle begins when the first executable SQL statement is encountered.
An executable SQL statement is a SQL statement that generates calls to an instance,
including DML and DDL statements.
When a transaction begins, Oracle assigns the transaction to an available undo
tablespace to record the rollback entries for the new transaction.
A transaction ends when any of the following occurs:
■ A user issues a COMMIT or ROLLBACK statement without a SAVEPOINT clause.
■ A user runs a DDL statement such as CREATE, DROP, RENAME, or ALTER. If the
current transaction contains any DML statements, Oracle first commits the
transaction, and then runs and commits the DDL statement as a new, single
statement transaction.
■ A user disconnects from Oracle. The current transaction is committed.
■ A user process terminates abnormally. The current transaction is rolled back.
After one transaction ends, the next executable SQL statement automatically starts the
following transaction.

事務管理
1. 事務以第一條可執行的SQL語句(對例項產生calls)開始 , 包括DML和DDL語句 .
2. 當事務開始時 , Oracle分配回滾表空間來記錄回滾條目
3. 當碰到以下情況時 , 事務結束
a. 指定commit或rollback語句
b. 執行一個DDL語句
c. 使用者斷連 , 當前事務被提交
d. 使用者程式非正常終止 , 當前事務被回滾

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-980850/,如需轉載,請註明出處,否則將追究法律責任。

相關文章