oracle回滚段学习

Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 1 Update 一条记录

update test2 t set t.a=17111 where t.b=17286

 

2、在v$transactionv$session视图中可查询到相关事物信息,两个视图通过v$session.taddr=v$transaction.addrAddress of the transaction state object)相关联。

查询出该事物6号回滚段(xidusn27号事务槽(xidslot)中

select t.XIDUSN,t.XIDSLOT,t.XIDSQN,t.UBAFIL,t.UBABLK,t.UBAREC from v$transaction t

XIDUSN XIDSLOT      XIDSQN       UBAFIL  UBABLK UBAREC

1     6           27           2616                2        489                   89

 

3、查询v$rollname视图获得回滚段名称,usn列对应回滚段号

select * from v$rollname r where r.usn=6

 

4、转储回滚段头信息

Alter system dump undo header’ _SYSSMU6$’

index  state cflags  wrap#    uel         scn            dba            parent-xid    nub     stmt_num

0x1b 10 0x80 0x0a38 0x0002 0x0000.002ad486 0x008001e9 0x0000.000.00000000  0x00000001   0x00000000

 

5、转储前镜像信息100000000000000111101001

通过dbadata block address)字段得到该事务的前镜像数据块地址。

0x008001e9  转化为二进制0000 0000 1000 0000 0000 0001 1110 1001

该地址有10位文件号和22位数据块组成

得到该dba的文件号2 数据块号489与回滚段中UBAFILUndo block address (UBA) filenum),UBABLKUBA block number)相同

 

6、转储文件号2 数据块号489中信息

alter system dump datafile 2 block 489;

irb: 0x5f  指回滚段中记录的最近的未提交变更的开始之处,及最后一次更改之处。

rci:该参数代表的是同一事务中的关联修改。回滚时根据这个数值找到下次回滚之处。

col  0: [ 4]  c3 03 18 2e 记录的就是前置信息。

 

由于test2表中的A字段是索引,所以回滚段中记录的test2的回滚信息和索引的回滚信息。

索引:

*-----------------------------

* Rec #0x5f  slt: 0x1b  objn: 30454(0x000076f6)  objd: 30454  tblspc: 5(0x00000005)

*       Layer:  10 (Index)   opc: 22   rci 0x5e  

Undo type:  Regular undo   Last buffer split:  No

Temp Object:  No

Tablespace Undo:  No

rdba: 0x00000000

*-----------------------------

index undo for leaf key operations

KTB Redo

op: 0x02  ver: 0x01 

op: C  uba: 0x008001e9.00ee.5c

Dump kdilk : itl=2, kdxlkflg=0x1 sdc=5216369 indexid=0x1404c0b block=0x01404c3e

purge leaf row

key :(17):  04 c3 02 48 0e 04 c3 03 18 2e 06 01 40 4b 34 00 04

表数据:

*-----------------------------

* Rec #0x5d  slt: 0x1b  objn: 30449(0x000076f1)  objd: 30449  tblspc: 5(0x00000005)

*       Layer:  11 (Row)   opc: 1   rci 0x5c  

Undo type:  Regular undo   Last buffer split:  No

Temp Object:  No

Tablespace Undo:  No

rdba: 0x00000000

*-----------------------------

KDO undo record:

KTB Redo

op: 0x02  ver: 0x01 

op: C  uba: 0x008001e9.00ee.5a

KDO Op code: URP row dependencies Disabled

  xtype: XA  bdba: 0x01404b34  hdba: 0x01404b33

itli: 2  ispac: 0  maxfr: 4858

tabn: 0 slot: 4(0x4) flag: 0x2c lock: 0 ckix: 5

ncol: 3 nnew: 1 size: 0

col  0: [ 4]  c3 03 18 2e

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

转载于:http://blog.itpub.net/15017002/viewspace-434452/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值