您的位置:首页 > 数据库 > Oracle

oracle(十二)redo 与 undo

2013-09-24 15:42 387 查看
1.undo:回滚未提交的事务。未提交前,内存不够用时,DBWR将脏数据写入数据文件中,以腾出内存空间。 这就是undo存在的原因。

redo:恢复所有已提交的事务

2.实例失败(如主机掉电)可能出现的情况:

  (1)已提交的事务只写到了online redo log,但没有写到数据文件中。(commit时,oracle先调用LGWR,再调用DBWR)

  (2)没提交的数据写到了数据文件中。(内存不够用)

3.实例恢复的两个阶段

(1)rolling forward (Cache Recovery) :after rolling forward,the data files contain all committed changes recorded in the online redo log file.

These files could also contain uncommitted changes that were either saved to the data files before the failure.

(2)rolling back ( Transaction Recovery):any changes that were not committed must be undone.

4.redo 会把undo tabaleSpace或undo segment中的数据当成表数据一样,对undo数据的修改也会生成一些redo。

在进行实例恢复时,redo操作也会生成undo数据。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: