SQL> DROP TABLE T1 PURGE;
SQL> CREATE TABLE T1( C1 INT, C2 VARCHAR2( 10 ) );
SQL> INSERT INTO T1 SELECT LEVEL, 'AAA' FROM DUAL CONNECT BY LEVEL < 4;
SQL> COMMIT;
SQL> SHOW PARAMETER USER
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
license_max_users integer 0
parallel_adaptive_multi_user boolean TRUE
user_dump_dest string /usr/local/oracle/admin/luxtv/
udump
SQL>
커밋이 완료되었습니다.
SQL> SELECT ROWID, DBMS_ROWID.ROWID_RELATIVE_FNO( ROWID ) AS RELATIVE_FNO
2 , DBMS_ROWID.ROWID_BLOCK_NUMBER( ROWID ) AS BLOCK_NUMBER
3 , C1
4 FROM T1;
ROWID RELATIVE_FNO BLOCK_NUMBER C1
------------------ ------------ ------------ ----------
AAApU+AAGAAABsnAAA 6 6951 1
AAApU+AAGAAABsnAAB 6 6951 2
AAApU+AAGAAABsnAAC 6 6951 3
SQL> DELETE FROM T1 WHERE C1 = 1;
1 행이 삭제되었습니다.
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 6951; --커밋 전 데이터 블록
시스템이 변경되었습니다.
SQL> SELECT SID FROM V$MYSTAT WHERE ROWNUM <= 1;
SID
----------
314
SQL> SELECT XIDUSN, XIDSLOT, XIDSQN
2 FROM V$TRANSACTION
3 WHERE ADDR = (SELECT TADDR FROM V$SESSION WHERE SID = 314 );
XIDUSN XIDSLOT XIDSQN
---------- ---------- ----------
10 29 52233
SQL> ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU10$'; --커밋 전 언두 헤더
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU10$' XID 10 29 52233; --커밋 전 언두 블럭
시스템이 변경되었습니다.
SQL> COMMIT;
커밋이 완료되었습니다.
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 6951; 커밋 후 데이터 블록
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU10$'; --커밋 후 언두 헤더
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU10$' XID 10 29 52233; --커밋 후 언두 블럭
시스템이 변경되었습니다.
--소문자는 다른 세션 2
SQL> select count(*) from t1;
COUNT(*)
----------
2
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 6951; -- 다른 세션에서 READ 후 데이터 블록
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU10$'; -- 다른 세션에서 READ 후 언두 헤더
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU10$' XID 10 29 52233; -- 다른 세션에서 READ 후 언두 블럭
시스템이 변경되었습니다.
SQL> DELETE FROM T1 WHERE C1 = 2;
1 행이 삭제되었습니다.
SQL> SELECT XIDUSN, XIDSLOT, XIDSQN
2 FROM V$TRANSACTION
3 WHERE ADDR = (SELECT TADDR FROM V$SESSION WHERE SID = 314 );
XIDUSN XIDSLOT XIDSQN
---------- ---------- ----------
3 20 50124
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 6951; -- DML 후 데이터 블록
SQL> ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU3$'; -- DML 후 언두 헤더
SQL> ALTER SYSTEM DUMP UNDO BLOCK '_SYSSMU3$' XID 3 20 50124; -- DML 후 언두 블럭
Start dump data blocks tsn: 7 file#: 6 minblk 6951 maxblk 6951
buffer tsn: 7 rdba: 0x01801b27 (6/6951)
scn: 0x0003.7d3a87ee seq: 0x03 flg: 0x02 tail: 0x87ee0603
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Block header dump: 0x01801b27
Object id on Block? Y
seg/obj: 0x2953e csc: 0x03.7d3a8800 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1801b21 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0007.020.0000d758 0x00800476.5916.21 C--- 0 scn 0x0003.7d3a87ee
0x02 0x000a.01d.0000cc09 0x00800382.509f.21 ---- 1 fsc 0x0008.00000000 <--
data_block_dump,data header at 0x1ae69a64
===============
tsiz: 0x1f98
hsiz: 0x18
pbl: 0x1ae69a64
bdba: 0x01801b27
76543210
flag=--------
ntab=1
nrow=3
frre=-1
fsbo=0x18
fseo=0x1f7a
avsp=0x1f62
tosp=0x1f6c
0xe:pti[0] nrow=3 offs=0
0x12:pri[0] offs=0x1f7a
0x14:pri[1] offs=0x1f84
0x16:pri[2] offs=0x1f8e
block_row_dump:
tab 0, row 0, @0x1f7a <--
tl: 2 fb: --HDFL-- lb: 0x2 <--
tab 0, row 1, @0x1f84
tl: 10 fb: --H-FL-- lb: 0x0 cc: 2
col 0: [ 2] c1 03
col 1: [ 3] 41 41 41
tab 0, row 2, @0x1f8e
tl: 10 fb: --H-FL-- lb: 0x0 cc: 2
col 0: [ 2] c1 04
col 1: [ 3] 41 41 41
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 6951 maxblk 6951
SELECT DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE (TO_NUMBER('00800382','XXXXXXXXX') ) FROM DUAL --상대 파일 번호
SELECT DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK (TO_NUMBER('00800382','XXXXXXXXX') ) FROM DUAL --블록 번호
********************************************************************************
Undo Segment: _SYSSMU10$ (10)
********************************************************************************
TRN TBL::
index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt
------------------------------------------------------------------------------------------------
...
0x1c 9 0x00 0xcc04 0x0000 0x0003.7d3a818b 0x00800380 0x0000.000.00000000 0x00000001 0x00000000 1331776328
0x1d 10 0x80 0xcc09 0x0002 0x0003.7d3a87ee 0x00800382 0x0000.000.00000000 0x00000001 0x00000000 0
0x1e 9 0x00 0xcc05 0x0028 0x0003.7d3a7f76 0x0080037f 0x0000.000.00000000 0x00000001 0x00000000 1331775331
...
*** 2012-03-15 11:28:30.284
********************************************************************************
Undo Segment: _SYSSMU10$ (10)
xid: 0x000a.01d.0000cc09
Low Blk : (0, 0)
High Blk : (2, 127)
Object Id : ALL
Layer : ALL
Opcode : ALL
Level : 2
********************************************************************************
UNDO BLK: Extent: 2 Block: 121 dba (file#, block#): 2,0x00000382 <--
xid: 0x000a.01d.0000cc09 seq: 0x509f cnt: 0x21 irb: 0x21 icl: 0x0 flg: 0x0000 <--
*-----------------------------
* Rec #0x21 slt: 0x1d objn: 169278(0x0002953e) objd: 169278 tblspc: 7(0x00000007) <--
* Layer: 11 (Row) opc: 1 rci 0x00 <--
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000 <--
*-----------------------------
********************************************************************************
Undo Segment: _SYSSMU10$ (10)
xid: 0x000a.01d.0000cc09
Low Blk : (0, 0)
High Blk : (2, 127)
Object Id : ALL
Layer : ALL
Opcode : ALL
Level : 2
********************************************************************************
UNDO BLK: Extent: 2 Block: 121 dba (file#, block#): 2,0x00000382 <--
xid: 0x000a.01d.0000cc09 seq: 0x509f cnt: 0x21 irb: 0x21 icl: 0x0 flg: 0x0000
*-----------------------------
* Rec #0x21 slt: 0x1d objn: 169278(0x0002953e) objd: 169278 tblspc: 7(0x00000007)
* Layer: 11 (Row) opc: 1 rci 0x00 <--
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000 <--
*-----------------------------
********************************************************************************
UNDO BLK: Extent: 2 Block: 121 dba (file#, block#): 2,0x00000383 <--
xid: 0x000a.01d.0000cc09 seq: 0x509f cnt: 0x21 irb: 0x21 icl: 0x0 flg: 0x0000
*-----------------------------
* Rec #0x21 slt: 0x1d objn: 169278(0x0002953e) objd: 169278 tblspc: 7(0x00000007)
* Layer: 11 (Row) opc: 1 rci 0x00 <--
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000382 <--
*-----------------------------
Start dump data blocks tsn: 7 file#: 6 minblk 6951 maxblk 6951
buffer tsn: 7 rdba: 0x01801b27 (6/6951)
scn: 0x0003.7d3a8b1f seq: 0x01 flg: 0x02 tail: 0x8b1f0601 <--
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Block header dump: 0x01801b27
Object id on Block? Y
seg/obj: 0x2953e csc: 0x03.7d3a8800 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1801b21 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0007.020.0000d758 0x00800476.5916.21 C--- 0 scn 0x0003.7d3a87ee -- 7d3a87ee == 2100987886
0x02 0x000a.01d.0000cc09 0x00800382.509f.21 --U- 1 fsc 0x0008.7d3a8b1f -- 7d3a8b1f == 7d3a8b1f
data_block_dump,data header at 0x1ae69a64
===============
tsiz: 0x1f98
hsiz: 0x18
pbl: 0x1ae69a64
bdba: 0x01801b27
76543210
flag=--------
ntab=1
nrow=3
frre=-1
fsbo=0x18
fseo=0x1f7a
avsp=0x1f62
tosp=0x1f6c
0xe:pti[0] nrow=3 offs=0
0x12:pri[0] offs=0x1f7a
0x14:pri[1] offs=0x1f84
0x16:pri[2] offs=0x1f8e
block_row_dump:
tab 0, row 0, @0x1f7a
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 1, @0x1f84
tl: 10 fb: --H-FL-- lb: 0x0 cc: 2
col 0: [ 2] c1 03
col 1: [ 3] 41 41 41
tab 0, row 2, @0x1f8e
tl: 10 fb: --H-FL-- lb: 0x0 cc: 2
col 0: [ 2] c1 04
col 1: [ 3] 41 41 41
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 6951 maxblk 6951
SELECT TO_NUMBER('7d3a87ee','XXXXXXXXX') FROM DUAL --2100987886
SELECT TO_NUMBER('7d3a8b1f','XXXXXXXXX') FROM DUAL --2100988703
********************************************************************************
Undo Segment: _SYSSMU10$ (10)
********************************************************************************
TRN TBL::
index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt
------------------------------------------------------------------------------------------------
...
0x1c 9 0x00 0xcc04 0x0000 0x0003.7d3a818b 0x00800380 0x0000.000.00000000 0x00000001 0x00000000 1331776328
0x1d 9 0x00 0xcc09 0xffff 0x0003.7d3a8b1f 0x00800382 0x0000.000.00000000 0x00000001 0x00000000 1331779629 <--
0x1e 9 0x00 0xcc05 0x0028 0x0003.7d3a7f76 0x0080037f 0x0000.000.00000000 0x00000001 0x00000000 1331775331
...
*** 2012-03-15 11:47:29.977
*******************************************************************************
Undo Segment: _SYSSMU10$ (10)
xid: 0x000a.01d.0000cc09
Low Blk : (0, 0)
High Blk : (2, 127)
Object Id : ALL
Layer : ALL
Opcode : ALL
Level : 2
+++++++++++ XID mismatch. Some records may not belong to specified transaction.
+ WARNING + Block xid: 0x000a.01b.0000cc05 dba (file#, block#): 2,0x00000382
+++++++++++ Input xid: 0x000a.01d.0000cc09
********************************************************************************
UNDO BLK: Extent: 2 Block: 121 dba (file#, block#): 2,0x00000382
xid: 0x000a.01b.0000cc05 seq: 0x509f cnt: 0x24 irb: 0x24 icl: 0x0 flg: 0x0000
*-----------------------------
* Rec #0x21 slt: 0x1d objn: 169278(0x0002953e) objd: 169278 tblspc: 7(0x00000007)
* Layer: 11 (Row) opc: 1 rci 0x00
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000
*-----------------------------
Start dump data blocks tsn: 7 file#: 6 minblk 6951 maxblk 6951
buffer tsn: 7 rdba: 0x01801b27 (6/6951)
scn: 0x0003.7d3a8b1f seq: 0x01 flg: 0x02 tail: 0x8b1f0601
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Block header dump: 0x01801b27
Object id on Block? Y
seg/obj: 0x2953e csc: 0x03.7d3a8800 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1801b21 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0007.020.0000d758 0x00800476.5916.21 C--- 0 scn 0x0003.7d3a87ee
0x02 0x000a.01d.0000cc09 0x00800382.509f.21 --U- 1 fsc 0x0008.7d3a8b1f
data_block_dump,data header at 0x1ae69a64
===============
tsiz: 0x1f98
hsiz: 0x18
pbl: 0x1ae69a64
bdba: 0x01801b27
76543210
flag=--------
ntab=1
nrow=3
frre=-1
fsbo=0x18
fseo=0x1f7a
avsp=0x1f62
tosp=0x1f6c
0xe:pti[0] nrow=3 offs=0
0x12:pri[0] offs=0x1f7a
0x14:pri[1] offs=0x1f84
0x16:pri[2] offs=0x1f8e
block_row_dump:
tab 0, row 0, @0x1f7a
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 1, @0x1f84
tl: 10 fb: --H-FL-- lb: 0x0 cc: 2
col 0: [ 2] c1 03
col 1: [ 3] 41 41 41
tab 0, row 2, @0x1f8e
tl: 10 fb: --H-FL-- lb: 0x0 cc: 2
col 0: [ 2] c1 04
col 1: [ 3] 41 41 41
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 6951 maxblk 6951
********************************************************************************
Undo Segment: _SYSSMU10$ (10)
********************************************************************************
TRN TBL::
index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt
------------------------------------------------------------------------------------------------
...
0x1c 9 0x00 0xcc04 0x0000 0x0003.7d3a818b 0x00800380 0x0000.000.00000000 0x00000001 0x00000000 1331776328
0x1d 9 0x00 0xcc09 0x0024 0x0003.7d3a8b1f 0x00800382 0x0000.000.00000000 0x00000001 0x00000000 1331779629 --
0x1e 9 0x00 0xcc06 0x0028 0x0003.7d3a8c88 0x00800388 0x0000.000.00000000 0x00000001 0x00000000 1331780315
...
*** 2012-03-15 12:03:57.204
********************************************************************************
Undo Segment: _SYSSMU10$ (10)
xid: 0x000a.01d.0000cc09
Low Blk : (0, 0)
High Blk : (2, 127)
Object Id : ALL
Layer : ALL
Opcode : ALL
Level : 2
+++++++++++ XID mismatch. Some records may not belong to specified transaction.
+ WARNING + Block xid: 0x000a.00a.0000cc02 dba (file#, block#): 2,0x00000382
+++++++++++ Input xid: 0x000a.01d.0000cc09
********************************************************************************
UNDO BLK: Extent: 2 Block: 121 dba (file#, block#): 2,0x00000382
xid: 0x000a.00a.0000cc02 seq: 0x509f cnt: 0x3d irb: 0x3d icl: 0x0 flg: 0x0000
*-----------------------------
* Rec #0x21 slt: 0x1d objn: 169278(0x0002953e) objd: 169278 tblspc: 7(0x00000007)
* Layer: 11 (Row) opc: 1 rci 0x00
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000
*-----------------------------
Start dump data blocks tsn: 7 file#: 6 minblk 6951 maxblk 6951
buffer tsn: 7 rdba: 0x01801b27 (6/6951)
scn: 0x0003.7d3a946b seq: 0x01 flg: 0x04 tail: 0x946b0601
frmt: 0x02 chkval: 0x8f4a type: 0x06=trans data
Block header dump: 0x01801b27
Object id on Block? Y
seg/obj: 0x2953e csc: 0x03.7d3a8800 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1801b21 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0003.014.0000c3cc 0x008005e0.5007.15 ---- 1 fsc 0x0008.00000000 <-- Full Cleanout : Fsc 비움 , Xid 변경됨 : 0x0007.020.0000d758( 이전 )
0x02 0x000a.01d.0000cc09 0x00800382.509f.21 --U- 1 fsc 0x0008.7d3a8b1f
data_block_dump,data header at 0x1ae69a64
===============
tsiz: 0x1f98
hsiz: 0x18
pbl: 0x1ae69a64
bdba: 0x01801b27
76543210
flag=--------
ntab=1
nrow=3
frre=-1
fsbo=0x18
fseo=0x1f70
avsp=0x1f62
tosp=0x1f76
0xe:pti[0] nrow=3 offs=0
0x12:pri[0] offs=0x1f7a
0x14:pri[1] offs=0x1f70
0x16:pri[2] offs=0x1f8e
block_row_dump:
tab 0, row 0, @0x1f7a
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 1, @0x1f70 <-- Full Cleanout
tl: 2 fb: --HDFL-- lb: 0x1 <-- Full Cleanout
tab 0, row 2, @0x1f8e
tl: 10 fb: --H-FL-- lb: 0x0 cc: 2
col 0: [ 2] c1 04
col 1: [ 3] 41 41 41
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 6951 maxblk 6951
********************************************************************************
Undo Segment: _SYSSMU3$ (3)
********************************************************************************
TRN TBL::
index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt
------------------------------------------------------------------------------------------------
...
0x13 9 0x00 0xc3cf 0x0027 0x0003.7d3a8f49 0x008005d6 0x0000.000.00000000 0x00000001 0x00000000 1331781029
0x14 10 0x80 0xc3cc 0x0002 0x0003.7d3a8b1f 0x008005e0 0x0000.000.00000000 0x00000001 0x00000000 0
0x15 9 0x00 0xc3d2 0x0011 0x0003.7d3a8e91 0x008005de 0x0000.000.00000000 0x00000001 0x00000000 1331780847
...
*** 2012-03-15 14:22:20.337
********************************************************************************
Undo Segment: _SYSSMU3$ (3)
xid: 0x0003.014.0000c3cc
Low Blk : (0, 0)
High Blk : (2, 127)
Object Id : ALL
Layer : ALL
Opcode : ALL
Level : 2
********************************************************************************
UNDO BLK: Extent: 2 Block: 87 dba (file#, block#): 2,0x000005e0
xid: 0x0003.014.0000c3cc seq: 0x5007 cnt: 0x15 irb: 0x15 icl: 0x0 flg: 0x0000
*-----------------------------
* Rec #0x15 slt: 0x14 objn: 169278(0x0002953e) objd: 169278 tblspc: 7(0x00000007)
* Layer: 11 (Row) opc: 1 rci 0x00
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
rdba: 0x00000000
*-----------------------------
SQL> SELECT US#, NAME, SCNBAS, SCNWRP, STATUS$ FROM SYS.UNDO$;
US# NAME SCNBAS SCNWRP STATUS$
---------- ------------------------------ ---------- ---------- ----------
0 SYSTEM 0 0 3
1 _SYSSMU1$ 1785762276 3 3
2 _SYSSMU2$ 1785762266 3 1
3 _SYSSMU3$ 1785762273 3 3
4 _SYSSMU4$ 1785762054 3 3
5 _SYSSMU5$ 1785762055 3 3
6 _SYSSMU6$ 1785762272 3 3
7 _SYSSMU7$ 1785762274 3 3
8 _SYSSMU8$ 1785762275 3 3
9 _SYSSMU9$ 1785762270 3 3
10 _SYSSMU10$ 1785762271 3 3
SQL> DROP TABLE T2 PURGE;
SQL> CREATE TABLE T2( C1 NUMBER, C2 VARCHAR2( 10 ) );
SQL> INSERT INTO T2 SELECT LEVEL, 'C2' FROM DUAL CONNECT BY LEVEL <= 1000;
SQL> SELECT RELATIVE_FNO, BLOCK_NUMBER, COUNT(*) CNT
2 FROM (
3 SELECT ROWID, DBMS_ROWID.ROWID_RELATIVE_FNO( ROWID ) AS RELATIVE_FNO
4 , DBMS_ROWID.ROWID_BLOCK_NUMBER( ROWID ) AS BLOCK_NUMBER
5 , C1
6 FROM T2
7 )
8 GROUP BY RELATIVE_FNO, BLOCK_NUMBER;
RELATIVE_FNO BLOCK_NUMBER CNT
------------ ------------ ----------
6 6959 614
6 6960 386
SQL> SELECT SID FROM V$MYSTAT WHERE ROWNUM <= 1;
SID
----------
314
SQL> SELECT XIDUSN, XIDSLOT, XIDSQN
2 FROM V$TRANSACTION
3 WHERE ADDR = (SELECT TADDR FROM V$SESSION WHERE SID = 314 );
XIDUSN XIDSLOT XIDSQN
---------- ---------- ----------
2 30 52837 <-- 같은 언두를 사용해야하는데 음...
SQL> COMMIT;
커밋이 완료되었습니다.
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 6960;
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU2$';
시스템이 변경되었습니다.
SQL> SELECT RELATIVE_FNO, BLOCK_NUMBER, COUNT(*) CNT
2 FROM (
3 SELECT ROWID, DBMS_ROWID.ROWID_RELATIVE_FNO( ROWID ) AS RELATIVE_FNO
4 , DBMS_ROWID.ROWID_BLOCK_NUMBER( ROWID ) AS BLOCK_NUMBER
5 , C1
6 FROM T2
7 )
8 GROUP BY RELATIVE_FNO, BLOCK_NUMBER;
RELATIVE_FNO BLOCK_NUMBER CNT
------------ ------------ ----------
6 6959 614
6 6960 386
SQL> DELETE FROM T2;
1000 행이 삭제되었습니다.
SQL> SELECT SID FROM V$MYSTAT WHERE ROWNUM <= 1;
SID
----------
297
SQL> SELECT XIDUSN, XIDSLOT, XIDSQN
2 FROM V$TRANSACTION
3 WHERE ADDR = (SELECT TADDR FROM V$SESSION WHERE SID = 297 );
XIDUSN XIDSLOT XIDSQN
---------- ---------- ----------
4 13 59703
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 6960; --커밋 전 데이터 블록 덤프
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU4$'; --커밋 전 언두 헤더
시스템이 변경되었습니다.
SQL> ALTER SYSTEM FLUSH BUFFER_CACHE;
시스템이 변경되었습니다.
SQL> COMMIT;
커밋이 완료되었습니다.
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 6960; -- Buffer Flush, COMMIT 후 데이터 블록 덤프
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU4$'; -- Buffer Flush, COMMIT 후 언두 헤더
시스템이 변경되었습니다.
SQL> select count(*) from t2; --다른 세션에서 실행
COUNT(*)
----------
0
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 6960; -- READ 후 데이터 블록 덤프
시스템이 변경되었습니다.
SQL> ALTER SYSTEM DUMP UNDO HEADER '_SYSSMU4$'; -- READ 후 언두 헤더
시스템이 변경되었습니다.
Start dump data blocks tsn: 7 file#: 6 minblk 6960 maxblk 6960
buffer tsn: 7 rdba: 0x01801b30 (6/6960)
scn: 0x0003.7d3b7844 seq: 0x01 flg: 0x02 tail: 0x78440601
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Block header dump: 0x01801b30
Object id on Block? Y
seg/obj: 0x29591 csc: 0x03.7d3b782b itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1801b29 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0002.01e.0000ce65 0x0080020f.50e4.1d --U- 386 fsc 0x0000.7d3b7844
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
data_block_dump,data header at 0x175faa64
===============
tsiz: 0x1f98
hsiz: 0x316
pbl: 0x175faa64
bdba: 0x01801b30
76543210
flag=--------
ntab=1
nrow=386
frre=-1
fsbo=0x316
fseo=0x1088
avsp=0xd72
tosp=0xd72
0xe:pti[0] nrow=386 offs=0
0x12:pri[0] offs=0x19b3
0x14:pri[1] offs=0x19bd
0x16:pri[2] offs=0x19c7
...
block_row_dump:
tab 0, row 0, @0x19b3
tl: 10 fb: --H-FL-- lb: 0x1 cc: 2
col 0: [ 3] c2 07 10
col 1: [ 2] 43 32
tab 0, row 1, @0x19bd
tl: 10 fb: --H-FL-- lb: 0x1 cc: 2
col 0: [ 3] c2 07 11
col 1: [ 2] 43 32
tab 0, row 2, @0x19c7
tl: 10 fb: --H-FL-- lb: 0x1 cc: 2
col 0: [ 3] c2 07 12
col 1: [ 2] 43 32
tab 0, row 3, @0x19d1
...
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 6960 maxblk 6960
********************************************************************************
Undo Segment: _SYSSMU2$ (2)
********************************************************************************
TRN CTL:: seq: 0x50e4 chd: 0x0005 ctl: 0x001e inc: 0x00000000 nfb: 0x0002
mgc: 0x8201 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
uba: 0x0080020f.50e4.19 scn: 0x0003.7d3b71e5
TRN TBL::
index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt
------------------------------------------------------------------------------------------------
...
0x0c 9 0x00 0xce5c 0x0013 0x0003.7d3b7717 0x0080020f 0x0000.000.00000000 0x00000001 0x00000000 1331870401
0x0d 9 0x00 0xce42 0x000c 0x0003.7d3b7713 0x0080020f 0x0000.000.00000000 0x00000001 0x00000000 1331870401
0x0e 9 0x00 0xce5e 0x0002 0x0003.7d3b73b4 0x0080020c 0x0000.000.00000000 0x00000001 0x00000000 1331869097
...
Start dump data blocks tsn: 7 file#: 6 minblk 6960 maxblk 6960
buffer tsn: 7 rdba: 0x01801b30 (6/6960)
scn: 0x0003.7d3b787e seq: 0x20 flg: 0x00 tail: 0x787e0620
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Block header dump: 0x01801b30
Object id on Block? Y
seg/obj: 0x29591 csc: 0x03.7d3b7879 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1801b29 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0002.01e.0000ce65 0x0080020f.50e4.1d C--- 0 scn 0x0003.7d3b7844
0x02 0x0004.00d.0000e937 0x008006bc.555d.20 ---- 386 fsc 0x0c0c.00000000
data_block_dump,data header at 0x6e76a64
===============
tsiz: 0x1f98
hsiz: 0x316
pbl: 0x06e76a64
bdba: 0x01801b30
76543210
flag=--------
ntab=1
nrow=386
frre=-1
fsbo=0x316
fseo=0x1088
avsp=0xd72
tosp=0x1c82
0xe:pti[0] nrow=386 offs=0
0x12:pri[0] offs=0x19b3
0x14:pri[1] offs=0x19bd
0x16:pri[2] offs=0x19c7
...
block_row_dump:
tab 0, row 0, @0x19b3
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 1, @0x19bd
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 2, @0x19c7
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 3, @0x19d1
...
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 6960 maxblk 6960
********************************************************************************
Undo Segment: _SYSSMU4$ (4) -- 만약 언두 헤더가 2이라면
********************************************************************************
TRN CTL:: seq: 0x555d chd: 0x0000 ctl: 0x0028 inc: 0x00000000 nfb: 0x0002
mgc: 0x8201 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
uba: 0x008006ac.555d.16 scn: 0x0003.7d3b741d <-- 트랜잭션 슬롯 재사용으로 클린아웃을 위해 왼쪽 scn이 0x0003.7d3b7713 게 변경된다구 함
TRN TBL::
index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt
------------------------------------------------------------------------------------------------
...
0x0c 9 0x00 0xe939 0x0012 0x0003.7d3b7728 0x008006a9 0x0000.000.00000000 0x00000001 0x00000000 1331870402
0x0d 10 0x80 0xe937 0x0002 0x0003.7d3b77ee 0x008006bc 0x0000.000.00000000 0x0000000f 0x00000000 0
0x0e 9 0x00 0xe947 0x0004 0x0003.7d3b77d9 0x008006ac 0x0000.000.00000000 0x00000001 0x00000000 1331870531
Start dump data blocks tsn: 7 file#: 6 minblk 6960 maxblk 6960
buffer tsn: 7 rdba: 0x01801b30 (6/6960)
scn: 0x0003.7d3b787e seq: 0x20 flg: 0x04 tail: 0x787e0620
frmt: 0x02 chkval: 0xd8d5 type: 0x06=trans data
Block header dump: 0x01801b30
Object id on Block? Y
seg/obj: 0x29591 csc: 0x03.7d3b7879 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1801b29 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0002.01e.0000ce65 0x0080020f.50e4.1d C--- 0 scn 0x0003.7d3b7844
0x02 0x0004.00d.0000e937 0x008006bc.555d.20 ---- 386 fsc 0x0c0c.00000000
data_block_dump,data header at 0x6e76a64
===============
tsiz: 0x1f98
hsiz: 0x316
pbl: 0x06e76a64
bdba: 0x01801b30
76543210
flag=--------
ntab=1
nrow=386
frre=-1
fsbo=0x316
fseo=0x1088
avsp=0xd72
tosp=0x1c82
0xe:pti[0] nrow=386 offs=0
0x12:pri[0] offs=0x19b3
0x14:pri[1] offs=0x19bd
0x16:pri[2] offs=0x19c7
...
block_row_dump:
tab 0, row 0, @0x19b3
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 1, @0x19bd
tl: 2 fb: --HDFL-- lb: 0x2
tab 0, row 2, @0x19c7
tl: 2 fb: --HDFL-- lb: 0x2
...
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 6960 maxblk 6960
********************************************************************************
Undo Segment: _SYSSMU4$ (4)
********************************************************************************
TRN CTL:: seq: 0x555d chd: 0x0000 ctl: 0x000d inc: 0x00000000 nfb: 0x0003
mgc: 0x8201 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
uba: 0x008006ac.555d.16 scn: 0x0003.7d3b741d
TRN TBL::
index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt
------------------------------------------------------------------------------------------------
...
0x0c 9 0x00 0xe939 0x0012 0x0003.7d3b7728 0x008006a9 0x0000.000.00000000 0x00000001 0x00000000 1331870402
0x0d 9 0x00 0xe937 0xffff 0x0003.7d3b78ac 0x008006bc 0x0000.000.00000000 0x0000000f 0x00000000 1331870824
0x0e 9 0x00 0xe947 0x0004 0x0003.7d3b77d9 0x008006ac 0x0000.000.00000000 0x00000001 0x00000000 1331870531
Start dump data blocks tsn: 7 file#: 6 minblk 6960 maxblk 6960
buffer tsn: 7 rdba: 0x01801b30 (6/6960)
scn: 0x0003.7d3b78c1 seq: 0x01 flg: 0x00 tail: 0x78c10601
frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Block header dump: 0x01801b30
Object id on Block? Y
seg/obj: 0x29591 csc: 0x03.7d3b78c1 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1801b29 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0002.01e.0000ce65 0x0080020f.50e4.1d C--- 0 scn 0x0003.7d3b7844
0x02 0x0004.00d.0000e937 0x008006bc.555d.20 C--- 0 scn 0x0003.7d3b78ac
data_block_dump,data header at 0x6e76a64
===============
tsiz: 0x1f98
hsiz: 0x316
pbl: 0x06e76a64
bdba: 0x01801b30
76543210
flag=--------
ntab=1
nrow=386
frre=0
fsbo=0x316
fseo=0x1088
avsp=0x1c82
tosp=0x1c82
0xe:pti[0] nrow=386 offs=0
0x12:pri[0] sfll=1
0x14:pri[1] sfll=2
0x16:pri[2] sfll=3
...
block_row_dump:
end_of_block_dump
End dump data blocks tsn: 7 file#: 6 minblk 6960 maxblk 6960
``
********************************************************************************
Undo Segment: _SYSSMU4$ (4)
********************************************************************************
TRN CTL:: seq: 0x555d chd: 0x0000 ctl: 0x000d inc: 0x00000000 nfb: 0x0003
mgc: 0x8201 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
uba: 0x008006ac.555d.16 scn: 0x0003.7d3b741d
TRN TBL::
index state cflags wrap# uel scn dba parent-xid nub stmt_num cmt
------------------------------------------------------------------------------------------------
...
0x0c 9 0x00 0xe939 0x0012 0x0003.7d3b7728 0x008006a9 0x0000.000.00000000 0x00000001 0x00000000 1331870402
0x0d 9 0x00 0xe937 0xffff 0x0003.7d3b78ac 0x008006bc 0x0000.000.00000000 0x0000000f 0x00000000 1331870824
0x0e 9 0x00 0xe947 0x0004 0x0003.7d3b77d9 0x008006ac 0x0000.000.00000000 0x00000001 0x00000000 1331870531
...
- 강좌 URL : http://www.gurubee.net/lecture/3072
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.