logmnr挖掘中间有DDL的操作示例-对于执行DDL前的操作无法挖掘
对于执行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';
更多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';
>更多相关文章
- 11-06Hadoop是目前大数据领域最主流的一套技术体系
- 11-06大数据和人工智能:三个真实世界的用例
- 11-06为什么说,大数据与行业专家是“共生”关系?
- 11-06Python数据可视化:箱线图多种库画法
- 11-06这种思路讲解HDFS你肯定没见过?快速入门Hadoop必备
- 11-06媲美Pandas的数据分析工具包Datatable
首页推荐
佛山市东联科技有限公司一直秉承“一切以用户价值为依归
- 01-11全球最受赞誉公司揭晓:苹果连续九年第一
- 12-09罗伯特·莫里斯:让黑客真正变黑
- 12-09谁闯入了中国网络?揭秘美国绝密黑客小组TA
- 12-09警示:iOS6 惊现“闪退”BUG
- 11-18LG新能源宣布与Bear Robotics达成合作,成为
- 11-18机构:三季度全球个人智能音频设备市场强势
- 11-18闲鱼:注册用户过6亿 AI技术已应用于闲置交
- 11-18美柚、宝宝树回应“涉黄短信骚扰”:未发现
- 11-01京东七鲜与前置仓完成融合
相关文章
24小时热门资讯
24小时回复排行
热门推荐
最新资讯
操作系统
黑客防御