Redo內部解析-Single Row Delete (六)
九、刪除一行資料
1、建立實驗環境
SQL>col scn format 999999999990
SQL>select dbms_flashback.get_system_change_number scn from dual;
SQL>delete from test where id=1;
SQL>select dbms_flashback.get_system_change_number scn from dual;
SQL>alter system dump logfile
'/home/xxxx/oracle/oradata/xxxxx/redo02.log'
scn min 56402955922
scn max 56402955923;
2、解析trace檔案
REDO RECORD - Thread:1 RBA: 0x005ffc.00000545.0010 LEN: 0x01d4 VLD: 0x0d
SCN: 0x000d.21e0ce93 SUBSCN: 6 07/21/2009 16:21:13
CHANGE #1 TYP:2 CLS: 1 AFN:4 DBA:0x01000010 OBJ:142708 SCN:0x000d.21e0caec SEQ: 2 OP:11.3
KTB Redo
op: 0x11 ver: 0x01
op: F xid: 0x0007.02a.00005303 uba: 0x008009e0.4ada.1a
Block cleanout record, scn: 0x000d.21e0ce93 ver: 0x01 opt: 0x02, entries follow...
itli: 1 flg: 2 scn: 0x000d.21e0caec
KDO Op code: DRP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x01000010 hdba: 0x0100000b
itli: 2 ispac: 0 maxfr: 4858
tabn: 0 slot: 0(0x0)
--OP: 11.3 Delete單行資料
--DRP: delete row piece
--Type:2 Delayed logging ,CLS:1 Data Block
--DBA:01000010 可以轉化成file#, block#,具體參看"Redo內部解析(二)"
--OBJ:對應dba_objects.object_id
--Xid: usn#.slot#.wrap#
--UBA: undo block addr.Seq#.Record#
CHANGE #2 TYP:0 CLS:29 AFN:2 DBA:0x00800069 OBJ:4294967295 SCN:0x000d.21e0ce19 SEQ: 1 OP:5.2
ktudh redo: slt: 0x002a sqn: 0x00005303 flg: 0x0012 siz: 176 fbi: 0
uba: 0x008009e0.4ada.1a pxid: 0x0000.000.00000000
--update undo header,具體段位置(29-11)/2=9
--type 0: normal
CHANGE #3 TYP:0 CLS:30 AFN:2 DBA:0x008009e0 OBJ:4294967295 SCN:0x000d.21e0ce18 SEQ: 1 OP:5.1
ktudb redo: siz: 176 spc: 2568 flg: 0x0012 seq: 0x4ada rec: 0x1a
xid: 0x0007.02a.00005303
ktubl redo: slt: 42 rci: 0 opc: 11.1 objn: 142708 objd: 142708 tsn: 4
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
0x00000000 prev ctl uba: 0x008009e0.4ada.19
prev ctl max cmt scn: 0x000d.21e0c5eb prev tx cmt scn: 0x000d.21e0c71d
txn start scn: 0x000d.21e0caec logon user: 55 prev brb: 8391107 prev bcl: 0 KDO undo record:
KTB Redo
op: 0x04 ver: 0x01
op: L itl: xid: 0x0007.02b.00005308 uba: 0x008009d6.4ada.13
flg: C--- lkc: 0 scn: 0x000d.21e0c98a
KDO Op code: IRP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x01000010 hdba: 0x0100000b
itli: 2 ispac: 0 maxfr: 4858
tabn: 0 slot: 0(0x0) size/delt: 11
fb: --H-FL-- lb: 0x0 cc: 2
null: --
col 0: [ 2] c1 02
col 1: [ 4] 74 65 73 74
--Undo記錄操作相反的語句,IRP:Insert Row Piece
--插入資料值記錄col 0和col 1
1、建立實驗環境
SQL>col scn format 999999999990
SQL>select dbms_flashback.get_system_change_number scn from dual;
SQL>delete from test where id=1;
SQL>select dbms_flashback.get_system_change_number scn from dual;
SQL>alter system dump logfile
'/home/xxxx/oracle/oradata/xxxxx/redo02.log'
scn min 56402955922
scn max 56402955923;
2、解析trace檔案
REDO RECORD - Thread:1 RBA: 0x005ffc.00000545.0010 LEN: 0x01d4 VLD: 0x0d
SCN: 0x000d.21e0ce93 SUBSCN: 6 07/21/2009 16:21:13
CHANGE #1 TYP:2 CLS: 1 AFN:4 DBA:0x01000010 OBJ:142708 SCN:0x000d.21e0caec SEQ: 2 OP:11.3
KTB Redo
op: 0x11 ver: 0x01
op: F xid: 0x0007.02a.00005303 uba: 0x008009e0.4ada.1a
Block cleanout record, scn: 0x000d.21e0ce93 ver: 0x01 opt: 0x02, entries follow...
itli: 1 flg: 2 scn: 0x000d.21e0caec
KDO Op code: DRP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x01000010 hdba: 0x0100000b
itli: 2 ispac: 0 maxfr: 4858
tabn: 0 slot: 0(0x0)
--OP: 11.3 Delete單行資料
--DRP: delete row piece
--Type:2 Delayed logging ,CLS:1 Data Block
--DBA:01000010 可以轉化成file#, block#,具體參看"Redo內部解析(二)"
--OBJ:對應dba_objects.object_id
--Xid: usn#.slot#.wrap#
--UBA: undo block addr.Seq#.Record#
CHANGE #2 TYP:0 CLS:29 AFN:2 DBA:0x00800069 OBJ:4294967295 SCN:0x000d.21e0ce19 SEQ: 1 OP:5.2
ktudh redo: slt: 0x002a sqn: 0x00005303 flg: 0x0012 siz: 176 fbi: 0
uba: 0x008009e0.4ada.1a pxid: 0x0000.000.00000000
--update undo header,具體段位置(29-11)/2=9
--type 0: normal
CHANGE #3 TYP:0 CLS:30 AFN:2 DBA:0x008009e0 OBJ:4294967295 SCN:0x000d.21e0ce18 SEQ: 1 OP:5.1
ktudb redo: siz: 176 spc: 2568 flg: 0x0012 seq: 0x4ada rec: 0x1a
xid: 0x0007.02a.00005303
ktubl redo: slt: 42 rci: 0 opc: 11.1 objn: 142708 objd: 142708 tsn: 4
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: No
Tablespace Undo: No
0x00000000 prev ctl uba: 0x008009e0.4ada.19
prev ctl max cmt scn: 0x000d.21e0c5eb prev tx cmt scn: 0x000d.21e0c71d
txn start scn: 0x000d.21e0caec logon user: 55 prev brb: 8391107 prev bcl: 0 KDO undo record:
KTB Redo
op: 0x04 ver: 0x01
op: L itl: xid: 0x0007.02b.00005308 uba: 0x008009d6.4ada.13
flg: C--- lkc: 0 scn: 0x000d.21e0c98a
KDO Op code: IRP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x01000010 hdba: 0x0100000b
itli: 2 ispac: 0 maxfr: 4858
tabn: 0 slot: 0(0x0) size/delt: 11
fb: --H-FL-- lb: 0x0 cc: 2
null: --
col 0: [ 2] c1 02
col 1: [ 4] 74 65 73 74
--Undo記錄操作相反的語句,IRP:Insert Row Piece
--插入資料值記錄col 0和col 1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-609811/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Redo內部解析-Single Row update (五)
- Redo內部解析-Single Row insert (四)
- Redo內部解析-Insert Single Row with Index(七)Index
- Redo內部解析(三)
- Redo內部解析(二)
- Redo內部解析(一)
- Redo內部解析-Multi Rows Insert (八)
- Redo內部解析-Global Temporary table insert(九)
- 【REDO】Oracle redo內部結構Oracle Redo
- 解析MYSQL BINLOG 二進位制格式(6)--UPDATE_ROW_EVENT/DELETE_ROW_EVENTMySqldelete
- Webdis內部解析Web
- Entity Framework Tutorial Basics(25):Delete Single EntityFrameworkdelete
- In The Plex:Google內部趣聞挖掘(六)Go
- 深入解析 oracle drop table內部原理Oracle
- Vue原始碼: 關於vm.$delete()/Vue.use() 內部原理Vue原始碼delete
- Row Chaining and Migrating(六)AI
- java內部類解析——菜鳥摘記Java
- 資料塊內部結構dump解析
- Redo 和 Undo 概念解析
- Redo active狀態解析
- Oracle redo解析之-1、oracle redo log結構計算Oracle Redo
- InnoDB從內分析之Row(一)
- JVM 內部原理(六)— Java 位元組碼基礎之一JVMJava
- git 乾貨系列:(六)公司內部搭建 git 伺服器Git伺服器
- java內部類,區域性內部類,靜態內部類,匿名內部類Java
- MySQL redo與undo日誌解析MySql
- java之內部類(InnerClass)----非靜態內部類、靜態內部類、區域性內部類、匿名內部類Java
- 10-Java內部類——成員內部類、區域性內部類、匿名內部類Java
- 雲伺服器 Linux內部無法解析域名伺服器Linux
- OkHttp3.0解析——談談內部的快取策略HTTP快取
- 通過WordCount解析Spark RDD內部原始碼機制Spark原始碼
- ORA-600 [13011] when trying to delete a row-28184.1delete
- java內部類之成員內部類之匿名內部類Java
- 26_Oracle redo物理結構解析Oracle Redo
- 解析HTTP協議六種請求方法,get,head,put,delete,post有什麼區別HTTP協議delete
- 深入解析delete和truncate不同之處:delete
- [原始碼解析]Oozie來龍去脈之內部執行原始碼
- 深入解析React資料傳遞之元件內部通訊React元件