1. logminer安装
SQL> @$ORACLE_HOME/rdbms/admin/dbmslm.sqlPackage created.Grant succeeded.Synonym created.SQL> @$ORACLE_HOME/rdbms/admin/dbmslmd.sqlPackage created.Synonym created.SQL> @$ORACLE_HOME/rdbms/admin/dbmslms.sqlPackage created.No errors.Grant succeeded.
2. 配置
SQL> alter system set utl_file_dir='/home/oracle/log' scope=spfile;System altered.
3. 重启oracle
SQL> shutdown immediate;
Database closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1603411968 bytes
Fixed Size 2160112 bytesVariable Size 385878544 bytesDatabase Buffers 1207959552 bytesRedo Buffers 7413760 bytesDatabase mounted.Database opened.SQL>4.
execute
dbms_logmnr_d.build(dictionary_filename=>
'oracle.ora'
,dictionary_location=>
'
/home/oracle/log/');
SQL> execute dbms_logmnr.start_logmnr(dictfilename=>'/home/oracle/log/oracle.ora');PL/SQL procedure successfully completed.
SQL> execute dbms_logmnr.add_logfile(options=>dbms_logmnr.addfile,logfilename=>'/home/oracle/log/redo03.log');
PL/SQL procedure successfully completed.
5. 开始查日志
SQL> execute dbms_logmnr.start_logmnr(dictfilename=>'/home/oracle/log/oracle.ora');PL/SQL procedure successfully completed.
6. 找对于表的操作记录
SQL> Select sql_redo,timestamp,operation from v$logmnr_contents where table_name='T_UC_BMPCONSOLEMODE';