Oracle根据日志文件查询SQL

begin 
SYS.DBMS_LOGMNR.ADD_LOGFILE('C:\oracle\oradata\jhoracle\REDO01.LOG', --这个文件名你要查询你自己机器的名字
sys.dbms_logmnr.New); 
end; 
 
select min(low_time),  max(high_time), 
      min(low_scn),  max(next_scn) -1 
from V$logmnr_logs; 
 
begin 
SYS.DBMS_LOGMNR.START_LOGMNR(Options => sys.dbms_logmnr.DICT_FROM_ONLINE_CATALOG); 
end; 
 
Select 
SCN, 
timestamp, 
sql_redo, 
session# session_num, 
username, 
session_info 
From V$LOGMNR_CONTENTS where sql_redo like '%update%'
Order by 1; 
 
 
begin 
SYS.DBMS_LOGMNR.END_LOGMNR(); 
end;

你可能感兴趣的:(大数据云计算)