This is the utility for reading archive log files.As you know archive redo log files saves all the data needed for database recovery and record all changes (INSERT,DELETE,UPDATE) made to the database.
*It gives undo and redo sqls.
1.You should create dbms_logmnr package,the script for creating this is saved in %ORACLE_HOME%\RDBMS\ADMIN\dbmslmd.sql.
To run this:
SQL>@%ORACLE_HOME%\RDBMS\ADMIN\dbmslmd.sql
2.Define exists or not and where exists archive log files,for future registering:
SQL>select name from v$archived_log;
and copy full path of archive log files....
3.Build log miner:
SQL>execute dbms_logmnr_d.build('dictionary.ora','c:\oracle\product\10.2.0\database');
*dictionary.ora file is for defining sql statements (not to be written they in hexadecimal).
4.Register these archive log files with log miner.
SQL>execute dbms_logmnr.add_logfile('c:\oracle\product\flash_recovery_area\mfd\archivelog\2010_08_18\o1_mf_1_1613_66pw6rmd_.arc',dbms_logmnr.addfile);
SQL>execute dbms_logmnr.add_logfile('c:\oracle\product\flash_recovery_area\mfd\archivelog\2010_08_18\o1_mf_1_1614_66pw6zxm_.arc',dbms_logmnr.addfile);
SQL>execute dbms_logmnr.add_logfile('c:\oracle\product\flash_recovery_area\mfd\archivelog\2010_08_18\o1_mf_1_1612_66pw5k2f_.arc',dbms_logmnr.addfile);
5.Make sure that you have registered correctly logs for mining.
select log_id, filename from v$logmnr_logs;
6.Start log miner:
SQL>execute dbms_logmnr.start_logmnr(options => dbms_logmnr.dict_from_online_catalog);
7.As v$logmnr_contents is a temporary view, once you disconnect your session , you won't be able to see the content.So let's create the table for saving it permanently:
SQL>create table logmnr_table as select * from v$logmnr_contents;
8.Stop logminer:
SQL>execute dbms_logmnr.end_logmnr();
No comments:
Post a Comment