473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,394 developers and data experts.

LogMiner Utility, useful stuff ?

LogMiner Utility, useful stuff ?

The ability to provide a readable interface to the redo logs has been asked
for for a long time. The ALTER SYTSTEM DUMP LOGFILE interface
has been around for a long time, though its usefulness outside Support is
limited. There have been a number of third party products, e.g. BMC's PATROL
DB-Logmaster (SQL*Trax as was), which provide some functionality in this
area. With Oracle release 8.1 there is a facility in the Oracle kernel to do the same. LogMiner allows the DBA to audit changes to data and performs
analysis on the redo to determine trends, aid in Point-in-time Recovery etc.

The LogMiner feature is made up of three procedures in the LogMiner
(dbms_logmnr) package, and one in the Dictionary (dbms_logmnr_d).

These are built by the following scripts: (Run by catproc)

$ORACLE_HOME/rdbms/admin/dbmslogmnrd.sql
$ORACLE_HOME/rdbms/admin/dbmslogmnr.sql
$ORACLE_HOME/rdbms/admin/prvtlogmnr.plb

since 8.1.6:

$ORACLE_HOME/rdbms/admin/dbmslmd.sql
$ORACLE_HOME/rdbms/admin/dbmslm.sql
$ORACLE_HOME/rdbms/admin/prvtlm.plb


1. dbms_logmnr_d.build

This procedure builds the dictionary file used by the main LogMiner
package to resolve object names, and column datatypes. It should be
generated relatively frequently, since otherwise newer objects will not
be recorded.

PARAMETERS
==========

1. The name of the dictionary file you want to produce.
2. The name of the directory where you want the file produced.

The Directory must be writeable by the server i.e. included in
UTL_FILE_DIR path.

EXAMPLE
=======
Expand|Select|Wrap|Line Numbers
  1.  
  2.       BEGIN
  3.          dbms_logmnr_d.build(
  4.            dictionary_filename=> 'miner_dictionary.dic',
  5.            dictionary_location => '/export/home/sme81/aholland/testcases
  6.            /logminer'
  7.                              );
  8.       END;
  9.       /
  10.  
  11.  

The dbms_logmnr package actually performs the redo analysis.

2. dbms_logmnr.add_logfile

Parameters
===========

1. The logfile to be analyzed.
2. Option
DBMS_LOGMNR.NEW (SESSION) First file to be put into PGA memory.
This initialises the V$logmnr_logs table.
and
DBMS_LOGMNR.ADDFILE
adds another logfile to the v$logmnr_logs PGA memory.
Has the same effect as NEW if there are no rows there
presently.

DBMS_LOGMNR.REMOVEFILE
removes a row from v$logmnr_logs.

Example
=======

Include all my online logs for analysis.........

Expand|Select|Wrap|Line Numbers
  1.  
  2.       BEGIN
  3.          dbms_logmnr.add_logfile(
  4.             '/export/home/sme81/aholland/database/files/redo03.log',
  5.                                DBMS_LOGMNR.NEW );
  6.          dbms_logmnr.add_logfile(
  7.             '/export/home/sme81/aholland/database/files/redo02.log',
  8.                                DBMS_LOGMNR.ADDFILE );
  9.          dbms_logmnr.add_logfile(
  10.             '/export/home/sme81/aholland/database/files/redo01.log',
  11.                                DBMS_LOGMNR.ADDFILE );
  12.       END;
  13.       /
  14.  
Expand|Select|Wrap|Line Numbers
  1. SQL> EXECUTE DBMS_LOGMNR.START_LOGMNR( -
  2.            2 DICTFILENAME =>'/oracle/database/dictionary.ora'); 
  3.  
This package populates V$logmnr_dictionary, v$logmnr_parameters,
and v$logmnr_contents.
dbms_logmnr.end_logmnr;

Thanks & Regards,
Vinod Sadanandan
Oracle DBA
Nov 7 '07 #1
0 5124

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Paul Moore | last post by:
I was just writing some code which did date/time manipulations, and I found that the Python 2.3 datetime module does not supply a number of fairly basic functions. I understand the reasoning (the...
0
by: Zane Thomas [.NET/C# MVP] | last post by:
If, like me, your connection is being swamped downloading copies of the Swen Worm and bounce messages, you might find the utility I wrote today useful. Source for the utility is distributed with...
7
by: Bora | last post by:
I usually find that a number of unrelated classes require the same kind of operations. However, I don't want to duplicate code in multiple places. In Java, I've seen those "Utility Classes",...
11
by: Chris Croughton | last post by:
I have a requirement to partially preprocess C code. By 'partially' I mean that I need to define some macros (to the utility) and have it preprocess only those macros, leaving everything else...
2
by: Tennis | last post by:
Hi, Does anyone know of a utility that automatically manages the message format, labeling and numbering of messages during collaborative program development? In the example below, the values...
2
by: Jim | last post by:
I work in the environmental industry and we have large gcms instruments that aquire raw data to an attached computer. These computers are networked, and have shared folders so the data can be...
7
by: wolfing1 | last post by:
Is there a way to see what CSS classes in a page are not defined? (like if I want to find mispelled class names, etc)
27
by: Neil | last post by:
Anyone have a recommendation for a good inexpensive or free utility for developing table schemas.
11
by: nospam | last post by:
Is there a utility that takes an arbitrarily complex C language declaration, checks it validity, and breaks it down into something more understandable. Is there a executable version for wintel...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.