Oracle redo日志文件分析(insert)
1:记录当前scn
select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
1159572
2:创建表
CREATE TABLE team ( team_code VARCHAR2(3), team_name VARCHAR2(30), country_code VARCHAR2(3) ); INSERT INTO team VALUES ('MCL','McLaren','GBR'); COMMIT;2:记录当前scn
SQL> 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: 0x0d
SCN: 0x0000.0011b1a0 SUBSCN: 1 06/03/2016 15:18:11
select to_number('1195A5','xxxxxx') from dual 16to10
select 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:0
KTB Redo
op: 0x01 ver: 0x01
compat bit: 4 (post-11) padding: 1
op: F xid: 0x0006.01a.00000313 uba: 0x00c00a6a.00a7.39
KDO Op code: IRP row dependencies Disabled
xtype: XA flags: 0x00000000 bdba: 0x014000a5 hdba: 0x014000a2
itli: 1 ispac: 0 maxfr: 4858
tabn: 0 slot: 0(0x0) size/delt: 19
fb: --H-FL-- lb: 0x1 cc: 3
null: ---
col 0: [ 3] 4d 43 4c
col 1: [ 7] 4d 63 4c 61 72 65 6e
col 2: [ 3] 47 42 52
col 0: [ 3] 4d 43 4c
col 1: [ 7] 4d 63 4c 61 72 65 6e
col 2: [ 3] 47 42 52
以上插入数值
: