Oracle Undo Segment
What Is 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 records are used to:
-
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
-
Recover from logical corruptions using Oracle Flashback features
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.
--------------------->>
Undo Segments and Transactions
When a transaction starts, the database binds (assigns) the transaction to an undo segment, and therefore to a , in the current undo tablespace. In rare circumstances, if the database instance does not have a designated undo tablespace, then the transaction binds to the system undo segment.
Multiple active transactions can write concurrently to the same undo segment or to different segments. For example, transactions T1 and T2 can both write to undo segment U1, or T1 can write to U1 while T2 writes to undo segment U2.
Conceptually, the extents in an undo segment form a ring. Transactions write to one undo extent, and then to the next extent in the ring, and so on in cyclical fashion. shows two transactions, T1 and T2, which begin writing in the third extent (E3) of an undo segment and continue writing to the fourth extent (E4).
At any given time, a transaction writes sequentially to only one extent in an undo segment, known as the current extent for the transaction. Multiple active transactions can write simultaneously to the same current extent or to different current extents. shows transactions T1 and T2 writing simultaneously to extent E3. Within an undo extent, a data block contains data for only one transaction.
As the current undo extent fills, the first transaction needing space checks the availability of the next allocated extent in the ring. If the next extent does not contain data from an active transaction, then this extent becomes the current extent. Now all transactions that need space can write to the new current extent. In , when E4 is full, T1 and T2 continue writing to E1, overwriting the nonactive undo data in E1.
If the next extent does contain data from an active transaction, then the database must allocate a new extent. shows a scenario in which T1 and T2 are writing to E4. When E4 fills up, the transactions cannot continue writing to E1 because E1 contains active undo entries. Therefore, the database allocates a new extent (E5) for this undo segment. The transactions continue writing to E5.
Transaction Rollback
When a ROLLBACK statement is issued, the database uses undo records to roll back changes made to the database by the uncommitted transaction. During recovery, the database rolls back any uncommitted changes applied from the online redo log to the data files. Undo records provide by maintaining the before image of the data for users accessing data at the same time that another user is changing it.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29119536/viewspace-1486345/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to Shrink Undo Segment In Oracle DatabaseOracleDatabase
- oracle undo segment header 事務表transaction table系列一OracleHeader
- Oracle效能最佳化之Rollback(undo)Segment最佳化(轉)Oracle
- UNDO SEGMENT的擴充套件和收縮套件
- Oracle - ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS1'Oracle
- SMON: recover undo segment與並行事務恢復並行
- oracle 11g不同會話產生的事務會使用相同的undo segment嗎--undo系列之一Oracle會話
- undo segment的建立、線上以及extent的分配原則。
- 沒有備份undo segment出現問題的處理
- undo segment的建立、online以及extent的分配原則
- SMON: about to recover undo segment 1 的錯誤提示解決方法
- [Oracle Script] Rollback Segment UsageOracle
- Oracle Segment AdvisorOracle
- Oracle-Segment space managementOracle
- Oracle Redo and UndoOracle Redo
- Oracle undo 管理Oracle
- oracle undo管理Oracle
- oracle undo一Oracle
- 關於ITL以及UNDO SEGMENT HEADER 事物表(tx table)闡述Header
- ORACLE LOB SEGMENT常規管理Oracle
- oracle addm segment tuningOracle
- dump轉儲undo segment header block回滾段頭塊小方法HeaderBloC
- Oracle深入Undo探究Oracle
- Oracle UNDO引數Oracle
- oracle undo 使用分析Oracle
- Oracle In Memory Undo(IMU)Oracle
- Oracle Undo 的配置Oracle
- Oracle Undo的作用Oracle
- Oracle In Memory Undo(轉)Oracle
- oracle undo系列(三)Oracle
- oracle undo系列(二)Oracle
- Oracle OCP(48):UNDO TABLESPACEOracle
- oracle undo分配規則Oracle
- oracle undo 表空間Oracle
- Oracle undo管理詳解Oracle
- Oracle Undo的學習Oracle
- oracle的undo的作用Oracle
- oracle的redo和undoOracle