oracle deep internal 2 (ver.2)

9
© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved. Ver.2 (2016.07.19)

Upload: exem

Post on 13-Apr-2017

79 views

Category:

Technology


5 download

TRANSCRIPT

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.

Ver.2 (2016.07.19)

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.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

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.

Data Block

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

ITL

Itl 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

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

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

ASCII HEXA code 41=> Value ‘A’

SGA Undo Segment

Shared Pool

Buffer Cache

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.

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

1. UPDATE T1 SET C2='B'

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: 1Itl 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: 1Itl 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

Uba+seq+record#

After ImageASCII HEXA code 42=> Value ‘B’

Before ImageASCII HEXA code 41=> Value ‘A’

Before ImageASCII HEXA code 41=> Value ‘A’

UPDATE T1

SET c2 = ‘B’

SGA Undo Segment

Shared Pool

Buffer Cache

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.

2. UPDATE T1 SET C2=‘C'

BH (0x643f8e48) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x64396000st: XCURRENT md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1Itl 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: 1Itl 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: 1Itl 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

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

After ImageASCII HEXA code 43=> Value ‘C’

After ImageASCII HEXA code 42=> Value ‘B’

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*-----------------------------* 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

Before ImageASCII HEXA code 41=> Value ‘A’

Before ImageASCII HEXA code 42=> Value ‘B’

UPDATE T1

SET c2 = ‘C’

SGA Undo Segment

Shared Pool

Buffer Cache

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.

3. UPDATE T1 SET C2=‘D'

BH (0x643f8968) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x6438e000st: XCURRENT md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1Itl 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: 1Itl 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: 1Itl 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: 1Itl 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

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

After ImageASCII HEXA code 44=> Value ‘D’

After ImageASCII HEXA code 43=> Value ‘C’

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* 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 = 11 col 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

Before ImageASCII HEXA code 43=> Value ‘C’

UPDATE T1

SET c2 = ‘D’

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.

4. Summary

SGA Undo Segment

Shared Pool

Buffer Cache

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.

Data Block

4. Summary

BH (0x643f8968) file#: 5 rdba: 0x0140dcab (5/56491) class: 1 ba: 0x6438e000st: XCURRENT md: NULL fpin: 'kdswh11: kdst_fetch' tch: 1Itl 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: 1Itl 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: 1Itl 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: 1Itl 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

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

After ImageASCII HEXA code 44=> Value ‘D’

After ImageASCII HEXA code 43=> Value ‘C’

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* 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 = 11 col 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

After ImageASCII HEXA code 43=> Value ‘C’

op: C uba: 0x018000d2.0214.02

op: C uba: 0x018000d2.0214.01

op: ZRec #0x1

Rec #0x2

Rec #0x3

Oracle Deep Internal

Blog

Video

E-mail

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

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

Wordpress https://playexem.wordpress.com/

Slideshare http://www.slideshare.net/playexem

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

Research & Contents Team Sook jin, [email protected]

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