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标记事务结束
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-980851/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10599713/viewspace-980851/
本文详细介绍了Oracle数据库中事务提交的具体流程。包括事务提交前Oracle如何生成回滚信息及重做日志条目,以及数据缓冲区的变化。此外,还阐述了事务提交时内部事务表的更新、重做日志的写入、锁的释放和事务标记完成等关键步骤。
287

被折叠的 条评论
为什么被折叠?



