Oracle Log Analyzer Tool Logminer use

Source: Internet
Author: User

Oracle Log Analyzer Tool Logminer use

1. Set Date format

Alter system set nls_date_format= ' Yyyy-mm-dd hh24:mi:ss ' scope=spfile;

Select To_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss ') from dual;

2. Add Supplemental Log

If the database needs to use Logminer, it should be added, only after this log is added to capture DML

ALTER DATABASE ADD Supplemental LOG DATA (PRIMARY KEY, UNIQUE INDEX) COLUMNS;

3. Open Archive

Alter system set log_archive_dest_1= ' Location=e:\arch ' Scope=both;

Shutdown immediate

Startup Mount

ALTER DATABASE Archivelog;

ALTER DATABASE open;

4. Install Logminer Tools

To install the Logminer tool, you must first run the following two scripts, both of which must be run as SYS users. The first of these scripts is used to create a DBMS_LOGMNR package that analyzes the log files. The second script is used to create the Dbms_logmnr_d package, which is used to create the data dictionary file.

1. $ORACLE _home\rdbms\admin\dbmslm.sql

2. $ORACLE _home\rdbms\admin\dbmslmd.sql

3. $ORACLE _home\rdbms\admin\dbmslms.sql

@e:\app\administrator\product\11.2.0\dbhome_1\rdbms\admin\dbmslm.sql

The package has been created.

The authorization was successful.

The synonym has been created.

@e:\app\administrator\product\11.2.0\dbhome_1\rdbms\admin\dbmslmd.sql

The package has been created.

The synonym has been created.

@e:\app\administrator\product\11.2.0\dbhome_1\rdbms\admin\dbmslms.sql

Package created

No mistakes.

The authorization was successful.

5. Using the Logminer tool

5.1. Set parameter Utl_file_dir

A data dictionary file is a text file that is created using package dbms_logmnr_d. If the table in the database that we are analyzing changes, the data dictionary that affects the library changes, and the dictionary file needs to be recreated. Another scenario is that when you analyze a redo log for another database file, you also have to regenerate the data dictionary file of the parsed database.

In Oracle8i, first in the Init.ora initialization parameter file, specify the location of the data dictionary file, which is to add a parameter utl_file_dir, which is the directory where the data dictionary files are placed in the server. Such as:

Utl_file_dir = (e:\test)

After oracle9i, it is recommended to use SPFile to dynamically adjust parameters;

Sql> Show parameter SPFile;

NAME TYPE VALUE

------------------------------------ ----------- ---------- --------------------

SPFile string E:\APP\ADMINISTRATOR\PRODUCT\1

1.2.0\dbhome_1\database\spfile

ORCL. ORA

Sql> alter system set utl_file_dir= ' E:\test ' scope=spfile;

The system has changed.

Shutdown immediate

sql> Startup force

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.