深入解析Oracle undo原理_ktuxc详解(二)

作者简介:惠星星,现就职于北京海天起点,持有OCP 10g、OCP 11g、OCM 11g证书,并有长达8年电力行业业务维护、数据库维护服务经验,擅长Oracle数据库性能优化、故障处理及数据可视化技术研究。

 

问题描述

KTUXC(UNDO TRANSACTION CONTROL)表示回滚段事务控制,是undo 段头块中的一部分,使用CHD (Commit Head)和CTL (Commit Tail)快速定位该回滚段中可用的slot number。结构如下图所示,

KTUXC结构解析


【字段解释】

SEQ: Sequence number of the last block of the undo segment.

CHD (Commit Head): Head of the chain of the list of committed transactions sorted by increasing SCN (this points to an entry in the transaction table)

CTL (Commit Tail): Tail of the chain of the list of committed transactions, sorted by SCN (this points to an

entry in the transaction table).

INC: High water mark for incarnation number (increases by steps of 1024).

NFB: Number of nonempty slots in the free block pool.

MGC: Magic number for test of coherence (for AUM segments this value is 0x8201).

XTS: Tx table entry location from bottom of KCBH.

FLG: Value 1. Tx table has been converted from an earlier version.

OPT: Value for the OPTIMAL parameter.

UBA (Control UBA): The UBA of the undo record allowing rollback of the Tx table.

SCN (Control SCN): The committed SCN of the transaction that “rolled out” of the Tx table

验证chd字段

验证chd字段是否为下一个待使用的usn slot,



Tx table的排序

Tx table中slot的排序,从CHD (Commit Head)开始,通过KTUXEUEL指向下一个slot,直到ktuxeslt等于CTL (Commit Tail)时KTUXEUEL为-1。所有usn中INACTIVE slot以KTUXESCNB和KTUXESLT升序排列。

总结

ktuxc使用单向链表结构控制ktuxe中待使用的INACTIVE slot,从CHD (Commit Head)开始CTL (Commit Tail)结束,以KTUXESCNB和KTUXESLT升序排列。

未经允许不得转载:Oracle一体机用户组 » 深入解析Oracle undo原理_ktuxc详解(二)

相关推荐