PARSING IN CURSOR #2 len=142 dep=1 uid=0 oct=3 lid=0 tim=1414654507002840 hv=361892850 ad='78938c58' sqlid='7bd391hat42zk'
select /*+ rule */ name,file#,block#,status$,user#,undosqn,xactsqn,scnbas,scnwrp,DECODE(inst#,0,NULL,inst#),ts#,spare1 from undo$ where us#=:1
END OF STMT
PARSE #2:c=0,e=17,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=3,plh=906473769,tim=1414654507002839
BINDS #2:
Bind#0
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=7fcf70adc448 bln=22 avl=02 flg=05
value=7
undo段的状态是从undo$基表中获取的,那么我们看看这里的基表对应的物理块号
SYS@orcl11g>select rowid,dbms_rowid.rowid_object(rowid) robject,
2 dbms_rowid.rowid_relative_fno(rowid) fno,
3 dbms_rowid.rowid_block_number(rowid) bno,
4 dbms_rowid.rowid_row_number(rowid) rno from undo$ where rownum=1;
ROWID ROBJECT FNO BNO RNO
------------------ ---------- ---------- ---------- ----------
AAAAAPAABAAAADhAAA 15 1 225 0
然后我们使用bbed查看该数据块:
BBED> map
File: /opt/oracle/oradata/orcl11g/system01.dbf (1)
Block: 225 Dba:0x004000e1
------------------------------------------------------------
KTB Data Block (Table/Cluster)
struct kcbh, 20 bytes @0
struct ktbbh, 48 bytes @20
struct kdbh, 14 bytes @68
struct kdbt[1], 4 bytes @82
sb2 kdbr[21] @86
ub1 freespace[3752] @128
ub1 rowdata[4308] @3880
ub4 tailchk @8188
这里可以看出与视图对应的21个回滚段:
BBED> p kdbr
sb2 kdbr[0] @86 8078
sb2 kdbr[1] @88 4071
sb2 kdbr[2] @90 5156
sb2 kdbr[3] @92 5088
sb2 kdbr[4] @94 4206
sb2 kdbr[5] @96 4952
sb2 kdbr[6] @98 4341
sb2 kdbr[7] @100 4816
sb2 kdbr[8] @102 4748
sb2 kdbr[9] @104 4680
sb2 kdbr[10] @106 4611
sb2 kdbr[11] @108 4008
sb2 kdbr[12] @110 5880
sb2 kdbr[13] @112 5817
sb2 kdbr[14] @114 5751
sb2 kdbr[15] @116 3943
sb2 kdbr[16] @118 5622
sb2 kdbr[17] @120 3878
sb2 kdbr[18] @122 5490
sb2 kdbr[19] @124 3812
sb2 kdbr[20] @126 5360