oracle core读书笔记1redo and undo

basic data change:
The Approach
Under the Oracle approach to data change, when you issue an instruction to change an item of data,
Oracle doesn’t just go to a data file (or the in-memory copy if the item happens to be buffered), find the
item, and change it. Instead, Oracle works through four critical steps to make the change happen.
Stripped to the bare minimum of detail, these are
1. Create a description of how to change the data item.
2. Create a description of how to re-create the original data item if needed.
3. Create a description of how to create the description of how to re-create the
original data item.
4. Change the data item.
The tongue-twisting nature of the third step gives you some idea of how convoluted the mechanism
is, but all will become clear. With the substitution of a few technical labels in these steps, here’s another
way of describing the actions of changing a data block:
1. Create a redo change vector describing the change to the data block.
2. Create an undo record for insertion into an undo block in the undo tablespace.
3. Create a redo change vector describing the change to the undo block.
4. Change the data block.
The exact sequence of steps and the various technicalities around the edges vary depending on the
version of Oracle, the nature of the transaction, how much work has been done so far in the transaction,
what the states of the various database blocks were before you executed the instruction, whether or not
you’re looking at the first change of a transaction, and so on.
 
update table的步骤:
1.create undo-related change vector
2.create table-related change vector
3a.construct change record:change record header:change vector #1(undo),change vector #2(table)
3b.copy change record to redo buffer.那么,在redo log(buffer)里就有了change record header和vector #1和#2
4.apply change vector #1在undo block里。
5.apply change vector #2在table block里。
第10页有个图可以清晰的表述这个步骤。
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/263455/viewspace-750828/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/263455/viewspace-750828/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值