WEB开发网
开发学院数据库Oracle 使用Logmnr方法分析数据库日志 阅读

使用Logmnr方法分析数据库日志

 2007-06-01 12:32:23 来源:WEB开发网   
核心提示: 3、使用logMiner进行日志分析1).无限制条件,即用数据字典文件对要分析的日志文件所有内容做分析SQL> execute dbms_logmnr.start_logmnr(DictFileName => 'G:oraclelogsdict.ora');PL

3、使用logMiner进行日志分析

1).无限制条件,即用数据字典文件对要分析的日志文件所有内容做分析

SQL> execute dbms_logmnr.start_logmnr(DictFileName => 'G:oraclelogsdict.ora');
PL/SQL procedure successfully completed

2).带限制条件,可以用scn号或时间做限制条件,也可组合使用

--分析日志列表中时间从07.02.28从10:00到15:00的内容

SQL> execute dbms_logmnr.start_logmnr(startTime => to_date('20070228100000','yyyy-mm-dd hh24:mi:ss'),endTime => to_date('20070228150000','yyyy-mm-dd hh24:mi:ss'),DictFileName => 'G:oraclelogsdict.ora');
PL/SQL procedure successfully completed
dbms_logmnr.start_logmnr函数的原型为:
PROCEDURE start_logmnr(
startScn INNUMBER default 0 ,
endScnINNUMBER default 0,
startTimeINDATE default '',
endTime INDATE default '',
DictFileNameINVARCHAR2 default '',
Options INBINARY_INTEGER default 0 );

4.分析后释放内存

SQL> execute dbms_logmnr.end_logmnr;

PL/SQL procedure successfully completed

5.其它

1).删除日志分析文件

exec dbms_logmnr.add_logfile('G:ORACLEORADATAORADBSPREDO04.LOG',dbms_logmnr.removefile);

三、查看LogMiner工具分析结果

SQL> select * from dict t where t.table_name like '%LOGMNR%';--看所有与logmnr相关的视图
TABLE_NAME COMMENTS
------------------------------ --------------------------------------------------------------------------------
GV$LOGMNR_CALLBACK Synonym for GV_$LOGMNR_CALLBACK
GV$LOGMNR_CONTENTS Synonym for GV_$LOGMNR_CONTENTS
GV$LOGMNR_DICTIONARY Synonym for GV_$LOGMNR_DICTIONARY
GV$LOGMNR_LOGFILESynonym for GV_$LOGMNR_LOGFILE
GV$LOGMNR_LOGSSynonym for GV_$LOGMNR_LOGS
GV$LOGMNR_PARAMETERS Synonym for GV_$LOGMNR_PARAMETERS
GV$LOGMNR_PROCESSSynonym for GV_$LOGMNR_PROCESS
GV$LOGMNR_REGIONSynonym for GV_$LOGMNR_REGION
GV$LOGMNR_SESSIONSynonym for GV_$LOGMNR_SESSION
GV$LOGMNR_STATS Synonym for GV_$LOGMNR_STATS
GV$LOGMNR_TRANSACTIONSynonym for GV_$LOGMNR_TRANSACTION
V$LOGMNR_CALLBACKSynonym for V_$LOGMNR_CALLBACK
V$LOGMNR_CONTENTSSynonym for V_$LOGMNR_CONTENTS
V$LOGMNR_DICTIONARYSynonym for V_$LOGMNR_DICTIONARY
V$LOGMNR_LOGFILESynonym for V_$LOGMNR_LOGFILE
V$LOGMNR_LOGS Synonym for V_$LOGMNR_LOGS
V$LOGMNR_PARAMETERSSynonym for V_$LOGMNR_PARAMETERS
V$LOGMNR_PROCESSSynonym for V_$LOGMNR_PROCESS
V$LOGMNR_REGION Synonym for V_$LOGMNR_REGION
V$LOGMNR_SESSIONSynonym for V_$LOGMNR_SESSION
TABLE_NAME COMMENTS
------------------------------ --------------------------------------------------------------------------------
V$LOGMNR_STATSSynonym for V_$LOGMNR_STATS
V$LOGMNR_TRANSACTION Synonym for V_$LOGMNR_TRANSACTION

Tags:使用 Logmnr 方法

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接