Install and use Oracle LogMiner (9i or later)

Source: Internet
Author: User

1. LogMiner Installation

Run the following two scripts as a SYS User:

$ Oracle_HOME/rdbms/admin/dbmslm. SQL


$ ORACLE_HOME/rdbms/admin/dbmslmd. SQL


2. Use LogMiner

Set a required parameter UTL_FILE_DIR = <path> to ensure that oracle users have read and write permissions under this <path>. This parameter does not support dynamic modification, so it can only be modified in pfile, then restart the database instance.

Create a LogMiner dictionary file and execute the following script. (Note-the symbols cannot be lost)

EXECUTE DBMS_LOGMNR_D.BUILD ('dictionary. ora ',-
'<Path> ',-
OPTIONS => DBMS_LOGMNR_D.STORE_IN_FLAT_FILE );


Add the Log file that requires mine to LogMiner and execute the following script.

EXECUTE DBMS_LOGMNR.ADD_LOGFILE (-
LOGFILENAME => '/oradata/redo01.log ',-
OPTIONS => dbms_logmnr.NEW); <========= the first creation

 

 

EXECUTE DBMS_LOGMNR.ADD_LOGFILE (-
LOGFILENAME => '/oradata/redo02.log ',-
OPTIONS => dbms_logmnr.ADDFILE); <======== append

 


EXECUTE DBMS_LOGMNR.ADD_LOGFILE (-
LOGFILENAME => '/oradata/redo02.log ',-
OPTIONS => dbms_logmnr.REMOVEFILE); <======== Delete

Log File Mining

The options you can select to filter log information

Meaning
================================

STARTSCN start number
ENDSCN end number
STARTTIME Start Time
ENDTIME End Time
Name of the DICTFILENAME dictionary file

LogMiner view for analysis

View name view information
========================================================== ==================================

V $ the dictionary file being used by LOGMNR_DICTIONARY
V $ LOGMNR_PARAMETERS LogMiner Parameters
V $ LOGMNR_LOGS: the log file being analyzed
V $ LOGMNR_CONTENTS

Example of Filtering:

EXECUTE DBMS_LOGMNR.START_LOGMNR (-
DICTFILENAME => '<path>/dictionary. ora ',-
STARTSCN => 100 ,-
ENDSCN => 150 );


Example of viewing log information:

SELECT operation, SQL _redo FROM v $ logmnr_contents;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.