oracle之logminer日志分析
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
select sysdate from dual;
执行增删操作
alter system switch logfile; 切换当前的重做日志已以生成归档日志(相当于将之后的操作重新放到另一个日志中)
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss'; 修改格式方便查看
select sequence#,first_time from v$log_history order by first-time desc;
归档日志默认放在/u01/app/oracle/flash_recovery_area/ORCL/archivelog
查看分析日志
select t.FIRST_TIME,t.NAME from v$archived_log t order by t.FIRST_TIME desc;
使用logminer分析数据
conn /as sysdba
execute dbma_logmnr.add_logfile(logfilename=>'/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011-05_04/01_mf_1_12_6w0mmgmd_.arc',options=>dbms_logmnr.new);
启动logminer
execute dbms_logmnr.start_logmnr (options=>dbms_logmnr.dict_from_online_catalog);
把分析数据放入表中,并把表的权限授权给普通用户
create table logminer_20110504 tablespace BANK_TBS as select * from v$logmnr_contents;
grant select on logminer_20110504 to bankuser;
结束logminer分析
execute dbms_logmnr.end_logmnr;
查看分析日志结果
select t.timestamp,t.sql_redo,t.sql_undo from sys.logminer_20110504 t where t.seg_owner='BANKUSER' and t.sql_undo is not null;
最新文章
- C#批量插入数据到Sqlserver中的四种方式
- 如何封装JS ----》JS设计模式《------ 封装与信息隐藏
- [python]使用virtualenv处理python版本问题
- Road Construction(poj 3352)
- ByteBuffer
- 为VirtualBox里的Linux系统安装增强功能
- SRM 511 DIV1 500pt(DP)
- 项目打包 weblogic部署
- linux安装python使用的MySQLdb
- dedecms的入门使用
- RGB與CIELAB色彩空間轉換
- UTF编码检测
- Java 异常处理笔记
- JavaScript入门之Canvas(一): 2D Context
- Java面试题汇总
- Eclipse的调试功能的10个小窍门[转]
- AttributeError: module 'enum' has no attribute 'IntFlag'
- Linux下crontab计划任务使用详解
- eclipse导入maven项目, A resource exists with a different case: '/xxx'.
- linux用法总结