sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 运维DBA >

【学习笔记】Oracle undo control scn等于block scn和block itl scn

时间:2016-12-05 21:20   来源:Oracle研究中心   作者:网络   点击:

天萃荷净 Oracle研究中心学习笔记:分享一篇关于Oracle数据库SCN的运行机制研究,证明undo control scn等于block scn和block itl scn的值。

本站文章除注明转载外,均为本站原创: 转载自love wife & love life —Roger 的Oracle技术博客
本文链接地址: dml/transaction/block scn/itl scn

SQL> conn roger/roger
Connected.
SQL> SET LINES 150
SQL> CREATE TABLE tab_undo AS SELECT owner,object_name,object_id FROM
  2  sys.dba_objects WHERE object_id < 10;

TABLE created.

SQL> SELECT * FROM tab_undo;

OWNER                          OBJECT_NAME                     OBJECT_ID
------------------------------ ------------------------------ ----------
SYS                            I_FILE#_BLOCK#                          9
SYS                            C_FILE#_BLOCK#                          8
SYS                            I_TS#                                   7
SYS                            C_TS#                                   6
SYS                            CLU$                                    5
SYS                            TAB$                                    4
SYS                            I_OBJ#                                  3
SYS                            C_OBJ#                                  2

8 ROWS selected.

SQL> SELECT dbms_rowid.rowid_relative_fno(rowid) file#,
  2  dbms_rowid.rowid_block_number(rowid) blk#
  3  FROM tab_undo;

     FILE#       BLK#
---------- ----------
         4       6444
         4       6444
         4       6444
         4       6444
         4       6444
         4       6444
         4       6444
         4       6444

8 ROWS selected.

SQL> DELETE FROM tab_undo WHERE object_id=9;

1 ROW deleted.

SQL> SELECT xidusn,xidslot,xidsqn,ubablk,ubafil,ubarec FROM v$transaction;

    XIDUSN    XIDSLOT     XIDSQN     UBABLK     UBAFIL     UBAREC
---------- ---------- ---------- ---------- ---------- ----------
        14         37        374      17310          9         47

SQL> SELECT usn,name FROM v$rollname WHERE usn=14;

       USN NAME
---------- ------------------------------
        14 _SYSSMU14$

SQL> ALTER system dump datafile 4 block 6444;
http://www.oracleplus.net
System altered.

SQL> SELECT COUNT(*) FROM tab_undo;

  COUNT(*)
----------
         7

SQL> ALTER system dump undo header '_SYSSMU14$';

System altered.
—–block dump

Start dump data blocks tsn: 4 file#: 4 minblk 6444 maxblk 6444
buffer tsn: 4 rdba: 0x0100192c (4/6444)
scn: 0x0000.00430d30 seq: 0x01 flg: 0x04 tail: 0x0d300601
frmt: 0x02 chkval: 0x097f type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0xB7349600 to 0xB734B600
B7349600 0000A206 0100192C 00430D30 04010000  [....,...0.C.....]
......省略部分内容
B734B5F0 425F2345 4B434F4C 0AC10223 0D300601  [E#_BLOCK#.....0.]
Block header dump:  0x0100192c
Object id on Block  Y
seg/obj: 0xdd9b  csc: 0x00.430ce1  itc: 3  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x1001929 ver: 0x01 opc: 0
     inc: 0  exflg: 0

Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0xffff.000.00000000  0x00000000.0000.00  C---    0  scn 0x0000.00430ce1
0x02   0x000e.025.00000176  0x0240439e.015b.2f  ----    1  fsc 0x0017.00000000
0x03   0x0000.000.00000000  0x00000000.0000.00  ----    0  fsc 0x0000.00000000

data_block_dump,data header at 0xb734967c
===============
tsiz: 0x1f80
hsiz: 0x22
pbl: 0xb734967c
bdba: 0x0100192c
     76543210
flag=--------
ntab=1
nrow=8
frre=-1
fsbo=0x22
fseo=0x1eee
avsp=0x1ecc
tosp=0x1ee5
0xe:pti[0]      nrow=8  offs=0
0x12:pri[0]     offs=0x1f67
0x14:pri[1]     offs=0x1f4e
0x16:pri[2]     offs=0x1f3e
0x18:pri[3]     offs=0x1f2e
0x1a:pri[4]     offs=0x1f1f
0x1c:pri[5]     offs=0x1f10
0x1e:pri[6]     offs=0x1eff
0x20:pri[7]     offs=0x1eee
block_row_dump:

从上面block dump我们可以看到,有一个未提交事务:
0×02 0x000e.025.00000176 0x0240439e.015b.2f —- 1 fsc 0×0017.00000000

0×02: 表示第2个itl
0x000e.025.00000176 表示xid,xid的结构= 回滚段编号14+事务槽编号37+序号374
0x0240439e.015b.2f 表示UBA,uba的结构= undo block adress+Sequence + last enrty of undo block=(file 9 block 17310)+347+47

Flag 表示该事务的状态,事务状态有如下几种:

——undo segment header dump

TRN CTL:: seq: 0x015b chd: 0x000f ctl: 0x002d inc: 0x00000000 nfb: 0x0000
            mgc: 0x8201 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
            uba: 0x0240439e.015b.2f scn: 0x0000.00430671
Version: 0x01
  FREE BLOCK POOL::
    uba: 0x00000000.015b.2e ext: 0x27 spc: 0x542  
    uba: 0x00000000.015b.18 ext: 0x27 spc: 0x153e 
    uba: 0x00000000.0148.16 ext: 0x14 spc: 0xf62  
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
  TRN TBL::

  index  state cflags  wrap#    uel         scn            dba            parent-xid    nub     stmt_num    cmt
  ------------------------------------------------------------------------------------------------
   0x00    9    0x00  0x0177  0x0017  0x0000.00430978  0x02404391  0x0000.000.00000000  0x00000001   0x00000000  1343542242
   ...........
   0x24    9    0x00  0x0175  0x0028  0x0000.004306b5  0x0240438e  0x0000.000.00000000  0x00000001   0x00000000  1343541622
   0x25   10    0x80  0x0176  0x0027  0x0000.00430ce7  0x0240439e  0x0000.000.00000000  0x00000001   0x00000000  0
   0x26    9    0x00  0x0174  0x0003  0x0000.004306a3  0x0240438e  0x0000.000.00000000  0x00000001   0x00000000  1343541622
   ..........
   0x2f    9    0x00  0x0175  0x0016  0x0000.004306ff  0x0240438e  0x0000.000.00000000  0x00000001   0x00000000  1343541622


SQL>    select dbms_utility.data_block_address_file(TO_NUMBER('240439e', 'XXXXXXXX')) file_id,
  2     dbms_utility.data_block_address_block(TO_NUMBER('240439e', 'XXXXXXXX')) block_id from dual;

   FILE_ID   BLOCK_ID
---------- ----------
         9      17310

SQL>

0x25 --转换为10进制为37,也就是我们所看到的XIDSLOT值。

此时:

block scn :00430d30 --> 4394288
itl scn: 0x0017.00000000
undo segment scn(事务表上slot scn):0x0000.00430ce7  -->4394215

###### 提交该事务

SQL> commit;
Commit complete.

SQL>  SELECT xidusn,xidslot,xidsqn,ubablk,ubafil,ubarec FROM v$transaction;

no ROWS selected

再次dump DATA block和undo header block

SQL>  ALTER system dump datafile 4 block 6444;
System altered.

SQL> ALTER system dump undo header '_SYSSMU14$';
System altered.

此时trace信息如下:

*** 2012-07-28 23:52:22.995
Start dump data blocks tsn: 4 file#: 4 minblk 6444 maxblk 6444
buffer tsn: 4 rdba: 0x0100192c (4/6444)
scn: 0x0000.004310ae seq: 0x01 flg: 0x02 tail: 0x10ae0601
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0xB7349600 to 0xB734B600
......省略部分信息
Block header dump:  0x0100192c
Object id on Block  Y
seg/obj: 0xdd9b  csc: 0x00.430ce1  itc: 3  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x1001929 ver: 0x01 opc: 0
     inc: 0  exflg: 0

Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0xffff.000.00000000  0x00000000.0000.00  C---    0  scn 0x0000.00430ce1
0x02   0x000e.025.00000176  0x0240439e.015b.2f  --U-    1  fsc 0x0017.004310ae --该事务已经commit
0x03   0x0000.000.00000000  0x00000000.0000.00  ----    0  fsc 0x0000.00000000

data_block_dump,data header at 0xb734967c
===============
tsiz: 0x1f80
hsiz: 0x22
pbl: 0xb734967c
bdba: 0x0100192c
     76543210
flag=--------
ntab=1
nrow=8
frre=-1
fsbo=0x22
fseo=0x1eee
avsp=0x1ecc
tosp=0x1ee5
0xe:pti[0]      nrow=8  offs=0
0x12:pri[0]     offs=0x1f67
0x14:pri[1]     offs=0x1f4e
0x16:pri[2]     offs=0x1f3e
0x18:pri[3]     offs=0x1f2e
0x1a:pri[4]     offs=0x1f1f
0x1c:pri[5]     offs=0x1f10
0x1e:pri[6]     offs=0x1eff
0x20:pri[7]     offs=0x1eee
block_row_dump:
tab 0, row 0, @0x1f67
tl: 2 fb: --HDFL-- lb: 0x2   ---这是被delete的行
tab 0, row 1, @0x1f4e
tl: 25 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [ 3]  53 59 53
col  1: [14]  43 5f 46 49 4c 45 23 5f 42 4c 4f 43 4b 23
col  2: [ 2]  c1 09
tab 0, row 2, @0x1f3e
tl: 16 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [ 3]  53 59 53
col  1: [ 5]  49 5f 54 53 23
col  2: [ 2]  c1 08
.....省略部分信息
tl: 17 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [ 3]  53 59 53
col  1: [ 6]  43 5f 4f 42 4a 23
col  2: [ 2]  c1 03
end_of_block_dump
End dump data blocks tsn: 4 file#: 4 minblk 6444 maxblk 6444
—-undo segment header dump

TRN CTL:: seq: 0x015b chd: 0x000f ctl: 0x0025 inc: 0x00000000 nfb: 0x0001
            mgc: 0x8201 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
            uba: 0x0240439e.015b.2f scn: 0x0000.00430671
Version: 0x01
  FREE BLOCK POOL::
    uba: 0x0240439e.015b.2f ext: 0x27 spc: 0x494  
    uba: 0x00000000.015b.18 ext: 0x27 spc: 0x153e 
    uba: 0x00000000.0148.16 ext: 0x14 spc: 0xf62  
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
  TRN TBL::

  index  state cflags  wrap#    uel         scn            dba            parent-xid    nub     stmt_num    cmt
  ------------------------------------------------------------------------------------------------
   0x00    9    0x00  0x0177  0x0017  0x0000.00430978  0x02404391  0x0000.000.00000000  0x00000001   0x00000000  1343542242
  .........省略部分信息
   0x24    9    0x00  0x0175  0x0028  0x0000.004306b5  0x0240438e  0x0000.000.00000000  0x00000001   0x00000000  1343541622
   0x25    9    0x00  0x0176  0xffff  0x0000.004310ae  0x0240439e  0x0000.000.00000000  0x00000001   0x00000000  1343544689
   0x26    9    0x00  0x0174  0x0003  0x0000.004306a3  0x0240438e  0x0000.000.00000000  0x00000001   0x00000000  1343541622
  .........省略部分信息
   0x2f    9    0x00  0x0175  0x0016  0x0000.004306ff  0x0240438e  0x0000.000.00000000  0x00000001   0x00000000  1343541622

  可以看到,第25个事务已经提交了,state 9  表示非活动事务。

事务提交以后,此时的scn:

block scn: 004310ae –> 4395182
itl scn: 0×0017.004310ae –>4395182
undo segment scn(事务表上slot scn):0×0000.004310ae –>4395182

从上面的实验我们可以看出,当事务commit以后,oracle会更新如下3处SCN,且保证是一致的:

block scn,itl scn,undo segment header slot scn.

注意:
1. 上面的实验是针对fast commit cleanout的,我们知道block cleanout有2种方式,其中之一就是fast commit cleanout,另外一种是延迟块清除,也就是delayed block cleanout。

2. 如果发生延迟块清除,那么在事务commit以后,不会去更新block scn和block 内itl scn,而是仅仅更新undo segment header scn solt scn。

3. 针对block 里面scn和itl scn的更改,这里有涉及到slot重用的问题,这里有分为2种情况:
1)无slot重用时,发生延迟块清除,block内scn和itl scn是根据undo 段头事务表的信息来进行更新的。


2)当时发生slot重用时,block scn被更新为延迟块清除时刻的scn,block itl scn会更新为control scn。

##### 下面来看延迟块清除的情况

---为了模拟更容易,创建较小的undo tablespace
SQL> CREATE undo tablespace undotbs2 datafile
  2  '/home/ora10g/oradata/roger/undotb2_01.dbf' SIZE 1m;

Tablespace created.

SQL> ALTER system SET undo_tablespace=undotbs2;
System altered.

SQL> SELECT dbms_rowid.rowid_block_number(rowid),ora_rowscn,object_id FROM tab_undo;

DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) ORA_ROWSCN  OBJECT_ID
------------------------------------ ---------- ----------
                                6444    4395182          8
                                6444    4395182          7
                                6444    4395182          6
                                6444    4395182          5
                                6444    4395182          4
                                6444    4395182          3
                                6444    4395182          2

7 ROWS selected.

SQL> SELECT dbms_rowid.rowid_block_number(rowid),ora_rowscn,object_id FROM tab_undo;

DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) ORA_ROWSCN  OBJECT_ID
------------------------------------ ---------- ----------
                                6444    4395182          8
                                6444    4395182          7
                                6444    4395182          6
                                6444    4395182          5
                                6444    4395182          4
                                6444    4395182          3
                                6444    4395182          2

7 ROWS selected.

SQL> UPDATE tab_undo SET OBJECT_ID=100 WHERE object_id=8;
1 ROW updated.

SQL>  SELECT xidusn,xidslot,xidsqn,ubablk,ubafil,ubarec FROM v$transaction;

    XIDUSN    XIDSLOT     XIDSQN     UBABLK     UBAFIL     UBAREC
---------- ---------- ---------- ---------- ---------- ----------
        25          0          2         59          6          1

SQL> SELECT usn,name FROM v$rollname WHERE usn=25;

       USN NAME
---------- ------------------------------
        25 _SYSSMU25$

SQL> ALTER system FLUSH buffer_cache;
System altered.

----首先将cache buffer中的脏块全部写入到disk中,然后再commit。

SQL> SHOW USER
USER IS "ROGER"

SQL> ALTER system dump datafile 4 block 6444;
System altered.

SQL> ALTER system dump undo header '_SYSSMU25$';
System altered.

SQL> commit;
Commit complete.

SQL> SELECT timestamp_to_scn(systimestamp) FROM dual ;

TIMESTAMP_TO_SCN(SYSTIMESTAMP)
------------------------------
                       4398117
—–block dump

Start dump data blocks tsn: 4 file#: 4 minblk 6444 maxblk 6444
buffer tsn: 4 rdba: 0x0100192c (4/6444)
scn: 0x0000.00431bec seq: 0x01 flg: 0x00 tail: 0x1bec0601
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0xB7349600 to 0xB734B600
......省略部分信息
Block header dump:  0x0100192c
Object id on Block  Y
seg/obj: 0xdd9b  csc: 0x00.430ce1  itc: 3  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x1001929 ver: 0x01 opc: 0
     inc: 0  exflg: 0

Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0xffff.000.00000000  0x00000000.0000.00  C---    0  scn 0x0000.00430ce1
0x02   0x000e.025.00000176  0x0240439e.015b.2f  --U-    1  fsc 0x0017.004310ae
0x03   0x0019.000.00000002  0x0180003b.0000.01  ----    1  fsc 0x0000.00000000

data_block_dump,data header at 0xb734967c
===============
tsiz: 0x1f80
hsiz: 0x22
pbl: 0xb734967c
bdba: 0x0100192c
     76543210
flag=--------
ntab=1
nrow=8
frre=-1
fsbo=0x22
fseo=0x1eee
avsp=0x1ecc
tosp=0x1ee5
0xe:pti[0]      nrow=8  offs=0
0x12:pri[0]     offs=0x1f67
0x14:pri[1]     offs=0x1f4e
0x16:pri[2]     offs=0x1f3e
0x18:pri[3]     offs=0x1f2e
0x1a:pri[4]     offs=0x1f1f
0x1c:pri[5]     offs=0x1f10
0x1e:pri[6]     offs=0x1eff
0x20:pri[7]     offs=0x1eee
block_row_dump:
—-undo segment header dump

TRN CTL:: seq: 0x0000 chd: 0x0001 ctl: 0x002f inc: 0x00000000 nfb: 0x0000
            mgc: 0x8201 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
            uba: 0x0180003b.0000.01 scn: 0x0000.00000000
Version: 0x01
  FREE BLOCK POOL::
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
  TRN TBL::

  index  state cflags  wrap#    uel         scn            dba            parent-xid    nub     stmt_num    cmt
  ------------------------------------------------------------------------------------------------
   0x00   10    0x80  0x0002  0x0000  0x0000.00431b82  0x0180003b  0x0000.000.00000000  0x00000001   0x00000000  0
   0x01    9    0x00  0x0001  0x0002  0x0000.00000000  0x00000000  0x0000.000.00000000  0x00000000   0x00000000  0
  ......省略部分信息
   0x2f    9    0x00  0x0001  0xffff  0x0000.00000000  0x00000000  0x0000.000.00000000  0x00000000   0x00000000  0
下面用mos提供的一个脚本来进行slot重用实验,进而观察block scn,itl scn和undo scn的变化。

SQL> SHOW USER
USER IS "ROGER"
SQL> ALTER system dump datafile 4 block 6444;

System altered.

SQL> ALTER system dump undo header '_SYSSMU25$';

System altered.

SQL> commit;

Commit complete.

SQL> SELECT timestamp_to_scn(systimestamp) FROM dual ;

TIMESTAMP_TO_SCN(SYSTIMESTAMP)
------------------------------
                       4398117

SQL> SHOW USER
USER IS "SYS"                     
SQL> CREATE TABLE goon AS SELECT * FROM dba_objects WHERE 1 = 2;

TABLE created.

SQL> CREATE OR REPLACE PROCEDURE proc_go_break_reuse(v_XIDUSN  NUMBER,
  2                                                  v_XIDSLOT NUMBER,
  3                                                  v_XIDSQN  NUMBER)
  4  /* ————————————————–
  5    Create_user :Mecoyoo
  6    Time:2008-5-08
  7    Description:It’s used to make transaction slot reused
  8    —————————————————*/
  9   AS
10    nsid NUMBER;
11    TYPE transaction_record_type IS record(
12      XIDUSN  NUMBER,
13      XIDSLOT NUMBER,
14      XIDSQN  NUMBER);
15    transaction_record transaction_record_type;
16  BEGIN
17    SELECT sys_context('userenv','sid') INTO nsid FROM dual;
18    loop
19      INSERT INTO goon
20        SELECT * FROM dba_objects WHERE rownum < 100;
21      SELECT XIDUSN, XIDSLOT, XIDSQN
22        INTO transaction_record
23        FROM v$transaction a, v$session b
24       WHERE a.ADDR = b.TADDR
25         AND b.SID = nsid;
26      IF (transaction_record.XIDUSN = v_XIDUSN AND
27         transaction_record.XIDSLOT = v_XIDSLOT AND
28         transaction_record.XIDSQN > v_XIDSQN) THEN
29        GOTO resue_end;
30      END IF;
31      commit;
32      DELETE FROM goon;
33      SELECT XIDUSN, XIDSLOT, XIDSQN
34        INTO transaction_record
35        FROM v$transaction a, v$session b
36       WHERE a.ADDR = b.TADDR
37         AND b.SID = nsid;
38      IF (transaction_record.XIDUSN = v_XIDUSN AND
39         transaction_record.XIDSLOT = v_XIDSLOT AND
40         transaction_record.XIDSQN > v_XIDSQN) THEN
41        GOTO resue_end;
42      END IF;
43      commit;
44    END loop;
45    <<resue_end>>
46    commit;
47  END;
48  /

PROCEDURE created.

SQL>
SQL> SHOW USER
USER IS "SYS"
SQL> EXEC proc_go_break_reuse(25,0,2);

PL/SQL PROCEDURE successfully completed.

SQL> conn roger/roger
Connected.
SQL> col object_name FOR a20
SQL> SET LINES 150
SQL> SELECT * FROM tab_undo;

OWNER                          OBJECT_NAME           OBJECT_ID
------------------------------ -------------------- ----------
SYS                            C_FILE#_BLOCK#              100
SYS                            I_TS#                         7
SYS                            C_TS#                         6
SYS                            CLU$                          5
SYS                            TAB$                          4
SYS                            I_OBJ#                        3
SYS                            C_OBJ#                        2

7 ROWS selected.

SQL> SELECT timestamp_to_scn(systimestamp) FROM dual;

TIMESTAMP_TO_SCN(SYSTIMESTAMP)
------------------------------
                       4399930

SQL>
SQL> SELECT dbms_rowid.rowid_block_number(rowid),ora_rowscn,object_id FROM tab_undo;

DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) ORA_ROWSCN  OBJECT_ID
------------------------------------ ---------- ----------
                                6444    4398116        100
                                6444    4398116          7
                                6444    4398116          6
                                6444    4398116          5
                                6444    4398116          4
                                6444    4398116          3
                                6444    4398116          2

7 ROWS selected.

SQL>
SQL> ALTER system dump datafile 4 block 6444;

System altered.

SQL> ALTER system dump undo header '_SYSSMU25$';

System altered.
此时我们来dump data block和undo segment header

— data block dump

Start dump data blocks tsn: 4 file#: 4 minblk 6444 maxblk 6444
buffer tsn: 4 rdba: 0x0100192c (4/6444)
scn: 0x0000.00431c24 seq: 0x01 flg: 0x06 tail: 0x1c240601
frmt: 0x02 chkval: 0x065e type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
.....省略部分信息
Block header dump:  0x0100192c
Object id on Block  Y
seg/obj: 0xdd9b  csc: 0x00.430ce1  itc: 3  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x1001929 ver: 0x01 opc: 0
     inc: 0  exflg: 0

Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0xffff.000.00000000  0x00000000.0000.00  C---    0  scn 0x0000.00430ce1
0x02   0x000e.025.00000176  0x0240439e.015b.2f  --U-    1  fsc 0x0017.004310ae
0x03   0x0019.000.00000002  0x0180003b.0000.01  --U-    1  fsc 0x0000.00431c24 ---这里itl scn等于前面的block scn了

data_block_dump,data header at 0xd0d987c
===============
tsiz: 0x1f80
hsiz: 0x22
pbl: 0x0d0d987c
bdba: 0x0100192c
     76543210
flag=--------
ntab=1
nrow=8
frre=-1
fsbo=0x22
fseo=0x1eee
avsp=0x1ecc
tosp=0x1ee5
0xe:pti[0]      nrow=8  offs=0
0x12:pri[0]     offs=0x1f67
0x14:pri[1]     offs=0x1f4e
0x16:pri[2]     offs=0x1f3e
0x18:pri[3]     offs=0x1f2e
0x1a:pri[4]     offs=0x1f1f
0x1c:pri[5]     offs=0x1f10
0x1e:pri[6]     offs=0x1eff
0x20:pri[7]     offs=0x1eee
—–undo header dump

TRN CTL:: seq: 0x0008 chd: 0x0001 ctl: 0x0000 inc: 0x00000000 nfb: 0x0001
            mgc: 0x8201 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
            uba: 0x01800040.0008.1f scn: 0x0000.00431c24  ---等于block scn值
Version: 0x01
  FREE BLOCK POOL::
    uba: 0x01800040.0008.21 ext: 0x0  spc: 0x9f0  
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0    
  TRN TBL::

  index  state cflags  wrap#    uel         scn            dba            parent-xid    nub     stmt_num    cmt
  ------------------------------------------------------------------------------------------------
   0x00    9    0x00  0x0003  0xffff  0x0000.0043232c  0x01800040  0x0000.000.00000000  0x00000001   0x00000000  1343551357
   0x01    9    0x00  0x0002  0x0002  0x0000.00431c5e  0x0180003b  0x0000.000.00000000  0x00000001   0x00000000  1343550861
   0x02    9    0x00  0x0002  0x0003  0x0000.00431c6c  0x0180003b  0x0000.000.00000000  0x00000001   0x00000000  1343550861
  ......省略部分信息
   0x2f    9    0x00  0x0002  0x0000  0x0000.00432320  0x01800040  0x0000.000.00000000  0x00000001   0x00000000  1343551357

0043232c 转换为10进制为:  4399916
我们可以看到,此时undo control scn的值是等于block scn和block itl scn的,进而也验证了前面的观点。

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle undo control scn等于block scn和block itl scn

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/1367.html

Oracle研究中心

关键词:

undo control scn

block scn

block itl scn