怀疑丢失数据,立即在生产环境中分析指定时段的归档。
-
col name for a50
-
select thread#,sequence#,dest_id,first_time,name from v$archived_log where first_time>sysdate-3 order by first_time;
-
-
create or replace procedure my_add_logfiles (in_start_time in date, in_end_time in date) as
-
cursor c_log is
-
select name from v$archived_log
-
where dest_id=1 and first_time >= in_start_time and first_time<=in_end_time;
-
count pls_integer := 0;
-
my_option pls_integer := dbms_logmnr.new;
-
begin
-
for c_log_rec in c_log
-
loop
-
dbms_logmnr.add_logfile(logfilename => c_log_rec.name,
-
options => my_option);
-
my_option := dbms_logmnr.addfile;
-
dbms_output.put_line('added logfile ' || c_log_rec.name);
-
end loop;
-
end;
-
/
-
-
alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
-
execute my_add_logfiles(in_start_time => '2021-11-22 06:01:53',in_end_time=>'2021-11-24 06:20:05');
-
-
-
execute dbms_logmnr.start_logmnr(-
-
starttime => '2021-11-22 06:01:53', -
-
endtime=>'2021-11-24 06:20:05',-
-
options=>dbms_logmnr.dict_from_online_catalog -
-
dbms_logmnr.committed_data_only -
-
dbms_logmnr.print_pretty_sql );
-
create table a.logminer1 as select * from v$logmnr_contents ;
-
select sql_redo from v$logmnr_contents where seg_name='acct_tab';
-
阅读(696) | 评论(0) | 转发(0) |