Use logminer

xiaoxiao2021-03-06  62

1. Create a DBMS_LogMnR package SQL> @ $ oracle_home / rdbms / admin / dbmslm.sql2. Create related data dictionary SQL> @ $ oracle_home / rdbms / admin / dbmslmd.sql3. Modify the initialization parameter UTL_FILE_DIR, specify the analysis data SQL> ALTER system set UTL_FILE_DIR = '/ opt / oracle / logminer' scope = spfile; 4. Restart database SQL> Shutdown ImmediateSQL> Startup5. Create a data dictionary file

SQL> EXECUTE DBMS_LOGMNR_D.BUILD (Dictionary_FileName => 'sqltrace.ora', Dictionary

_Location => '/ opt / oracle / logminer / log'); 6. Establish a log analysis table

SQL> EXECUTE DBMS_LOGMNR.Add_logfile (options => dbms_logmnr.new, logfilename => '/ opt / oracle / ora92 / rdbms / arc00009.001');

7. Add log files used to analyze

SQL> EXECUTE DBMS_LOGMNR.Add_logfile (options => dbms_logmnr.addfile, logfilename => '/ opt / oracle / ora92 / rdbms / arc00010.001');

SQL> EXECUTE DBMS_LOGMNR.ADD_Logfile (Options => dbms_logmnr.addfile, logfilename => / opt / oracle / ora92 / rdbms / arc00011.001 ');

delete

SQL> EXECUTE DBMS_LOGMNR.ADD_LOGFILE (Options => dbms_logmnr.removefile, logfilenam

E => '/ OPT / Oracle / ORA92 / RDBMS / ARC00011.001');

8. Start LogMiner for analysis

SQL> EXECUTE DBMS_LOGMNR.START_LOGMNR (DictFileName => '/ OPT / Oracle / logminer / log / sqltrace.or

A ', StartTime => to_date (' 20040625 09:00:00 ',' YYYYMMDD HH24: MI: SS '), EndTime => TO_D

ATE ('20040625 22:00:00', 'YYYYMMDD HH24: MI: SS')); 9. See the analysis results

SELECT OPERATION, SQL_REDO, SQL_UNDO from V $ logmnr_contents;

10. End analysis

SQL> EXECUTE DBMS_LOGMNR.END_LOGMNR;

Once the analysis results in V $ logMnR_Contents are also no longer existed.

转载请注明原文地址:https://www.9cbs.com/read-113901.html

New Post(0)