logmnr挖掘中间有DDL的操作示例-对于执行DDL前的操作无法挖掘

浏览:
字体:
发布时间:2013-12-20 16:18:26
来源:
对于执行DDL前的操作无法挖掘,但是不报错。只显示DDL语句及DDL之后的DML操作。
更多logmnr挖掘DML操作,详见:使用logmnr使用logmnr对其它用户的操作执行日志挖掘的四个对比实验
BYS@ bys3>select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
3517212
BYS@ bys3>select * from test;
OBJECT_NAME STATUS
------------ -------
11 22
10 15
10 15
BYS@ bys3>delete test where status=22;
1 row deleted.
BYS@ bys3>commit;
Commit complete.
BYS@ bys3>truncate table test;
Table truncated.
BYS@ bys3>insert into test values(9,888);
1 row created.
BYS@ bys3>commit;
Commit complete.
BYS@ bys3>select * from test;
OBJECT_NAME STATUS
------------ -------
9 888
BYS@ bys3>select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
3517265
#############LOGMNR进行挖掘:--只看到DDL语句及之后的DML。
BYS@ bys3>col member for a30
BYS@ bys3>select a.group#,a.member,b.status from v$logfile a,v$log b where a.group#=b.group#;
GROUP# MEMBER STATUS
---------- ------------------------------ ----------------
1 /u01/oradata/bys3/redo01.log INACTIVE
2 /u01/oradata/bys3/redo02.log CURRENT
3 /u01/oradata/bys3/redo03.log INACTIVE
BYS@ bys3>execute dbms_logmnr.add_logfile(LogFileName => '/u01/oradata/bys3/redo02.log',Options => dbms_logmnr.new);
PL/SQL procedure successfully completed.
BYS@ bys3>execute dbms_logmnr.start_logmnr(options =>dbms_logmnr.dict_from_online_catalog,startscn =>3517212,endscn =>3517265);
PL/SQL procedure successfully completed.

BYS@ bys3>col sql_undo for a60
BYS@ bys3>col sql_redo for a60
BYS@ bys3>set linesize 200
BYS@ bys3>col operation for a15
BYS@ bys3>select operation,sql_redo,sql_undo from v$logmnr_contents where table_name='TEST';
OPERATION SQL_REDO SQL_UNDO
--------------- ------------------------------------------------------------ ------------------------------------------------------------
DDL truncate table test;
INSERT insert into "BYS"."TEST"("OBJECT_NAME","STATUS") values ('9' delete from "BYS"."TEST" where "OBJECT_NAME" = '9' and "STAT
,'888'); US" = '888' and ROWID = 'AAAFdlAAEAAAAD1AAA';
>更多相关文章
24小时热门资讯
24小时回复排行
资讯 | QQ | 安全 | 编程 | 数据库 | 系统 | 网络 | 考试 | 站长 | 关于东联 | 安全雇佣 | 搞笑视频大全 | 微信学院 | 视频课程 |
关于我们 | 联系我们 | 广告服务 | 免责申明 | 作品发布 | 网站地图 | 官方微博 | 技术培训
Copyright © 2007 - 2024 Vm888.Com. All Rights Reserved
粤公网安备 44060402001498号 粤ICP备19097316号 请遵循相关法律法规
');})();