[oracle@localhost xuhm]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Mon Jan 28 10:22:28 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter system switch logfile;
System altered.
SQL> create table test2 as select * from dba_users;
Table created.
SQL> select count(*) from test2;
COUNT(*)
----------
31
SQL> select group#,status from v$log where status='CURRENT';
GROUP# STATUS
---------- ----------------
1 CURRENT
SQL> select member from v$logfile where group#=1;
MEMBER
--------------------------------------------------------------------------------
/oracle/oradata/xuhm/redo01.log
---------需要分析日志的路劲
exec dbms_logmnr.add_logfile('+REDODG/arch/1_207924_913652937.dbf',dbms_logmnr.new);
exec dbms_logmnr.add_logfile('+REDODG/arch/2_219979_913652937.dbf',dbms_logmnr.addfile);
exec dbms_logmnr.add_logfile('+REDODG/arch/1_207925_913652937.dbf',dbms_logmnr.addfile);
--------开始日志分析
exec dbms_logmnr.start_logmnr(options=>dbms_logmnr.dict_from_online_catalog+dbms_logmnr.committed_data_only+dbms_logmnr.no_rowid_in_stmt);
SQL> select count(*) from v$logmnr_contents;
COUNT(*)
----------
144
-----------在视图v$logmnr_contents可以查看刚才所create table的动作。
select sql_redo,sql_undo from v$logmnr_contents where table_name='EMP';
exec dbms_logmnr.add_logfile('+REDODG/arch/1_207924_913652937.dbf',dbms_logmnr.removefile);
exec dbms_logmnr.add_logfile('+REDODG/arch/2_219979_913652937.dbf',dbms_logmnr.removefile);
exec dbms_logmnr.add_logfile('+REDODG/arch/1_207925_913652937.dbf',dbms_logmnr.removefile);
----------结束日志分析:
SQL> exec dbms_logmnr.end_logmnr
PL/SQL procedure successfully completed.