logmnr

 /*
   涉及到地视图有
      v$archived_log                         查看归档日志,得到具体的路径
      v$logmnr_logs                          查看添加档日志后的视图
      v$logmnr_contents                     归档日志的具体内容
    涉及到的包有
       dbms_logmnr_d.build()                 创建logmnr  数据字典
       dbms_logmnr.add_logfile();          添加要查看的日志
       dbms_logmnr.start_logmnr();            开如始分析数据
     */
    --create dictionaray
   
    execute dbms_logmnr_d.build(dictionary_filename =>'dict.ora',dictionary_location =>'/u/app/oracle/product/10.2.0/db_1/log');  
    --add logfile   
                 /* Formatted on 2015-3-3 16:30:47 (QP5 v5.149.1003.31008) */
                execute dbms_logmnr.add_logfile(logfilename=>'/u/arch/1_309_861793420.dbf');
    
   --make sure logfile for minnig
            SELECT db_name, thread_sqn, filename FROM v$logmnr_logs;
   ---  start  analysys
     exec DBMS_LOGMNR.START_LOGMNR(OPTIONS => SYS.DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG); 
   --analysys
select operation,timestamp,scn from v$logmnr_contents 
 where seg_name='LOGMNR_TEST' and 
       seg_owner='HR' and 
       seg_type_name='TABLE';

你可能感兴趣的:(oracle,logmnr)