--根据发生问题时间点查找归档文件
select first_time,NAME from gvarchived_log where first_time\>='2016-03-15 17:00:00' and first_time\<='2016-03-15 21:00:00';
2016-03-15 17:23:55 +ARCH/jxdb/archivelog/2016_03_15/thread_1_seq_41588.4060.906577337
2016-03-15 17:29:51 +ARCH/jxdb/archivelog/2016_03_15/thread_2_seq_46409.4231.906577337
--加载日志:
exec dbms_logmnr.add_logfile(LogFileName=\>'+ARCH/jxdb/archivelog/2016_03_15/thread_1_seq_41588.4060.906577337', Options=\>dbms_logmnr.new);
exec dbms_logmnr.add_logfile(LogFileName=\>'+ARCH/jxdb/archivelog/2016_03_15/thread_2_seq_46409.4231.906577337',Options=\>dbms_logmnr.addfile);
--启动:
exec sys.dbms_logmnr.start_logmnr(options =\> sys.dbms_logmnr.dict_from_online_catalog);
--检查:
--select count(\*) from vlogmnr_contents where operation IN ('DDL') and seg_owner='ADMIN' and TABLE_NAME = 'TAR_STATION';
select count(*) from vlogmnr_contents where TABLE_NAME = 'TAR_STATION';
--创建临时表:
create table log_jyc_TAR_STATION as select OS_USERNAME,MACHINE_NAME,timestamp,commit_timestamp,seg_owner,seg_name,seg_type_name,table_space,row_id,session_info,username,operation,sql_redo,sql_undo
from vlogmnr_contents where TABLE_NAME = 'TAR_STATION';
--结束挖掘:
EXEC SYS.DBMS_LOGMNR.END_LOGMNR;
--检查记录
select * from log_jyc_TAR_STATION;
--删除临时表
drop table log_jyc_TAR_STATION;
--检查监听:
JXDB1:/u01/grid/diag/tnslsnr/JXDB1/listener/trace$
grep "15-MAR-2016 18:4" listener.log > 20160315_1840_2.txt
D:\logminer>grep .exe 监听日志.txt > exe.txt
D:\logminer>grep "PROGRAM=C:" 监听日志.txt > c.txt
查到的session_info为空处理:
1.select supplemental_log_data_min,supplemental_log_data_pk,supplemental_log_data_ui from vdatabase;
alter database drop supplemental log data (primary key, unique index) columns;
alter database add supplemental log data;
....过30分钟
2、将redo日志文件添加到logmnr分析日志列表
exec sys.dbms_logmnr.add_logfile(logfilename=\>'redo日志1', options=\>sys.dbms_logmnr.new);
exec sys.dbms_logmnr.add_logfile(logfilename=\>'redo日志2', options=\>sys.dbms_logmnr.addfile);
exec sys.dbms_logmnr.add_logfile(logfilename=\>'redo日志n', options=\>sys.dbms_logmnr.addfile);
3、启动并分析redo日志
exec sys.dbms_logmnr.start_logmnr(options =\> sys.dbms_logmnr.dict_from_online_catalog);
4、查看分析结果
spool c:\\log.txt
select \* from vlogmnr_contents ;
spool off
5、停止logmnr
exec sys.dbms_logmnr.end_logmnr
6、取消补充日志
alter database drop supplemental log data (primary key) columns;
alter database drop supplemental log data (unique) columns;
alter database drop supplemental log data;
logminer挖掘日志归档查找问题
好记忆不如烂笔头abc2024-11-27 8:54
相关推荐
shiming88799 分钟前
C/C++链接数据库(MySQL)超级详细指南前端白袍10 分钟前
C语言:C语言实现对MySQL数据库表增删改查功能Elastic 中国社区官方博客13 分钟前
Elasticsearch:Retrievers 介绍蓝桉柒728 分钟前
安装数据库客户端工具南城花随雪。1 小时前
Redis(非关系型数据库)详细介绍冰红茶兑滴水1 小时前
MySQL 内置函数鸿·蒙1 小时前
【PTA】【数据库】【SQL命令】编程题2J.P.August1 小时前
Oracle RAC 环境下数据文件误建在本地目录的处理过程ThisIsClark1 小时前
【后端面试总结】MySQL面试总结对酒当歌丶人生几何1 小时前
Mybatis控制台打印SQL执行信息(执行方法、执行SQL、执行时间)