Commit Transactions (143)

tsinglee發表於2007-11-05

Committing a transaction means making permanent the changes performed by the
SQL statements within the transaction.
Before a transaction that modifies data is committed, the following has occurred:
■ Oracle has generated undo information. The undo information contains the old
data values changed by the SQL statements of the transaction.
■ Oracle has generated redo log entries in the redo log buffer of the SGA. The redo
log record contains the change to the data block and the change to the rollback
block. These changes may go to disk before a transaction is committed.
■ The changes have been made to the database buffers of the SGA. These changes
may go to disk before a transaction is committed.
When a transaction is committed, the following occurs:
1. The internal transaction table for the associated undo tablespace records that the
transaction has committed, and the corresponding unique system change number
(SCN) of the transaction is assigned and recorded in the table.
2. The log writer process (LGWR) writes redo log entries in the SGA’s redo log
buffers to the redo log file. It also writes the transaction’s SCN to the redo log file.
This atomic event constitutes the commit of the transaction.
3. Oracle releases locks held on rows and tables.
4. Oracle marks the transaction complete.

提交事務
當事務修改的資料被提交之前 , 發生了以下事情
1. Oracle生成了回滾資訊
2. Oracle在SGA中的重做日誌緩衝區中生成了重做日誌條目
3. 事務做的改變made to the database buffers of the SGA
當事務被提交時 , 發生了以下事情
1. 內部事務表關聯的回滾段記錄事務已經提交 , scn被記錄在表中
2. lgwr將重做日誌條目從redo logbuffers寫入 redo log file ,事務的scn也表記錄在重做日誌檔案中
3. Oracle釋放錶行和表的鎖
4. Oracle標記事務結束

[@more@]

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

相關文章