Thursday, 28 June 2018

GENERATING LOGMINER

                  

1.make a directory 'utldir' at any location.

2.define that directory in pfile,and if database following spfile than create spfile from pfile.

initorcl.ora

utl_file_dir=’/u01/app/oracle/oradata/orcl/utldir'

create spfile from pfile.

show parameter utl_file_dir

3.Then build a dictionary in that directory through following command:
 
   EXEC DBMS_LOGMNR_D.BUILD (‘b.dict’,’/u01/app/oracle/oradata/orcl/utldir');

we can also create it like this:

begin
   DBMS_LOGMNR_D.BUILD (‘b.dict’,’/u01/app/oracle/oradata/orcl/utldir');
end;
/

4.Than add a logfile to DBMS_LOGMNR

   EXECUTE DBMS_LOGMNR.ADD_LOGFILE (’/u01/app/oracle/oradata/orcl/arch/1_1052532.dbf’);

5.Start logmnr

   EXEC DBMS_LOGMNR.START_LOGMNR (dictfilename=>‘/u01/app/oracle/oradata/orcl/utldir/b.dict’);

LOGMINER is started.

To view logminer -- desc v$logmnr_contents;

A log miner is session dependend,so it's better to save it by table.
eg: create table tablename as select * from logmnr_contents;

No comments:

Post a Comment