redo log日誌挖掘(二)

sundog315發表於2010-09-30

這一段時間,在上次的基礎上,完成了行遷移、行連結的支援,並且增加了rollback的支援。在資料型別方面,增加了char和timestamp的支援,請看測試:

SUNDOG315>create table t (id1 number,id2 number,id3 number,text1 varchar2(4000),
text2 varchar2(4000),text3 varchar2(4000));

表已建立。

SUNDOG315>insert into t values (1,2,3,lpad('a',4000,'a'),lpad('a',4000,'a'),lpad
('a',4000,'a'));

已建立 1 行。

SUNDOG315>insert into t values (2,3,4,'a','a','a');

已建立 1 行。

SUNDOG315>update t set text1=lpad('a',4000,'a'),text2=lpad('a',4000,'a'),text3=l
pad('a',4000,'a') where id1=2;

已更新 1 行。

SUNDOG315>delete from t;

已刪除2行。

SUNDOG315>rollback;

回退已完成。

[@more@]

其中,4000個a太長了,用aaaa...aaaa代替

1798657,00020021000002a4,1003396,56273,1,36,280,TEST,T,insert into T ( ID1, ID2, ID3, TEXT1, TEXT2, TEXT3 ) values ( 1, 2, 3, 'aaaa...aaaa', 'aaaa...aaaa', 'aaaa...aaaa');
1798657,00020021000002a4,1003396,56273,1,37,348,TEST,T,insert into T ( ID1, ID2, ID3, TEXT1, TEXT2, TEXT3 ) values ( 2, 3, 4, 'a', 'a', 'a' );
1798661,00020021000002a4,1003396,56273,1,73,308,TEST,T,update T set ID1 = 2, ID2 = 3, ID3 = 4, TEXT1 = 'aaaa...aaaa', TEXT2 = 'aaaa...aaaa', TEXT3 = 'aaaa...aaaa' WHERE ID1 = 2 AND ID2 = 3 AND ID3 = 4 AND TEXT1 = 'a' AND TEXT2 = 'a' AND TEXT3 = 'a' ;
1798662,00020021000002a4,1003394,56273,1,100,228,TEST,T,delete from T where ID1 = 1 AND ID2 = 2 AND ID3 = 3 AND TEXT1 = 'aaaa...aaaa' AND TEXT2 = 'aaaa...aaaa' AND TEXT3 = 'aaaa...aaaa';
1798662,00020021000002a4,1003397,56273,1,127,300,TEST,T,delete from T where ID1 = 2 AND ID2 = 3 AND ID3 = 4 AND TEXT1 = 'aaaa...aaaa' AND TEXT2 = 'aaaa...aaaa' AND TEXT3 = 'aaaa...aaaa';
1798669,00020021000002a4,c00090,0,1,187,260,rollback;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19423/viewspace-1039152/,如需轉載,請註明出處,否則將追究法律責任。

相關文章