Oracle links:

Using LogMiner
1.date format
ALTER SESSION SET NLS_DATE_FORMAT = 'dd-mon-yyyy hh24:mi:ss';
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
Requirement:
■ Source and mining database
– Both the source database and the mining database must be running on the same hardware platform.
– The mining database can be the same as, or completely separate from, the source database.
– The mining database must run the same release or a later release of the Oracle Database software as the source database.
– The mining database must use the same character set (or a superset of the character set) used by the source database.
■ LogMiner dictionary
– The dictionary must be produced by the same source database that generates the redo log files that LogMiner will analyze.
■ All redo log files:
– Must be produced by the same source database.
– Must be associated with the same database RESETLOGS SCN.
– Must be from a release 8.0 or later Oracle Database. However, several of the LogMiner features introduced as of release 9.0.1 work only with redo log files produced on an Oracle9i or later database.
LogMiner does not allow you to mix redo log files from different databases or to use a dictionary from a different database than the one that generated the redo log files to be analyzed.

Steps in a Typical LogMiner Session
1.SET DATE FORMAT
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
SELECT TO_CHAR(SYSDATE,'YYYY-MM-DD HH24:MI:SS') FROM DUAL;
2.Enable Supplemental Loggining
At the very least,enable minimal supplemental logging, as follows:
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
3.Extract a LogMiner Dictionary --any method
3.1Using the Online Catalog
This is the most efficient and easy-to-use option.
EXECUTE DBMS_LOGMNR.START_LOGMNR(-
OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG);
3.2Extracting a LogMiner Dictionary to the Redo Log File
To extract a LogMiner dictionary to the redo log files, the database must be open and in ARCHIVELOG mode and archiving must be enabled.
EXECUTE DBMS_LOGMNR_D.BUILD( -
OPTIONS=> DBMS_LOGMNR_D.STORE_IN_REDO_LOGS);
3.3Extracting the LogMiner Dictionary to a Flat File
Be sure that no DDL operations occur while the dictionary is being built.
a. To specify a directory, set the initialization parameter, UTL_FILE_DIR, in the initialization parameter file.
For example, to set UTL_FILE_DIR to use /oracle/database as the directory where the dictionary file is placed, place the following in the initialization
parameter file:UTL_FILE_DIR = /oracle/database
Remember that for the changes to the initialization parameter file to take effect,
you must stop and restart the database.
b. STARTUP
c. Execute the PL/SQL procedure DBMS_LOGMNR_D.BUILD. Specify a file name for the dictionary and a directory path name for the file. This procedure creates the dictionary file. For example, enter the following to create the file dictionary.ora in /oracle/database:
EXECUTE DBMS_LOGMNR_D.BUILD('dictionary.ora', -
'/oracle/database/', -
DBMS_LOGMNR_D.STORE_IN_FLAT_FILE);
You could also specify a file name and location without specifying the STORE_IN_FLAT_FILE option. The result would be the same
3.4Redo Log File Options
a.■ Automatically
LogMiner will use the database control file to find and add redo log files that
satisfy your specified time or SCN range to the LogMiner redo log file list. For example:
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
EXECUTE DBMS_LOGMNR.START_LOGMNR( -
STARTTIME => '01-Jan-2003 08:30:00', -
ENDTIME => '01-Jan-2003 08:45:00', -
OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + -
DBMS_LOGMNR.CONTINUOUS_MINE);
b.■ Manually
For example, enter the following to specify /oracle/logs/log1.f :
EXECUTE DBMS_LOGMNR.ADD_LOGFILE( -
LOGFILENAME => '/oracle/logs/log1.f', -
OPTIONS => DBMS_LOGMNR.NEW);
If add more redo log files. For example, enter the following to add /oracle/logs/log2.f:
EXECUTE DBMS_LOGMNR.ADD_LOGFILE( -
LOGFILENAME => '/oracle/logs/log2.f', -
OPTIONS => DBMS_LOGMNR.ADDFILE);
4.Specify Redo Log Files for Analysis
a.Ensure instance is open.
b.Create a list of redo log files

EXECUTE DBMS_LOGMNR.ADD_LOGFILE( -
LOGFILENAME => '/oracle/logs/log1.f', -
OPTIONS => DBMS_LOGMNR.NEW);
c.Add more redo logs
EXECUTE DBMS_LOGMNR.ADD_LOGFILE( -
LOGFILENAME => '/oracle/logs/log2.f', -
OPTIONS => DBMS_LOGMNR.ADDFILE);
you could simply enter the following:
EXECUTE DBMS_LOGMNR.ADD_LOGFILE( -
LOGFILENAME=>'/oracle/logs/log2.f')
d. If desired, remove redo log file
EXECUTE DBMS_LOGMNR.REMOVE_LOGFILE( -
LOGFILENAME => '/oracle/logs/log2.f');
5.Start LogMiner
Execute the DBMS_LOGMNR.START_LOGMNR procedure to start LogMiner
a.If you are specifying the name of a flat file LogMiner dictionary
EXECUTE DBMS_LOGMNR.START_LOGMNR( -
DICTFILENAME =>'/oracle/database/dictionary.ora');
b.If you are not specifying a flat file dictionary name

EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS =>
DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG);
6.Query V$LOGMNR_CONTENT
Filtering Data by Time

ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
EXECUTE DBMS_LOGMNR.START_LOGMNR( -
DICTFILENAME => '/oracle/database/dictionary.ora', -
STARTTIME => '01-Jan-2008 08:30:00', -
ENDTIME => '01-Jan-2008 08:45:00'-
OPTIONS => DBMS_LOGMNR.CONTINUOUS_MINE);
SELECT *
FROM v$logmnr_contents;
WHERE sql_redo LIKE '%%';
7.End the LogMiner Session
EXECUTE DBMS_LOGMNR.END_LOGMNR

Using LogMiner相关推荐

  1. LogMiner日志分析工具的使用

    1.安装logminer:       要安装LogMiner工具,必须首先要运行下面这样两个脚本,       $ORACLE_HOME/rdbms/admin/dbmslm.sql       $ ...

  2. oracle logminer全解析

    今天写篇原创的,把在工作中遇到的logminer问题总结下 (1)简介: logminer 工具即可以用来分析在线,也可以用来分析离线日志文件,即可以分析本身自己数据库的重作日志文件,也可以用来分析其 ...

  3. Oracle Logminer 做数据恢复 说明示例

    在IBM DBA 小荷的blog上看到一个用Logminer 做数据恢复的例子. 虽然对Logminer 也了解一点,但是用Logminer 做恢复还真没用过,所以也测试一下. 原文链接地址如下: 客 ...

  4. 使用logminer进行审计 Audit by using logminer

    2019独角兽企业重金招聘Python工程师标准>>> 使用logminer进行审计 本文简述 logminer 工具的介绍,日志挖掘的配置.限制,以及日志挖掘的过程. 在使用 Lo ...

  5. oracle log.xml分析,怎么在alert目录下的log.xml中关闭logminer的相关操作日志? — oracle-tech...

    Oracle版本10g-19c中,使用了logminer,但是在$ORACLE_SID/alert的目录下产生了大量的log_x.xml [email protected] alert]$ cd /o ...

  6. oracle离线文档查dbms_小白小记-logminer工具分析离线归档日志

    一.安装logminer工具 SQL>@$ORACLE_HOME/rdbms/admin/dbmslm.sq SQL>@$ORACLE_HOME/rdbms/admin/dbmslmd.s ...

  7. 3、使用Oracle Logminer同步Demo

    使用Oracle Logminer同步Demo 1 Demo介绍 1.1 Demo设想 前面介绍了Oracle LogMiner配置使用以及使用LogMiner进行解析日志文件性能,在这篇文章中将利用 ...

  8. Logminer实战

    相信许多DBA同学都曾遇到过这种情况,由于各种各样的原因,必须对数据库做不完全恢复:但又不确定应该恢复到哪个时间点或SCN才合适,因而反复的执行不完全恢复,悲剧掉了一地,中枪的有木有?温馨提示下,在生 ...

  9. oracle的日志分析工具,oracle日志分析工具LogMiner使用(实战)

    要安装LogMiner工具,必须首先要运行下面这样两个脚本,这两个脚本必须均以SYS用户身份运行.其中第一个脚本用来创建DBMS_LOGMNR包,该包用来分析日志文件.第二个脚本用来创建DBMS_LO ...

  10. 数据库进阶系列之三:使用Logminer解析Oracle日志

    有时候我们会被问到一个数据库对象的创建时间,这简单,可以查user_objects视图,不过如果再深入些,这个表的数据什么时候被什么人修改过?这个在没有工具帮助的情况下是不容易回答的,我们只知道这些记 ...

最新文章

  1. Login failed with an access denied error.
  2. 【杂谈】野生在左 科班在右——数据结构学习誓师贴
  3. linux下Intellij Idea 14的安装
  4. android 设置点击ProgressDialog外的区域不消失
  5. poj1463 Strategic game
  6. JavaScript常用正则表达式收集
  7. redis的分布式解决方式--codis
  8. MySQL中实现连续日期内数据统计,缺省天数0补全
  9. 机器学习算法_机器学习之EM算法和概率图模型
  10. 图解Team Foundation Server 2013系列
  11. tensorflow Dataset操作
  12. 20200703每日一句
  13. MFC开发上位机经验
  14. 如何批量将 ppt 后缀格式的演示文稿转换为 pptx 格式
  15. NATS_08:NATS客户端Go语言手动编写
  16. IDEA生成springboot项目的两种方式
  17. 友情检测北京某大学网站
  18. 无限循环小数四则运算_无尽小数的公理及其四则运算.doc
  19. c语言提取字符串里面的数字,一个截取字符串中数字的函数
  20. 基于随机森林、svm、CNN机器学习的风控欺诈识别模型

热门文章

  1. 【白皮书分享】2020中国房地产白皮书.pdf(附下载链接)
  2. 【报告分享】2020快手短视频直播电商营销增长宝典.pdf(附下载链接)
  3. 哈佛大学推荐:让自己变幸福的20件小事(值得收藏)
  4. 深度学习福利入门到精通第一讲——LeNet模型
  5. 【干货】从点击率预估的视角看腾讯社交广告算法大赛
  6. 第一周周冠军带你解析赛题,尝试广告算法新思路
  7. python小程序源代码_【程序源代码】微信商城小程序
  8. apache http server 停止工作_Springboot以Tomcat为容器实现http重定向到https的两种方式
  9. python数据分析实况_Python数据分析实战:降雨量统计分析报告分析
  10. 强化学习 ---baselines项目之 Atari游戏的网络结构解析