logminer精简使用手册

创建相关包
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/dbmslm.sql
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/dbmslmd.sql

 


分析
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_74_9dl7y16k_.arc',Options=>dbms_logmnr.NEW);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_75_9dl8f7ox_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_76_9dl8f9n0_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_77_9dl9cf4j_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_78_9dl9ch2r_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_79_9dlc7ljx_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_80_9dlc7n34_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_81_9dlgr3hs_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_82_9dlgr59d_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_83_9dll8nft_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_84_9dll8p64_.arc',Options=>dbms_logmnr.ADDFILE);
exec dbms_logmnr.add_logfile(LogFileName => '/oracle10g/app/oracle/flash_recovery_area/ORCL10G/archivelog/2014_01_05/o1_mf_1_85_9dlos5c5_.arc',Options=>dbms_logmnr.ADDFILE);
EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG);

或者加上过滤条件:
startscn => ,
endscn =>,
starttime =>,
endtime => 

保存内容
create table test1 tablespace users as select * from V$LOGMNR_CONTENTS ;

查看内容
select sql_redo from test1 
    where upper(sql_redo) like '%*%';

发表评论

电子邮件地址不会被公开。 必填项已用*标注