V$LOGMNR_CONTENTS视图中的SESSION_INFO 是null的.

Column USERNAME And SESSION_INFO Are UNKNOWN Or NULL In V$LOGMNR_CONTENTS (Doc ID 110301.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 8.1.7.0 and later
Information in this document applies to any platform.
***Checked for relevance on 29-Jul-2013***

SYMPTOMS

You have just built the LogMiner dictionary and started the LogMiner session. 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.

CAUSE

  1. If 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. TheOracle 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 SQL statement similar to the following:
    SQL> CONNECT / AS SYSDBA
    SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

    Then the information necessary to populate the USERNAME and SESSION_INFO columns will be stored in the redo stream.

  2. The redo stream does not contain the USERNAME and SESSION_INFO data for every transaction. This information is only stored for the first transaction executed in the user's session. So in order to be able to see this information in V$LOGMNR_CONTENTS, all the redo generated during the entire session must be added to the mining session. Should this not be done, then the USERNAME and SESSION_INFO columns will remain empty.

  3. LogMiner was first available in Oracle8i. If the COMPATIBLE instance parameter is set to a value lower than 8.1.0 you will not have access to its full functionality.

  4. In Oracle9i and lower releases of Oracle, the TRANSACTION_AUDITING instance parameter is set to TRUE by default. This causes the generation of a redo record containing the user logon name, username, session ID, and some operating system and client information. For each successive transaction in the session, Oracle will store only the session ID. These session IDs are linked back to the first record to retrieve user and session information.

    When TRANSACTION_AUDITING is set to FALSE, this redo record is not written and the user information is not available to LogMiner.

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 instance parameter is set to TRUE (default).
    SQL> show parameter transaction_auditing

    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ----------
    transaction_auditing                 boolean     TRUE

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值