怀疑丢失数据,立即在生产环境中分析指定时段的归档。
-
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';
-
阅读(797) | 评论(0) | 转发(0) |