Oracle redo記錄檔分析(insert)
Oracle redo記錄檔分析(insert) 1:記錄當前scnselect dbms_flashback.get_system_change_number from dual;GET_SYSTEM_CHANGE_NUMBER------------------------ 11595722:建立表
CREATE TABLE team( team_code VARCHAR2(3), team_name VARCHAR2(30), country_code VARCHAR2(3));INSERT INTO team VALUES ('MCL','McLaren','GBR');COMMIT;
2:記錄當前scnSQL> select dbms_flashback.get_system_change_number from dual; GET_SYSTEM_CHANGE_NUMBER------------------------ 1159601 3:通過scnscn 轉儲 alter system dump logfile '/u01/app/oracle/oradata/devdb/redo01.log' scn min 1159572 scn max 1159601 4:檔案分析REDO RECORD - Thread:1 RBA: 0x000019.00000fef.0010 LEN: 0x01e8 VLD: 0x0dSCN: 0x0000.0011b1a0 SUBSCN: 1 06/03/2016 15:18:11 THEREAD: 線程號1;RBA: 序號+塊號+塊裡位元組號LEN:長度VLD:SCN:改變時間select to_number('1195A5','xxxxxx') from dual 16to10select to_char(scn_to_timestamp(1159584),'YYYY-MM-DD HH24:MI:SS') from dual;select timestamp_to_scn(to_date('2016-03-06 15:18:15','YYYY-MM-DD HH24:MI:SS')) from dual;
CHANGE #1 TYP:0 CLS:1 AFN:5 DBA:0x014000a5 OBJ:73445 SCN:0x0000.0011aa1f SEQ:2 OP:11.2 ENC:0 RBL:0KTB Redoop: 0x01 ver: 0x01compat bit: 4 (post-11) padding: 1op: F xid: 0x0006.01a.00000313 uba: 0x00c00a6a.00a7.39 KDO Op code: IRP row dependencies Disabled xtype: XA flags: 0x00000000 bdba: 0x014000a5 hdba: 0x014000a2itli: 1 ispac: 0 maxfr: 4858tabn: 0 slot: 0(0x0) size/delt: 19fb: --H-FL-- lb: 0x1 cc: 3null: ---col 0: [ 3] 4d 43 4ccol 1: [ 7] 4d 63 4c 61 72 65 6ecol 2: [ 3] 47 42 52 change #1 改變數TYP:0 改變類型CLS:1 參照X$BH class 1表示資料區塊AFN:絕對資料檔案號 5DBA:更改資料區塊地址 14000a5(5/165)OBJ: object id
SCN:0x0000.0011aa1fseq:2:序號OP:11.2 Insert Row Piece KTB REDOop: 01 F xid: 0x0006.01a.00000313 transaction ID uba: 0x00c00a6a.00a7.39 復原段改變地址,序號,塊記錄號 KDO: IRP(Insert Row Piece) row dependencies Disabled (預設建立表示非依賴,啟動特性,ORA_ROWSCN偽列新特性)
bdba:block address
hdba:segment header addressitli:事務slot 1tabn: 0 表示非群集表 slot: 0(0x0) slot numbersize/delt: 19 塊改變大小,增加19 bytesfb: --H-FL-- lb: 0x1 被鎖住事務itil 1(與上面相符)cc: 3 插入列的數量
col 0: [ 3] 4d 43 4ccol 1: [ 7] 4d 63 4c 61 72 65 6ecol 2: [ 3] 47 42 52以上插入數值