Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to reasonably use logmnr for log mining and minimize the impact on production database

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle Logmnr this tool how to use here is not detailed, you can check the official documents, the Internet is also a lot of documents, find their own. I'll go straight to practical information here.

-- create Oracle directory

Select * from dba_directories

Create directory archivelog_dir as'/ archivelog1/temp_archivelog/'

-- grant read, write on directory archivelog_dir to zhanghui

-- Archive log path information table (tmp_archive_log), mainly to save the path of the log to be mined

Note: to add status flag bits to the table, 0 is unmined and 1 is mined

Create table tmp_archive_log as

Select name, 0 flag from v$archived_log

Where first_time > = to_date ('2012-12-25 1315 1515 5500 mm hh34:mi:ss' hh34:mi:ss')

And first_timedbms_logmnr.dict_from_online_catalog); end; insert into / * + append * / zhanghui.logmnr_contents select timestamp,log_id,seg_owner,seg_name,table_name,username,operation,sql_redo,sql_undo from v$logmnr_contents-- where table_name='' and OPERATION='DELETE'; begin sys.dbms_logmnr.end_logmnr; end; UPDATE zhanghui.tmp_archive_log set flag = 1 where name= vested sql dirarclog; commit; end loop -- after running, call the SMS API close vCur;EXCEPTION WHEN OTHERS THEN ROLLBACK;-- if you report the wrong SMS message, call the SMS API-- dbms_output.put_line (sqlerrm); END proc_logmnr_batch

-- using the operating system to call stored procedure scripts

$cat proc_logmnr_batch.sh

#! / bin/bashsqlplus / as sysdba

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report