#!/bin/bash
sqlplus / as sysdba << EOF
spool spool.log
execute dbms_logmnr_d.build(dictionary_filename => 'logminer_dict.dat',dictionary_location => '/u01/log',options => dbms_logmnr_d.store_in_flat_file);
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
select sysdate from dual;
execute dbms_logmnr.add_logfile('/u01/app/oracle/oradata/orcl/redo1.log',DBMS_LOGMNR.new );
execute dbms_logmnr.add_logfile('/u01/app/oracle/oradata/orcl/redo2.log',DBMS_LOGMNR.addfile);
execute dbms_logmnr.add_logfile('/u01/app/oracle/oradata/orcl/redo3.log',DBMS_LOGMNR.addfile);
execute dbms_logmnr.add_logfile('/u01/app/oracle/oradata/orcl/redo4.log',DBMS_LOGMNR.addfile);
select filename from v\$logmnr_logs;
execute dbms_logmnr.start_logmnr(dictfilename => '/u01/log/logminer_dict.dat');
EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS =>DBMS_LOGMNR.DDL_DICT_TRACKING );
SELECT sql_redo FROM v\$logmnr_contents where username='EISOO';
EXECUTE DBMS_LOGMNR.END_LOGMNR;
spool off
quit
EOF