oracle deep internal 1 (ver.2)

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

Upload: exem

Post on 16-Apr-2017

78 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Oracle Deep Internal 1 (ver.2)

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

Ver.2(2016.07.18)

Page 2: Oracle Deep Internal 1 (ver.2)

© Copyrights 2001~2016, EXEM CO.,LTD. All Rights Reserved.2011, Oracle Core Essential Internals for DBAs and Developers, Jonathan Lewis

It's so difficult to understand only through the book.I'd like to check internal actual situation of oracle

with my own eyes

"Undo" mechanism as explained in Jonathan Lewis's book

Page 3: Oracle Deep Internal 1 (ver.2)

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

2011, Oracle Core Essential Internals for DBAs and Developers, Jonathan Lewis

UPDATE Table A SET col1 = ‘B’

AA

Redolog

undo

DataFile

AB

A

B

Simple flow chart in oracle when processing Update statement

Page 4: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

v$transaction

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

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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’

* Rec #0x1

BH

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

Page 5: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

v$transaction

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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

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

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 41

UPDATE Table A

SET col1 = ‘B’

ASCII HEXA code 41=> Value ‘A’

(The preparation stage before update)

1_1. State in which generating CU Block into Buffer Cache by selecting one from DB block

Page 6: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

CR

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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

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

v$transactionBH‘a438’XCU block is copied to BH‘a1c8’XCU block

BH‘a438’block is changed from XCU to CR

0x643fa1c8

Undo Block

* Rec #0x1

BH

ASCII HEXA code 41=> Value ‘A’

copy XCU block

change from XCU to CR

0x643fa438

2. When executing Update statement, generates new CU block in Buffer Cache and changes from CU block to CR block

Page 7: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: CR md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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

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

V$transaction

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

0000000069B01FB0

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

For processing TX, Address is allocated in v$transaction data at the very first

Undo Block

* Rec #0x1

BH

ASCII HEXA code 41=> Value ‘A’

2_1. Address data is generated in v$transaction. (Allocating memory about Row Cache new tx)

Page 8: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

V$transaction

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

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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’

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

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: CR md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 410000000069B01FB0

7

After allocating address,

USN(Undo Segment Number) is

registered in v$transaction data

for the second time

Undo Segment

Number

3. Xid usn's value is allocated in v$transaction. (No. 7 usn in here)

Page 9: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

V$transaction

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

0000000069B01FB0

7Undo Segment Number

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: CR md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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’

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 slt: 0x00 objn: 70670 (0x0001140e) objd: Undo type: Regular undo Begin trans Last buffer split: Noncol: 2 nnew: 1 size: 0 Vector content: col 1: [ 1] 41

BH (0x643e4b50) file#: 6 rdba: 0x018000a2 (6/162) class: 30 ba: 0x64184000st: XCURRENT md: EXCL fpin: 'kcbwh2: kcbchg1' tch: 0

10 0x80 0x04ed 0x0000 0x0000.003dbe4d

Undo slot

active0x018000a2

Undo Block Address

Before image value ‘A’

4. In Undo segment, Slot value is changed from 9 to 10

Page 10: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

V$transaction

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

0000000069B01FB0

7Undo Segment Number

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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’

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 slt: 0x00 objn: 70670 (0x0001140e) objd: Undo type: Regular undo Begin trans Last buffer split: Noncol: 2 nnew: 1 size: 0 Vector content: col 1: [ 1] 41

BH (0x643e4b50) file#: 6 rdba: 0x018000a2 (6/162) class: 30 ba: 0x64184000st: XCURRENT md: EXCL fpin: 'kcbwh2: kcbchg1' tch: 0

Undo Block Address

Before image value ‘A’

10 0x80 0x04ed 0x0000 0x0000.003dbe4d 0x018000a2

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: CR md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41tl: 16 fb: --H-FL-- lb: 0x2 cc: 2

0x01 0x000a.000.00000534 0x018000d2.01e6.01 C--- 0 scn 0x0000.003dbe3a0x02 0x0007.000.000004ed 0x018000a2.01d5.01 ---- 1 fsc 0x0000.00000000

col 1: [ 1] 42

Update ‘A’ to ‘B’ of CU block

CleanOut: itl No.1 change (--U- C---)Txn data change: itl No.2 change (Xid,Uba)Lock Byte change: 0x1 0x2

Undo slot active

5. Update value A to B of XCU block in Buffer Cache

Page 11: Oracle Deep Internal 1 (ver.2)

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 slt: 0x00 objn: 70670 (0x0001140e) objd: Undo type: Regular undo Begin trans Last buffer split: Noncol: 2 nnew: 1 size: 0 Vector content: col 1: [ 1] 41

BH (0x643e4b50) file#: 6 rdba: 0x018000a2 (6/162) class: 30 ba: 0x64184000st: XCURRENT md: EXCL fpin: 'kcbwh2: kcbchg1' tch: 0

Undo Block Address

Before image value ‘A’

10 0x80 0x04ed 0x0000 0x0000.003dbe4d 0x018000a2

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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$transaction

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

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: CR md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 C--- 0 scn 0x0000.003dbe3a0x02 0x0007.000.000004ed 0x018000a2.01d5.01 ---- 1 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 42

7

0000000069B01FB0

1

1261

162

ACTIVE

6

469

Registered with the order as below in v$transaction.* addr ⟶ xidusn ⟶ xidslot, xidsqn, ubablk

Undo slot active

6. Allocate into other column except xid and uba in v$transaction

Page 12: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

V$transaction

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

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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’

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: CR md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 C--- 0 scn 0x0000.003dbe3a0x02 0x0007.000.000004ed 0x018000a2.01d5.01 ---- 1 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 42

--U- 1 fsc 0x0000.003dbe4e

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 slt: 0x00 objn: 70670 (0x0001140e) objd: Undo type: Regular undo Begin trans Last buffer split: Noncol: 2 nnew: 1 size: 0 Vector content: col 1: [ 1] 41

BH (0x643e4b50) file#: 6 rdba: 0x018000a2 (6/162) class: 30 ba: 0x64184000st: XCURRENT md: EXCL fpin: 'kcbwh2: kcbchg1' tch: 0

Undo Block Address

Before image value ‘A’

Undo slot active

10 0x80 0x04ed 0x0000 0x0000.003dbe4d 0x018000a2

Allocating equal scn to Itl slot and undo header slot

COMMIT ;

7. Commit execute (Allocating equal scn to Itl slot and undo header slot)

After commit, TX data is deleted in v$transaction

Page 13: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

V$transaction

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

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: CR md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 C--- 0 scn 0x0000.003dbe3a0x02 0x0007.000.000004ed 0x018000a2.01d5.01 ---- 1 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x2 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 42

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

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

tl: 16 fb: --H-FL-- lb: 0x2 cc: 2col 0: [10] 31 20 20 20 20 20 20 20 20 20col 1: [ 1] 42

0x01 0x000a.000.00000534 0x018000d2.01e6.01 C--- 0 scn 0x0000.003dbe3a0x02 0x0007.000.000004ed 0x018000a2.01d5.01 --U- 1 fsc 0x0000.003dbe4e

Value 'B' reflects 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 slt: 0x00 objn: 70670 (0x0001140e) objd: Undo type: Regular undo Begin trans Last buffer split: Noncol: 2 nnew: 1 size: 0 Vector content: col 1: [ 1] 41

BH (0x643e4b50) file#: 6 rdba: 0x018000a2 (6/162) class: 30 ba: 0x64184000st: XCURRENT md: EXCL fpin: 'kcbwh2: kcbchg1' tch: 0

Undo Block Address

Before image value ‘A’

Undo slot active

10 0x80 0x04ed 0x0000 0x018000a20x0000.003dbe4e

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 C--- 0 scn 0x0000.003dbe3a0x02 0x0007.000.000004ed 0x018000a2.01d5.01 --U- 1 fsc 0x0000.003dbe4etl: 16 fb: --H-FL-- lb: 0x2 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 42

Checkpoint ;

8. Executing Check point (CU block reflects disk block)

Page 14: Oracle Deep Internal 1 (ver.2)

SGA

Undo Segment

Shared Pool Buffer Cache

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

Data Block

BH (0x643fa438) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643ba000st: CR md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 --U- 1 fsc 0x0000.003dbe3a0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000tl: 16 fb: --H-FL-- lb: 0x1 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 41

BH (0x643fa1c8) file#: 5 rdba: 0x0140dcad (5/56493) class: 1 ba: 0x643b6000st: XCURRENT md: EXCL fpin: 'kdswh11: kdst_fetch' tch: 1Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 C--- 0 scn 0x0000.003dbe3a0x02 0x0007.000.000004ed 0x018000a2.01d5.01 --U- 1 fsc 0x0000.003dbe4etl: 16 fb: --H-FL-- lb: 0x2 cc: 2 col 0: [10] 31 20 20 20 20 20 20 20 20 20 col 1: [ 1] 42

V$transaction

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

ITL

Itl Xid Uba Flag Lck Scn/Fsc0x01 0x000a.000.00000534 0x018000d2.01e6.01 C--- 0 scn 0x0000.003dbe3a0x02 0x0007.000.000004ed 0x018000a2.01d5.01 --U- 1 fsc 0x0000.003dbe4e

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

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

0x00 10 0x80 0x04ed 0x0000 0x0000.003dbe4e 0x018000a20x01 9 0x00 0x04ec 0x0002 0x0000.003d6d72 0x00000000 0x02 9 0x00 0x04ec 0x0003 0x0000.003d6d72 0x00000000

Undo Block

* Rec #0x1 slt: 0x00 objn: 70670 (0x0001140e) objd: Undo type: Regular undo Begin trans Last buffer split: Noncol: 2 nnew: 1 size: 0 Vector content: col 1: [ 1] 41

BH (0x643e4b50) file#: 6 rdba: 0x018000a2 (6/162) class: 30 ba: 0x64184000st: XCURRENT md: EXCL fpin: 'kcbwh2: kcbchg1' tch: 0

Undo Block Address

Before image value ‘A’

Undo slot active

Summary : DML Operation in a Data Block

Page 15: Oracle Deep Internal 1 (ver.2)

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