ITPub博客

首页 > 数据库 > Oracle > 【翻】What Is Undo? 2017-11-28

【翻】What Is Undo? 2017-11-28

翻译 Oracle 作者:595642573 时间:2017-11-28 19:42:57 0 删除 编辑

What Is Undo?  什么是Undo?

Oracle Database creates and manages information that is used to roll back, or undo, changes to the database. Such information consists of records of the actions of transactions, primarily before they are committed. These records are collectively referred to as undo.
Undo 是 Oracle数据库创建和管理用于回滚或撤销数据库更改的信息。这些信息由没有被committed的事务性操作的记录组成。这些记录被统称为undo

Undo records are used to:
Undo记录用于:

  • Roll back transactions when a ROLLBACK statement is issued
    在发出回滚语句时回滚事务

  • Recover the database
    恢复数据库

  • Provide read consistency
    保证读操作的一致性

  • Analyze data as of an earlier point in time by using Oracle Flashback Query
    通过使用Oracle Flashback Query来分析早期的数据

  • Recover from logical corruptions using Oracle Flashback features
    使用Oracle Flashback特性从逻辑坏块中恢复数据

When a ROLLBACK statement is issued, undo records are used to undo changes that were made to the database by the uncommitted transaction. During database recovery, undo records are used to undo any uncommitted changes applied from the redo log to the data files. Undo records provide read consistency by maintaining the before image of the data for users who are accessing the data at the same time that another user is changing it.
当发出一个ROLLBACK 语句,undo记录用于撤销那些没有被committed的事务做出的修改。
在数据库恢复期间,undo记录用于撤消从redo日志到数据文件所产生的任何没有committed的更改。
Undo记录提供了读取的一致性,具体做法是保存在另一个用户正在更改数据的同时访问数据的用户的数据之前的数据快照。         最后一句话太晦涩,解释一下:
        有三个时刻ABC
        甲在A时刻对一块数据发起访问,在C时刻获取到数据
        乙在中间时刻B,对同一块数据进行了修改,
        该如何保证甲在A时刻和C时刻读取到一致的数据?
        undo记录在甲发起访问时,对该数据保留了一份快照,不管A到C中这块数据经历了怎样的变化,甲访问到的永远是A时刻的数据快照。

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

请登录后发表评论 登录
全部评论

注册时间:2017-06-20

  • 博文量
    13
  • 访问量
    7491