Prevent Oracle LogMiner from creating archived logs in flash recovery area
I'm trying to use Oracle LogMiner (DBMS_LOGMNR
package) for implementation of audit trails functionality based on redo logs. But each time when I query V$LOGMNR_CONTENTS
it creates several big (up to 50M) archived logs files in flash recovery area (SELECT NAME FROM V$RECOVERY_FILE_DEST
) in spite the fact that there were only several transactions per hour in my test DB. After several times of using Oracle LogMiner all space in flash recovery area becomes used and Oracle stops work开发者_StackOverflow中文版ing.
Is there any way to prevent Oracle LogMiner from creating archived logs in flash recovery area?
I initialize Oracle LogMiner in the following way:
SYS.DBMS_LOGMNR_D.BUILD(options => SYS.DBMS_LOGMNR_D.STORE_IN_REDO_LOGS);
SYS.DBMS_LOGMNR.START_LOGMNR(startScn => PREV_SCN, endScn => NEXT_SCN,
options =>
SYS.DBMS_LOGMNR.COMMITTED_DATA_ONLY +
SYS.DBMS_LOGMNR.DICT_FROM_REDO_LOGS +
SYS.DBMS_LOGMNR.SKIP_CORRUPTION +
SYS.DBMS_LOGMNR.CONTINUOUS_MINE
);
Distance between PREV_SCN and NEXT_SCN is always small in my case and covers only several transactions.
When I use ALTER DATABASE NOARCHIVELOG;
to turn off archived logs, DBMS_LOGMNR_D.BUILD
raises ORA-01325
: archive log mode must be enabled to build into the logstream.
the reason why Logminer creates entries in the redo log is because you have asked it specifically:
SYS.DBMS_LOGMNR_D.BUILD(options => SYS.DBMS_LOGMNR_D.STORE_IN_REDO_LOGS);
^^^^^^^^^^^^^^^^^^
If you don't want logminer to store its data in the redo logs, use DBMS_LOGMNR_D.STORE_IN_FLAT_FILE
instead. See this blog note for example for a step by step guide on how to setup logminer using flat files.
精彩评论