The oracle's detail process with the redo log and rollback when when a DML statement is run. [message #60675] |
Tue, 24 February 2004 19:52 |
cuihh6
Messages: 12 Registered: February 2004
|
Junior Member |
|
|
The oracle's detail process with the redo log and rollback when when a DML statement is run.
Here is my opinion about the process of a DML statement.
1. user A update one row in tableA, but not commit.
2. the previous values of the row was recorded to the redo log buffer.
3. the new values of the row was recorded to the redo log buffer
4. Then the previous values of the row were both recorded to the rollback blocks in the data buffer cache.
5. Then the new values of the row were recorded to the data blocks in the data buffer cache.
If user B select the row which was updated but not committed by user A from tableA, the row was returned from rollback segment
in the data buffer cache.
Only after user A execute the commit , the data in the data buffer was written to the datafiles.
The Above are my personal opinions.
Am i right ? if not please make some correct ions.
|
|
|
|
Re: The oracle's detail process with the redo log and rollback when when a DML statement is run. [message #60684 is a reply to message #60675] |
Wed, 25 February 2004 15:45 |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
1. Before making any changes to the data blocks, rollback segments need to be updated which needs to go into log_buffer first. So Oracle records the transaction slot entries into log_buffer first.
2.Allocate transaction slot in the rollback segment.
3.Write the prior values (of transaction table entries) to the redo log buffer, to redo the changes.
4.Write the previous transaction table entries into another location of the rollback segment for rollback purposes.
5. Write the previous image of the data blocks into the rollback segment blocks in the buffer cache.
6.Write the changes(new values) of the data block into the redolog buffer.
7.Update the data blocks with the changes , in the buffer cache.
User B cannot see the changes until after commit by user A.
When user B encounters a block whose SCN is higher than his snapshot SCN, then it derives that the row has been changed and using the rollback segment address ,identifies the rollback segment containing information about the previous version of the block and reconstructs that image .
DBWR can flush the buffers from the cache into datafiles,irrespective of the state of transaction(ie commit or not).But a commit confirmation is not returned until LGWR has safely written the redo entries and commit record to the redolog files.
-Thiru
|
|
|