Oracle DBA Study Notes-log files (use logminer to analyze logs)

Source: Internet
Author: User

previous: oracle DBA Study Notes-control files

RedoLog Files

Redo log files record the changes made to the database (or changes to transactions) in the form of redo records, including the execution of DMLOrDDLStatement modification to the database,
It also includesDBAModify the database structure,Redo log files also need to be reused.

 

Log File writing principles:
1.Write order must strictly follow the execution order of concurrent transactions
2.You must write the redo log file before writing the data file.

Redo log write cycle:
When the first group of logs is fully written, switch the redo log (Alter system switch logfileTo write the record of the redo log to the second redo log file, and so on.

Archive log list

Select * from V $ log
StatusIf yesInactiveIndicates that no user or transaction is currently accessed, and data can be overwritten.
ArchiveIndicates whether the log information is archived,NoIndicates no archive

Switch log serial number

Alter sytem switch logfile

Select * from V $ logfile

Add log files

Alter database add logfile

('D: \ oracle \ oradata \ work \ log3a. log', 'd: oracle \ oradata \ work \ log3b. log ')

 

UseLogminerAnalyze log files

1.Check whether or not to setUtl_file_dirParameters

Show parameters utl_file_dir

IfValueIf the value is not null, it indicates that the parameter has been set.

Otherwise, you need to set it.

The settings are as follows:

After the settings are completeOracleInitialize the ParameterSpfile.

D: \ oracle \ ora90 \ database \ spfilework. ora

 

2.Extract information from the database data dictionary and createLogminerThe flat data dictionary file used.

Execution ProcessExecute dbms_logmnr_d.build ('woody. ora ', 'd: \ log '),Need to ensureD: \ logThe folder exists.

-

After the execution is complete,D: \ logCreatedWoody. oraFile

3.Add log files

First

Execute dbms_logmnr.add_logfile ('d: \ oracle \ oradata \ work \ redo01.log ', Options => dbms_logmnr.new)

Second

Execute dbms_logmnr.add_logfile ('d: \ oracle \ oradata \ work \ redo02.log ', Options => dbms_logmnr.addfile)

Third

Execute dbms_logmnr.add_logfile ('d: \ oracle \ oradata \ work \ redo03.log ', Options => dbms_logmnr.addfile)

You can use

Select * from V $ logmnr_logsView

3.StartLogminer.

Run

Execute dbms_logmnr.start_logmnr (dictfilename => 'd \ log \ Woody. ora ')

The following error may occur:

 

ModifyNts_languageYes (it may be caused by a log Date Format problem)

 


Execute the previous process.

4.View operation logs

ViewV $ logmnr_contentsThen, through analysisV $ logmnr_contents.

The result is as follows:

5.EndLogminerSession.(LogminerSystem resources and database resources are occupied.)

Execute dbms_logmnr.end_logmnr

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.