使用logmnr测试dml提交前与提交后差异
sqlplus开个会话
14:40:49 SQL> desc test
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER
NAME VARCHAR2(10)
14:40:58 SQL> insert into test values(1,'sysdate');
1 row created.
14:41:26 SQL> select userenv('sid') from dual;
USERENV('SID')
--------------
131
14:48:39 SQL> commit;
Commit complete.
提交前
虽然未提交,但是logmnr可以读取联机日志redo记录,可以找到insert那行,并且数据库自动开启了事务,set transaction read write.
提交后
提交后,logmnr能看到commit动作,并且在commit那行,start_scn,commit_scn两列有事务起止的scn,以后分析事务可以从scn,start_scn,commit_scn,着手,先按scn排序,再看哪行有commit,观察start_scn,commit_scn,继而确认事务起止。