这里只记录下有条件的情况如何使用

BEGIN

dbms_logmnr.start_logmnr(

dictfilename => '/u01/arch/logminer_dict.ora',
          starttime => to_date('20090808 22:00:00','yyyymmdd hh24:mi:ss'),
          endtime => to_date('20090808 23:40:00','yyyymmdd hh24:mi:ss')

);

END;

/

logminer中v$logmnr_contents实际也是根据v$session等视图对出来的,跟自己做的方法一样,所以想要在session_info字段中有client_info这个里有IP,就必须使用登录触发器,

登录触发器:

CREATE OR REPLACE TRIGGER on_logon_trigger
  AFTER logon ON DATABASE
BEGIN
  dbms_application_info.set_client_info(sys_context('userenv',
                                                    'ip_address'));
END;

在那里添加IP,这样v$session中就有IP了,项目没问题是因为使用了登录触发器,也这么做了,所以有IP地址,但是session_info有时会有unknown的情况,原因查找可能如下:

Problem:
======== You have just built the LogMiner dictionary and started LogMiner. You query
V$LOGMNR_CONTENTS expecting to see the USERNAME and SESSION_INFO for some
particular redo or undo operation. However, the USERNAME field is NULL.
This is NOT a recursive operation, and the USERNAME column is expected to
contain a non-null value. Solution:
========= This can result from your database parameter settings and also from the method
you are using to mine redo logs using LogMiner. 1. Ensure that database was in minimum supplemental logging at the time that
the redo information was created: SQL> SELECT name, supplemental_log_data_min FROM v$database; NAME SUPPLEME
------------------------------ --------
M10202WA YES 2. Ensure that all archive redo logs containing the necessary redo
information have been added to the LogMiner session. 3. Ensure that the COMPATIBLE initialization parameter is set to 8.1.0
or higher. SQL> show parameter compatible NAME TYPE VALUE
------------------------------------ ----------- ----------
compatible string 10.2.0.2.0 4. For Oracle8i and Oracle9i only: ensure that the TRANSACTION_AUDITING
initialization parameter is set to TRUE (default). SQL> show parameter transaction_autiting NAME TYPE VALUE
------------------------------------ ----------- ----------
transaction_auditing boolean TRUE Explanation:
============ 1. If minimum supplemental logging was not active at the time when the
redo records were created, then LogMiner won't be able to obtain all
the required information. The Oracle10g Database Utilities manual mentions: "By default, Oracle Database does not provide any supplemental logging,
which means that by default LogMiner is not usable. Therefore, you must
enable at least minimal supplemental logging prior to generating log
files which will be analyzed by LogMiner." So, we have to Enable supplemental logging by using a command like this then
the redolog that will be generated will contain the information:
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA 2. LogMiner does not store USERNAME and SESSION_INFO for all redo records.
In order to have all necessary information available, LogMiner must have
the appropriate logs added to the session. If the transaction being
tracked spans multiple logs and you have not specified all archived redo
logs, then LogMiner won't be able to obtain the value for the USERNAME.
Also, if the log containing the initial user connection was not added,
the SESSSION_INFO won't be available to LogMiner. 3. LogMiner was first available in Oracle8i (8.1.x). If COMPATIBLE is set
below 8.1.0 you will not have access to its full functionality. 4. In Oracle9i and below, TRANSACTION_AUDITING is set to TRUE by default.
It generates a redo record containing the user logon name, user name,
session id, and some operating system (including client) information.
When transaction_auditing is set to FALSE, this redo record is not written
and the user information is not available to LogMiner. References:
=========== B14215-01 - Oracle Database Utilities 10g Release 2 (10.2) Bug:1959969 "LOGMNR SHOWING NULL VALUES FOR USERNAME COLUMN IN
V$LOGMNR_CONTENTS
Bug:2998128 "NO INFORMATION ON V$LOGMNR_CONTENTS.SESSION_INFO FOR SOME ENT"

oracle rac logminer有限制用法及session_info为unknown情况的更多相关文章

  1. Oracle RAC的五大优势及其劣势

    Oracle RAC的五大优势及其劣势 不同的集群产品都有自己的特点,RAC的特点包括如下几点: 双机并行.RAC是一种并行模式,并不是传统的主备模式.也就是说,RAC集群的所有成员都可以同时接收客户 ...

  2. Oracle RAC 常用维护工具和命令

    Oracle RAC 常用维护工具和命令 分类: Oracle Basic Knowledge Oracle RAC2010-03-09 01:02 13987人阅读 评论(6) 收藏 举报 orac ...

  3. Oracle RAC学习笔记02-RAC维护工具集

    Oracle RAC学习笔记02-RAC维护工具集 RAC维护工具集 1.节点层 2.网络层 3.集群层 4.应用层 本文实验环境: 10.2.0.5 Clusterware + RAC 11.2.0 ...

  4. Oracle RAC环境下定位并杀掉最终阻塞的会话

    实验环境:Oracle RAC 11.2.0.4 (2节点) 1.模拟故障:会话被级联阻塞 2.常规方法:梳理找出最终阻塞会话 3.改进方法:立即找出最终阻塞会话 之前其实也写过一篇相关文章: 如何定 ...

  5. 转载:Oracle RAC日常基本维护命令

    本文转载自: https://blog.csdn.net/tianlesoftware/article/details/5358573 Oracle RAC日常基本维护命令 好文转载, Oracle  ...

  6. 更改oracle RAC public ip,vip,scan ip和private ip

    更改oracle RAC public ip,vip,scan ip和private ip oifcfg - Oracle 接口配置工具 用法:  oifcfg iflist [-p [-n]]    ...

  7. 【Oracle 集群】Linux下Oracle RAC集群搭建之Oracle DataBase安装(八)

    Oracle 11G RAC数据库安装(八) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总 ...

  8. 【Oracle 集群】Linux下Oracle RAC集群搭建之基本测试与使用(九)

    Oracle 11G RAC数据库安装(九) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总 ...

  9. Oracle RAC客户端tnsnames.ora相关配置及测试

    1.Oracle RAC服务端/etc/hosts部分内容如下 2.查看服务端的local_listener和remote_listener参数 3.客户端tnsnames.ora配置参考 3.1 1 ...

随机推荐

  1. shopnc 商城源码阅读笔记-缓存技术

    缓存方式 : 从 shopnc 的缓存驱动目录 /framework/cache里已有的实现类来看,shopnc支持以下5种缓存方式 apc Eaccelerator file memcache xc ...

  2. ECshop网点程序优化-后台添加类目自动选择上次父类目并计算Sort Order

    如果在ECshop后台批量添加过大量类目的人都能体会到是多么的不方便(这点还是要说一下ECshop的产品经理,细节上还是要多注意),每次添加都需要在几百个类目里面找到要添加的父类目也是一个麻烦事,比如 ...

  3. Centos6.5下rsync文件同步安装配置及遇到的问题解决方法

    实验节点如下: 源节点:192.168.0.111 备份节点:192.168.0.112 ------------------------------以下部分在两个节点上执行1.防火墙开放873端口( ...

  4. 拓展:switch实现

    拓展:switch实现 参考中谷教育 python视频:switch  switch语句用于编写多分支结构的程序,类似于if ... elif ...else语句.switch语句表达的分支结构比if ...

  5. 聊天工具实现winform端实现

    最近在找能够实现客户端点对点聊天的技术,通过github我发现了一个项目,它能够支持webscoket通讯,服务端是由c#socket完成. 我要的是winform端的通信,所以在他的基础上,增加了桌 ...

  6. C语言字符知识狭区

    C语言字符在用户接口软件编程上经常用到,但是有一些狭区会让编程出现一些小BUG,现在总结与此. 1.'\\' 代表的是字符\,而'\'是不能代表字符\的.通常\后面都要跟上数字或者其他字母来表示一个特 ...

  7. 属性观察者willSet与didSet

    在Swift中使用willSet和didSet这两个特性来监视属性的除初始化之外的属性值变化. willSet里面是新值,即属性即将要变为的值:didSet里面是旧值,即属性变化之前的值. impor ...

  8. Java使用memcached

    1.加载commons-pool-1.5.6.jar.java_memcached-release_2.6.6.jar.slf4j-api-1.6.1.jar.slf4j-simple-1.6.1.j ...

  9. 学无止境,学习AJAX(一)

    什么是AJAX?异步JavaScript和XML. AJAX是一种用于创建快速动态网页的技术. 通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更新.这意味着可以在不重新加载整个网页的 ...

  10. BT5下安装Metasploit4.5方法

    BT5与Ubuntu下安装最新版Metasploit4.5方法:(先把老版本的MSF uninstall,BT5自带的老版本Metasploit没有办法升级!) 1.下载Metasploit下的Lin ...