[odi] chapter2 what is "undo record chaining"?

9
Oracle Deep Internal report no. 002 What is “Undo record chaining”? Research & Contents Team

Upload: exem

Post on 16-Apr-2017

82 views

Category:

Technology


1 download

TRANSCRIPT

  • Oracle Deep Internal report no. 002

    What is Undo record chaining?

    Research & Contents Team

  • Undo record chaining ?02

    Lee Kun Oh ()

    Kwon Kon Woo ()

  • Cited from http://wiki.gurubee.net/display/STUDY/1st_Undo

    "Undo record chain" mechanism as explained in Gurubee site

    It's so difficult to understand only through

    the book.I'd like to check internal actual situation of oracle

    with my own eyes

  • SGA Undo Segment

    Shared Pool

    Buffer Cache

    Undo Headerindex state cflags wrap# uel scn dba--------------------------------------------------------------------------------

    0x00 9 0x00 0x04ec 0x0001 0x0000.003d6d72 0x00000000 0x01 9 0x00 0x04ec 0x0002 0x0000.003d6d72 0x00000000 0x02 9 0x00 0x04ec 0x0003 0x0000.003d6d72 0x00000000

    Undo Block

    * Rec #0x1

    BH

    Data Block

    ITLItl Xid Uba Flag Lck Scn/Fsc

    Rowsblock_row_dump:tab 0, row 0, @0x1f88tl: 16 fb: --H-FL-- lb: 0x1 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 41

    ASCII HEXA code 41=> Value A

    V$transactionXID_INFO UBA_INFO TXN_INFO-------------------------- --------------- --------------------addr : status : IDLExidusn : ubafil : start_date : 2015-12-10 10:52:46xidslot : ubablk : ses_addr : 000000006B21CC20xidsqn : ubasqn :

    0. Initial state when a value of "A" is entered (The first stage before update)

  • SGA Undo Segment

    Shared Pool

    Buffer Cache

    1. UPDATE T1 SET C2='B'

    v$transactionXID_INFO UBA_INFO TXN_INFO-------------------------- --------------- --------------------------------

    addr : 0000000069B24E78 ubafil : 6 status : ACTIVExidusn : 10 ubablk : 210 start_date : 2016-01-13 18:57:04xidslot : 0 ubasqn : 532 ses_addr : 000000006B21CC20xidsqn : 1424 ubarec : 1

    Undo Headerindex state cflags wrap# uel scn dba----------------------------------------------------------------0x00 10 0x80 0x0590 0x0000 0x0000.004c2039 0x018000d2 0x01 9 0x00 0x058f 0x0002 0x0000.004bca7f 0x00000000

    Undo BlockBH (0x643fb068) file#: 6 rdba: 0x018000d2 (6/210) class: 36 ba: 0x643ce000xid: 0x000a.000.00000590 seq: 0x214 cnt: 0x1 irb: 0x1 icl: 0x0 flg: 0x0000Rec Offset Rec Offset Rec Offset Rec Offset Rec Offset

    ---------------------------------------------------------------------------0x01 0x1f44*-----------------------------* Rec #0x1 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x00op: Zitli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 41

    BH (0x643fb1a0) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x643d0000st: XCURRENT md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.01 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 42

    BH (0x643fb2d8) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x643d2000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x0 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 41

    Before ImageASCII HEXA code 41=> Value A

    Before ImageASCII HEXA code 41=> Value A

    After ImageASCII HEXA code 43=> Value C

    Uba+seq+record#UPDATE T1 SET c2 = B

  • SGA Undo Segment

    Shared Pool

    Buffer Cache

    2. UPDATE T1 SET C2=C'

    v$transactionXID_INFO UBA_INFO TXN_INFO-------------------------- --------------- --------------------------------addr : 0000000069B24E78 ubafil : 6 status : ACTIVExidusn : 10 ubablk : 210 start_date : 2016-01-13 18:57:04xidslot : 0 ubasqn : 532 ses_addr : 000000006B21CC20xidsqn : 1424 ubarec : 2

    Undo Headerindex state cflags wrap# uel scn dba----------------------------------------------------------------0x00 10 0x80 0x0590 0x0000 0x0000.004c2039 0x018000d20x01 9 0x00 0x058f 0x0002 0x0000.004bca7f 0x00000000

    Undo BlockBH (0x643fb068) file#: 6 rdba: 0x018000d2 (6/210) class: 36 ba: 0x643ce000xid: 0x000a.000.00000590 seq: 0x214 cnt: 0x2 irb: 0x2 icl: 0x0 flg: 0x0000Rec Offset Rec Offset Rec Offset Rec Offset Rec Offset

    ---------------------------------------------------------------------------0x01 0x1f44 0x02 0x1ecc*-----------------------------* Rec #0x1 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x00op: Zitli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 41*-----------------------------* Rec #0x2 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x01op: C uba: 0x018000d2.0214.01itli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 42

    BH (0x643f8e48) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x64396000st: XCURRENT md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.02 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 43

    BH (0x643fb2d8) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x643d2000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x0 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 41

    BH (0x643fb1a0) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x643d0000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.01 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 42

    After ImageASCII HEXA code 43=> Value C

    Before ImageASCII HEXA code 42=> Value B

    Before ImageASCII HEXA code 42=> Value B

    Before ImageASCII HEXA code 41=> Value A

    UPDATE T1 SET c2 = C

  • SGA Undo Segment

    Shared Pool

    Buffer Cache

    3. UPDATE T1 SET C2=D'

    v$transactionXID_INFO UBA_INFO TXN_INFO-------------------------- --------------- --------------------------------addr : 0000000069B24E78 ubafil : 6 status : ACTIVExidusn : 10 ubablk : 210 start_date : 2016-01-13 18:57:04xidslot : 0 ubasqn : 532 ses_addr : 000000006B21CC20xidsqn : 1424 ubarec : 3

    Undo Headerindex state cflags wrap# uel scn dba----------------------------------------------------------------0x00 10 0x80 0x0590 0x0000 0x0000.004c2039 0x018000d2 0x01 9 0x00 0x058f 0x0002 0x0000.004bca7f 0x00000000

    Undo BlockBH (0x643fb068) file#: 6 rdba: 0x018000d2 (6/210) class: 36 ba: 0x643ce000xid: 0x000a.000.00000590 seq: 0x214 cnt: 0x3 irb: 0x3 icl: 0x0 flg: 0x0000Rec Offset Rec Offset Rec Offset Rec Offset Rec Offset

    ---------------------------------------------------------------------------0x01 0x1f44 0x02 0x1ecc 0x03 0x1e54*-----------------------------* Rec #0x1 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x00op: Zitli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 41*-----------------------------* Rec #0x2 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x01op: C uba: 0x018000d2.0214.01itli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 42*-----------------------------* Rec #0x3 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x02op: C uba: 0x018000d2.0214.02itli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 43

    BH (0x643f8968) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x6438e000st: XCURRENT md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.03 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 44

    BH (0x643fb2d8) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x643d2000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x0 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 41

    BH (0x643fb1a0) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x643d0000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.01 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 42

    BH (0x643f8e48) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x64396000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.02 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 43

    Before ImageASCII HEXA code 43=> Value C

    After ImageASCII HEXA code 44=> Value D

    Before ImageASCII HEXA code 43=> Value C

    Before ImageASCII HEXA code 42=> Value B

    Before ImageASCII HEXA code 41=> Value A

    UPDATE T1 SET c2 = D

  • SGA Undo Segment

    Shared Pool

    Buffer Cache

    4. Summary

    v$transactionXID_INFO UBA_INFO TXN_INFO-------------------------- --------------- --------------------------------addr : 0000000069B24E78 ubafil : 6 status : ACTIVExidusn : 10 ubablk : 210 start_date : 2016-01-13 18:57:04xidslot : 0 ubasqn : 532 ses_addr : 000000006B21CC20xidsqn : 1424 ubarec : 3

    Undo Headerindex state cflags wrap# uel scn dba----------------------------------------------------------------0x00 10 0x80 0x0590 0x0000 0x0000.004c2039 0x018000d2 0x01 9 0x00 0x058f 0x0002 0x0000.004bca7f 0x00000000

    Undo BlockBH (0x643fb068) file#: 6 rdba: 0x018000d2 (6/210) class: 36 ba: 0x643ce000xid: 0x000a.000.00000590 seq: 0x214 cnt: 0x3 irb: 0x3 icl: 0x0 flg: 0x0000Rec Offset Rec Offset Rec Offset Rec Offset Rec Offset

    ---------------------------------------------------------------------------0x01 0x1f44 0x02 0x1ecc 0x03 0x1e54*-----------------------------* Rec #0x1 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x00op: Zitli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 41*-----------------------------* Rec #0x2 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x01op: C uba: 0x018000d2.0214.01itli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 42*-----------------------------* Rec #0x3 slt: 0x00 objn: 70870(0x000114d6) objd: 70870 tblspc: 5(0x00000005)* Layer: 11 (Row) opc: 1 rci 0x02op: C uba: 0x018000d2.0214.02itli: 2 ispac: 0 maxfr: 4858vect = 11col 1: [ 1] 43

    BH (0x643f8968) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x6438e000st: XCURRENT md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.03 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 44

    BH (0x643fb2d8) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x643d2000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x0 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 41

    BH (0x643fb1a0) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x643d0000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.01 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 42

    BH (0x643f8e48) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x64396000st: CR md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1

    Itl Xid Uba Flag Lck Scn/Fsc0x01 0x0006.000.0000056a 0x00000000.0000.00 C--- 0 scn 0x0000.004c20270x02 0x000a.000.00000590 0x018000d2.0214.02 ---- 1 fsc 0x0000.000000000x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 43

    Before ImageASCII HEXA code 43=> Value C

    After ImageASCII HEXA code 44=> Value D

    Before ImageASCII HEXA code 43=> Value C

    Before ImageASCII HEXA code 42=> Value B

    Before ImageASCII HEXA code 41=> Value A op: C uba: 0x018000d2.0214.02

    op: C uba: 0x018000d2.0214.01

    op: ZRec #0x1

    Rec #0x2

    Rec #0x3

  • Oracle Deep Internal

    More information https://youtu.be/c7EmzCd7buk

    Blog

    Video

    E-mail

    NAVER http://cafe.naver.com/playexem

    ITPUB http://blog.itpub.net/31135309/

    Wordpress https://playexem.wordpress.com/

    Youtube https://www.youtube.com/channel/UC5wKR_-A0eL_Pn_EMzoauJg

    [email protected]

    [email protected]

    For more information, or to schedule an on-site education, contact via blog or e-mail

    Kon Woo, Kwon Kun Oh, Lee

    Sook jin, Kim Dae Deok, Lee

    https://youtu.be/c7EmzCd7bukhttp://cafe.naver.com/playexemhttp://blog.itpub.net/31135309/https://playexem.wordpress.com/https://www.youtube.com/channel/UC5wKR_-A0eL_Pn_EMzoauJg