通过logmnr找到被修改前的存储过程

1.找到存储过程被修改时的归档日志

SELECT NAME FROM V$ARCHIVED_LOG WHERE FIRST_TIME BETWEEN TO_DATE('20191118080000','YYYYMMDDHH24MISS') AND TO_DATE('20191118081000','YYYYMMDDHH24MISS');

2.使用logmnr

EXEC  SYS.DBMS_LOGMNR.ADD_LOGFILE('/archlog/xxxxx.dbf');

EXEC  SYS.DBMS_LOGMNR.START_LOGMNR(OPTIONS=>16);

SELECT * FROM V$LOGMNR_CONTENTS  WHERE lower(TABLE_NAME)='source$' 

exec  SYS.DBMS_LOGMNR.END_LOGMNR;

3.如果要查是谁更改的,使用如下sql

如果用户的登录时间比较早,登录信息并未在你进行logmnr,OS_USERNAME和MACHINE_NAME是UNKNOW状态,此时可以结合V$ACTIVE_SESSION_HISTORY查询

从第二步找到SESSION_ID和SESSION_SERIAL#,使用如下语句查找

SELECT * FROM V$ACTIVE_SESSION_HISTORY WHERE SESSION_ID=27724 AND SESSION_SERIAL#= 62815;

 

 

 

posted @ 2019-11-18 10:26  monkey6  阅读(225)  评论(0编辑  收藏  举报