Oracle LogMiner 使用

1. 添加要分析的日志文件

EXECUTE DBMS_LOGMNR.ADD_LOGFILE( - LOGFILENAME => '/home/duanbb/oracle/oradata/mydb/redo01.log', - OPTIONS => DBMS_LOGMNR.NEW); EXECUTE DBMS_LOGMNR.ADD_LOGFILE( - LOGFILENAME => '/home/duanbb/oracle/oradata/mydb/redo02.log', - OPTIONS => DBMS_LOGMNR.ADDFILE); EXECUTE DBMS_LOGMNR.ADD_LOGFILE( - LOGFILENAME => '/home/duanbb/oracle/oradata/mydb/redo03.log', - OPTIONS => DBMS_LOGMNR.ADDFILE);

 

2.  启动日志分析

EXECUTE DBMS_LOGMNR.START_LOGMNR( - OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG);

 

3. 查询:eg. 查询表 "MYDB1.TEST_USER"的操作记录

select sql_redo from v$logmnr_contents where seg_owner = 'MYDB1' and table_name = 'TEST_USER';

你可能感兴趣的:(Oracle LogMiner 使用)