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

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

WBOY
Freigeben: 2016-06-07 15:22:28
Original
1133 Leute haben es durchsucht

对于执行DDL前的操作无法挖掘,但是不报错。只显示DDL语句及DDL之后的DML操作。 更多logmnr挖掘DML操作,详见:使用logmnr使用logmnr对其它用户的操作执行日志挖掘的四个对比实验 BYS@ bys3select dbms_flashback.get_system_change_number from dual; GET_S

对于执行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';
Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage