Redo內部解析-Global Temporary table insert(九)
十二、全域性臨時表insert操作
1、建立測試環境
SQL>create global temporary table test_tmp
(id number not null, object_name varchar2(20))
on commit preserve rows;
SQL>col scn format 999999999990
SQL>select dbms_flashback.get_system_change_number scn from dual;
SQL>insert into test_tmp select rownum, object_name
from dba_objects where rownum<100;
SQL>commit;
SQL>select dbms_flashback.get_system_change_number scn from dual;
SQL>alter system dump logfile
'/home/xxxx/oracle/oradata/xxxxxx/redo03.log'
scn min 56403090594
scn max 56403090601;
2、trace檔案解析
REDO RECORD - Thread:1 RBA: 0x005ffd.00047536.0010 LEN: 0x01e4 VLD: 0x05
SCN: 0x000d.21e2dca5 SUBSCN: 1 07/24/2009 15:34:39
CHANGE #1 TYP:0 CLS:29 AFN:2 DBA:0x00800069 OBJ:4294967295 SCN:0x000d.21e2dc4e SEQ: 1 OP:5.2
ktudh redo: slt: 0x0002 sqn: 0x00005325 flg: 0x0012 siz: 308 fbi: 0
uba: 0x00800d55.4af3.05 pxid: 0x0000.000.00000000
--更改undo段header
CHANGE #2 TYP:0 CLS:30 AFN:2 DBA:0x00800d55 OBJ:4294967295 SCN:0x000d.21e2dc4c SEQ: 5 OP:5.1
ktudb redo: siz: 308 spc: 7682 flg: 0x0012 seq: 0x4af3 rec: 0x05
xid: 0x0007.002.00005325
ktubl redo: slt: 2 rci: 0 opc: 11.1 objn: 143025 objd: 4210953 tsn: 3
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: Yes
Tablespace Undo: No
0x00000000 prev ctl uba: 0x00800d55.4af3.01
prev ctl max cmt scn: 0x000d.21e2d06b prev tx cmt scn: 0x000d.21e2d079
txn start scn: 0xffff.ffffffff logon user: 55 prev brb: 8392012 prev bcl: 0 KDO undo record:
KTB Redo
op: 0x03 ver: 0x01
op: Z
KDO Op code: QMD row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x0040410a hdba: 0x00404109
itli: 1 ispac: 0 maxfr: 4863
tabn: 0 lock: 0 nrow: 99
slot[0]: 0
slot[1]: 1
.....
slot[98] 98
--只記錄undo資料塊的變化,沒有記錄資料塊的變化
--因為臨時表是批量insert,所以在undo中記錄是批量delete(QMD)
REDO RECORD - Thread:1 RBA: 0x005ffd.00047537.0010 LEN: 0x008c VLD: 0x05
SCN: 0x000d.21e2dca8 SUBSCN: 1 07/24/2009 15:34:43
CHANGE #1 TYP:0 CLS:29 AFN:2 DBA:0x00800069 OBJ:4294967295 SCN:0x000d.21e2dca5 SEQ: 1 OP:5.4
ktucm redo: slt: 0x0002 sqn: 0x00005325 srt: 0 sta: 9 flg: 0x2
ktucf redo: uba: 0x00800d55.4af3.05 ext: 2 spc: 7372 fbi: 0
--commit
總結:
全域性臨時表在redo中只記錄undo資料塊的變化,不會記錄段的變化。
1、建立測試環境
SQL>create global temporary table test_tmp
(id number not null, object_name varchar2(20))
on commit preserve rows;
SQL>col scn format 999999999990
SQL>select dbms_flashback.get_system_change_number scn from dual;
SQL>insert into test_tmp select rownum, object_name
from dba_objects where rownum<100;
SQL>commit;
SQL>select dbms_flashback.get_system_change_number scn from dual;
SQL>alter system dump logfile
'/home/xxxx/oracle/oradata/xxxxxx/redo03.log'
scn min 56403090594
scn max 56403090601;
2、trace檔案解析
REDO RECORD - Thread:1 RBA: 0x005ffd.00047536.0010 LEN: 0x01e4 VLD: 0x05
SCN: 0x000d.21e2dca5 SUBSCN: 1 07/24/2009 15:34:39
CHANGE #1 TYP:0 CLS:29 AFN:2 DBA:0x00800069 OBJ:4294967295 SCN:0x000d.21e2dc4e SEQ: 1 OP:5.2
ktudh redo: slt: 0x0002 sqn: 0x00005325 flg: 0x0012 siz: 308 fbi: 0
uba: 0x00800d55.4af3.05 pxid: 0x0000.000.00000000
--更改undo段header
CHANGE #2 TYP:0 CLS:30 AFN:2 DBA:0x00800d55 OBJ:4294967295 SCN:0x000d.21e2dc4c SEQ: 5 OP:5.1
ktudb redo: siz: 308 spc: 7682 flg: 0x0012 seq: 0x4af3 rec: 0x05
xid: 0x0007.002.00005325
ktubl redo: slt: 2 rci: 0 opc: 11.1 objn: 143025 objd: 4210953 tsn: 3
Undo type: Regular undo Begin trans Last buffer split: No
Temp Object: Yes
Tablespace Undo: No
0x00000000 prev ctl uba: 0x00800d55.4af3.01
prev ctl max cmt scn: 0x000d.21e2d06b prev tx cmt scn: 0x000d.21e2d079
txn start scn: 0xffff.ffffffff logon user: 55 prev brb: 8392012 prev bcl: 0 KDO undo record:
KTB Redo
op: 0x03 ver: 0x01
op: Z
KDO Op code: QMD row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x0040410a hdba: 0x00404109
itli: 1 ispac: 0 maxfr: 4863
tabn: 0 lock: 0 nrow: 99
slot[0]: 0
slot[1]: 1
.....
slot[98] 98
--只記錄undo資料塊的變化,沒有記錄資料塊的變化
--因為臨時表是批量insert,所以在undo中記錄是批量delete(QMD)
REDO RECORD - Thread:1 RBA: 0x005ffd.00047537.0010 LEN: 0x008c VLD: 0x05
SCN: 0x000d.21e2dca8 SUBSCN: 1 07/24/2009 15:34:43
CHANGE #1 TYP:0 CLS:29 AFN:2 DBA:0x00800069 OBJ:4294967295 SCN:0x000d.21e2dca5 SEQ: 1 OP:5.4
ktucm redo: slt: 0x0002 sqn: 0x00005325 srt: 0 sta: 9 flg: 0x2
ktucf redo: uba: 0x00800d55.4af3.05 ext: 2 spc: 7372 fbi: 0
--commit
總結:
全域性臨時表在redo中只記錄undo資料塊的變化,不會記錄段的變化。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-610361/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Redo內部解析-Multi Rows Insert (八)
- Redo內部解析-Single Row insert (四)
- Redo內部解析-Insert Single Row with Index(七)Index
- Oracle臨時表GLOBAL TEMPORARY TABLEOracle
- oracle的兩種global temporary table!Oracle
- Redo內部解析(三)
- Redo內部解析(二)
- Redo內部解析(一)
- 全域性臨時表 GLOBAL TEMPORARY TABLE
- create table進階學習(二)_全域性臨時表_global temporary table
- Redo內部解析-Single Row Delete (六)delete
- Redo內部解析-Single Row update (五)
- 深入解析 oracle drop table內部原理Oracle
- orace global temporary table全域性臨時表測試小記
- 【REDO】Oracle redo內部結構Oracle Redo
- oracle temporary tableOracle
- 臨時表(GLOBAL TEMPORARY TABLE)及統計資訊收集,動態取樣
- oracle global temporary table全域性臨時表_測試及v$tempseg_usageOracle
- 資料庫表--temporary table資料庫
- Webdis內部解析Web
- MySQL insert的內部操作流程介紹MySql
- Redis高可用分散式內部交流(九)Redis分散式
- Git詳解之九:Git內部原理Git
- 【TEMPORARY TABLE】Oracle臨時表使用注意事項Oracle
- 調研azkaban內部資料庫幾張table資料庫
- 【SQL】 Multi table insert 多表插入操作SQL
- ORACLE insert命令解析Oracle
- java內部類解析——菜鳥摘記Java
- 資料塊內部結構dump解析
- Redo 和 Undo 概念解析
- Redo active狀態解析
- [ 丹臣]利用innodb_table_monitor來trace innodb內部資訊
- Mysql 5.7 Gtid內部學習(九) 實際案例(一)MySql
- [20230227][20230109]Oracle Global Temporary Table ORA-01555 and Undo Retention.tOracle
- Oracle redo解析之-1、oracle redo log結構計算Oracle Redo
- 【TEMPORARY TABLE】Oracle兩種臨時表型別功能特點比較Oracle型別
- java內部類,區域性內部類,靜態內部類,匿名內部類Java
- create table進階學習系列(九)