安裝logminer:
1,建立dbms_logmnr包:
sql>
@$oracle_home\rdbms\admin\dbmslm.sql
sql>
@$oracle_home\rdbms\admin\dbmslmd.sql
3,初始化引數utl_file_dir,指定分析資料的存放處,本例:e:\logminer
sql>
alter
system
setutl_file_dir='
e:\logminer
'scope
=spfile;
4,重啟資料庫
sql>
shutdown
immediate;
sql>
startup;
5,建立資料字典檔案:
sql>
execute
dbms_logmnr_d.build(dictionary_filename
=>
'sqltrace.ora
',dictionary_location
=>
'e:\logminer');
使用logminer:
6,建立日誌分析表
sql>
execute
dbms_logmnr.add_logfile(options
=>
dbms_logmnr.new,logfilename
=>
'd:\archive\arc52218_0621258857.001');
7,新增用於分析的日誌檔案。(如果需新增的日誌檔案較多,請盡情使用excel進行預先排版)
sql>
execute
dbms_logmnr.add_logfile(options
=>
dbms_logmnr.addfile,logfilename
=>
'd:\archive\arc52144_0621258857.001');
刪除的方法:
execute
dbms_logmnr.add_logfile(options
=>
dbms_logmnr.removefile,logfilename
=>
'd:\archive\arc52144_0621258857.001');
8,啟動logminer進行分析(檢視v$archived_log可以查出相應的scn)
無限制條件:
execute
dbms_logmnr.start_logmnr(dictfilename
=>
'e:\logminer\sqltrace.ora');
有限制條件:
execute
dbms_logmnr.start_logmnr(dictfilename
=>
'e:\logminer\sqltrace.ora
',starttime
=>
to_date(
'20090329 01:00:00',
'yyyymmdd hh24:mi:ss
'),endtime
=>
to_date(
'20090330 01:00:00',
'yyyymmdd hh24:mi:ss
'));
execute
dbms_logmnr.start_logmnr(dictfilename
=>
'e:\logminer\sqltrace.ora
',startscn
=>
30,endscn
=>
40);
9,參看分析結果:
四個表:
v$logmnr_dictionary --使用的資料字典檔案
v$logmnr_parameters --當前logminer設定的引數
v$logmnr_logs --分析的日誌檔案
v$logmnr_contents --日誌檔案的內容
如查詢所有delete了sroute表的操作:
select
*from
v$logmnr_contents
where
operation='
delete
'and
table_name='
sroute';
10、結束分析
sql>
execute
dbms_logmnr.end_logmnr;
Vegas原創 sendkeys例項
需求 將excel檔更新提醒關閉,並另存為a xls.dimwshset wsh wscript.createobject wscript.shell wsh.run 每日生產狀況表.xls wscript.sleep 1000 wsh.sendkeys wscript.sleep 100wsh.s...
Vegas原創 TextBox換行
看見網上好多人說textbox換行後,資料庫或是label顯示不出來,我今天給大家介紹乙個小小的秘訣吧 strsubject txttitle.text.trim replace system.environment.newline,試一下 附 system.environment成員和方法 1.獲...
Vegas原創 sendkeys例項
需求 將excel檔更新提醒關閉,並另存為a xls.dimwsh setwsh wscript.createobject wscript.shell wsh.run 每日生產狀況表.xls wscript.sleep 1000 wsh.sendkeys wscript.sleep 100wsh.s...