What is LogMiner? LogMiner is an Oracle utility. Using LogMiner one can query the contents of online redo log files and archived log files. It can be used as a powerful data audit tool, as well as a tool for sophisticated data analysis.
Thursday, August 7, 2008 2
Log Miner Objects: The three basic objects in a LogMiner configuration: Source Database LogMiner Directory Redo log files
Thursday, August 7, 2008 3
Database must be OPEN and in ARCHIVELOG mode: To extract a LogMiner dictionary to the redo log files, the database must be open and in ARCHIVELOG mode and archiving must be enabled. While the dictionary is being extracted to the redo log stream, no DDL statements can be executed.
Thursday, August 7, 2008 4
Get the list of ARCHIVES: Make sure you get the list of archives generated for the day using the below command. From the below output identify the archivelogs you are going to mine using logminer..
Thursday, August 7, 2008 5
Thursday, August 7, 2008 6 Set the initialization parameter: Set the initialization parameter, UTL_FILE_DIR, in the initialization parameter file. For example, to set UTL_FILE_DIR to use /u02/monish as the directory where the dictionary file is placed, enter the following in the initialization parameter file:
UTL_FILE_DIR = /u02/monish
Thursday, August 7, 2008 7
Create the Directory file: Execute the PL/SQL procedure DBMS_LOGMNR_D.BUILD. Specify a filename for the dictionary and a directory path name for the file. This procedure creates the dictionary file. For example, enter the following to create the file dictionary.ora in /u02/monish:
Thursday, August 7, 2008 8
Copy & Register all Archivelogs: Copy all the archivelog to a path and register all the logs as show below :
Thursday, August 7, 2008 9
Registered logs availability: Now from the below view, make sure you have all the registered logs available for mining.
Thursday, August 7, 2008 10
Find the SCNs: Using the below view's find the first scn and high scn to mine from the registered logs.
Thursday, August 7, 2008 11
LogMiner Session: From the above out gather the details and add it to the below logminer session :
Thursday, August 7, 2008 12
See The Content: As v$logmnr_contents is a temporary view, once you disconnect your session , you won't be able to see the content, so make sure you create a table of all the contents of the view.