《Oracle引航课程第7章 数据库对象(二).pdf》由会员分享,可在线阅读,更多相关《Oracle引航课程第7章 数据库对象(二).pdf(22页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、DATAGURU专业数据分析网站 2012.10.15 2012.10.15 数据库引航数据库引航 第七课第七课OracleOracle数据库对象(二)数据库对象(二)DATAGURU专业数据分析网站2012.2012.10.1510.15重做日志重做日志-REDO-REDODATAGURU专业数据分析网站2012.2012.10.1510.15REDOREDODATAGURU专业数据分析网站2012.2012.10.1510.15REDO-REDO-日志组日志组DATAGURU专业数据分析网站2012.2012.10.1510.15REDOREDO和归档和归档DATAGURU专业数据分析网站
2、2012.2012.10.1510.15REDOREDO的内容的内容-改变向量改变向量DATAGURU专业数据分析网站2012.2012.10.1510.15REDO-undoREDO-undo的的redoredoDATAGURU专业数据分析网站2012.2012.10.1510.15UNDOUNDO 作用数据的回滚一致性读表的闪回(事务,查询的闪回.)失败会话的恢复DATAGURU专业数据分析网站2012.2012.10.1510.15UndoUndo的产生的产生DATAGURU专业数据分析网站2012.2012.10.1510.15Undo V.S.RedoUndo V.S.RedoInc
3、onsistent reads in multiuser systemsUndo segmentsRollback,read consistency,flashbackHow to undo a changeUndoProtects againstStored inUsed forRecord ofRolling forward database changesRedo log filesData lossHow to reproduce a changeRedoRedo log Redo log Redo log Redo log filesfilesfilesfilesUndo Undo
4、Undo Undo segmentsegmentsegmentsegment1-11Copyright Oracle Corporation,2002.All rights reserved.Redo Buffer OperationRedo Buffer OperationRedo Buffer OperationRedo Buffer OperationWhen user entersUser#1UPDATE emp SET sal=10 WHERE id=1234database buffer cache data file 2 data file 4undo file 31234 5X
5、YZZack1-12Copyright Oracle Corporation,2002.All rights reserved.Redo Buffer OperationRedo Buffer OperationRedo Buffer OperationRedo Buffer OperationWhen user entersUser#1UPDATE emp SET sal=10 WHERE id=1234The data data data data block is retrieved from disk to the database buffer cache(unless itsalr
6、eady there)1234 5database buffer cache data file 2 data file 4undo file 31234 5XYZZack1-13Copyright Oracle Corporation,2002.All rights reserved.Redo Buffer OperationRedo Buffer OperationRedo Buffer OperationRedo Buffer OperationWhen user entersUser#1UPDATE emp SET sal=10 WHERE id=1234The data data d
7、ata data block is retrieved from disk to the database buffer cache(unless itsalready there)1234 5The undoundoundoundo block is then retrieved from disk to the database buffer cache(unless its already there)U1database buffer cache data file 2 data file 41234 5XYZZackundo file 31-14Copyright Oracle Co
8、rporation,2002.All rights reserved.Redo Buffer OperationRedo Buffer OperationRedo Buffer OperationRedo Buffer OperationWhen user entersUser#1UPDATE emp SET sal=10 WHERE id=1234The data data data data block is retrieved from disk to the database buffer cache(unless itsalready there)1234 5The undoundo
9、undoundo block is then retrieved from disk to the database buffer cache(unless its already there)U1database buffer cache data file 2 data file 4The undo undo undo undo data iscreated showing the before image51234 5XYZZackundo file 31-15Copyright Oracle Corporation,2002.All rights reserved.Redo Buffe
10、r OperationRedo Buffer OperationRedo Buffer OperationRedo Buffer OperationWhen user entersUser#1UPDATE emp SET sal=10 WHERE id=1234The data data data data block is retrieved from disk to the database buffer cache(unless itsalready there)1234 5The udoudoudoudo block is then retrieved from disk to the
11、 database buffer cache(unless its already there)U1database buffer cache data file 2 data file 4The undo undo undo undo data iscreated showing the before image5And an entry recording this change is made in the REDOREDOREDOREDO bufferRedo BufferRedo BufferRedo BufferRedo BufferTran File Block Row Colu
12、mn Value idT1 3 12 -51234 5XYZZackundo file 31-16Copyright Oracle Corporation,2002.All rights reserved.Redo Buffer OperationRedo Buffer OperationRedo Buffer OperationRedo Buffer OperationWhen user entersUser#1UPDATE emp SET sal=10 WHERE id=12341234 5U1database buffer cache data file 2 data file 45Re
13、do BufferRedo BufferRedo BufferRedo BufferTran File Block Row Column Value idT1 3 12 -51234 5XYZZackThen the data block ischanged.x x x x10undo file 31-17Copyright Oracle Corporation,2002.All rights reserved.Redo Buffer OperationRedo Buffer OperationRedo Buffer OperationRedo Buffer OperationWhen use
14、r entersUser#1UPDATE emp SET sal=10 WHERE id=12341234 5U1database buffer cache data file 2 data file 45Redo BufferRedo BufferRedo BufferRedo BufferTran File Block Row Column Value idT1 3 12 -51234 5XYZZackThen the data block ischanged.x x x x10And an entry recording this change is made in the REDORE
15、DOREDOREDO bufferT1 2 123 41 6 10undo file 3DATAGURU专业数据分析网站2012.2012.10.1510.15Undo Undo 表空间表空间 普通的数据表空间 机制和数据表空间完全一致,只不过用途不同。DATAGURU专业数据分析网站2012.2012.10.1510.15自动管理回滚段表空间自动管理回滚段表空间 动态改变回滚段的个数。自动调整回滚段的大小DATAGURU专业数据分析网站2012.2012.10.1510.15UndoUndo数据的保留时间数据的保留时间DATAGURU专业数据分析网站2012.2012.10.1510.15UndoUndo表空间的损坏表空间的损坏 如果有活动的事务,需要恢复Undo表空间,如果没有备份,将导致数据库损坏。如果没有活动事务,可以重建一个undo表空间。DATAGURU专业数据分析网站ThanksThanksFAQ时间