ITPub博客

首页 > 数据库 > Oracle > oracle9i 中使用 logmnr

oracle9i 中使用 logmnr

原创 Oracle 作者:guyuexue 时间:2007-11-22 10:57:57 0 删除 编辑
[准备]
1.Package file
@oracle_home/rdbms/admin/dbmslmd.sql

2.Dictionary file build
.initSID.ora file change
utl_file_dir = /oracle/logs <- Dictionary file directory

[logmnr]
1.dic.ora 文件生成
execute dbms_logmnr_d.build(dictionary_filename=>'dict.ora',dictionary_location=>'/oracle/ANT/data4/logmnr');

2.添加需要使用的log文件
execute dbms_logmnr.add_logfile(logfilename=>'/oracle/ANT/arch/archANT161.log', options=>dbms_logmnr.new);
execute dbms_logmnr.add_logfile(logfilename=>'/oracle/ANT/arch/archANT162.log', options=>dbms_logmnr.addfile);
execute dbms_logmnr.add_logfile(logfilename=>'/oracle/ANT/arch/archANT163.log', options=>dbms_logmnr.addfile);
execute dbms_logmnr.add_logfile(logfilename=>'/oracle/ANT/arch/archANT160.log', options=>dbms_logmnr.addfile);
3.开始进行分析
execute dbms_logmnr.start_logmnr(DictFileName=>'/oracle/ANT/data4/logmnr/dict.ora');


select username ,operation,sql_redo
from v$logmnr_contents
where operation='DDL'


SELECT SEG_OWNER,SEG_NAME,OPERATION,TO_CHAR(TIMESTAMP,'YYYY/MM/DD HH24:MI:SS')"TIME"
SQL_REDO,SQL_UNDO
FROM V$LOGMNR_CONTENTS
WHERE SEG_OWNER='SAHRIS'
AND SEG_NAME = 'KAOKE'
AND OPERATION='DELETE'


select sql_undo from v$logmnr_contents
where SEG_NAME = 'KAOKE'
AND seg_owner='SAHRIS'
AND OPERATION='DELETE'

4.dbms_logmnr.end_logmnrA
[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/503782/viewspace-983267/,如需转载,请注明出处,否则将追究法律责任。

上一篇: logminer
下一篇: listener 参考 [转]
请登录后发表评论 登录
全部评论
  • 博文量
    87
  • 访问量
    530423