分类: Oracle
2012-11-13 10:52:59
begin
dbms_logmnr_d.build(
dictionary_filename=>'logminer_dict.dat',
dictionary_location=>'/home/oracle/logmnr');
end;
/
现在可以创建列表了:
execute dbms_logmnr.add_logfile(options=>dbms_logmnr.new,logfilename=>'/home/oracle/app/oracle/oradata/bdlms/redo11.log');
添加:
execute dbms_logmnr.add_logfile(options=>dbms_logmnr.new,logfilename=>'/home/oracle/app/oracle/oradata/bdlms/redo21.log');
此时可以查看v$logmnr_logs
启用日志分析:
begin
dbms_logmnr.start_logmnr(
dictfilename=>'/home/oracle/logmnr/logminer_dict.dat'
);
end;
/
也可以限制条件:
begin
dbms_logmnr.start_logmnr(
dictfilename=>'/home/oracle/logmnr/logminer_dict.dat',
starttime =>to_date('2012-01-01 16:40:23','YYYY-MM-DD HH24:MI:SS'),
endtime =>to_date('2012-01-02 16:40:00','YYYY-MM-DD HH24:MI:SS')
);
end;
/
观察分析结果:
select sql_redo from v$logmnr_contents;