How To Determine The Cause Of Lots Of Redo Generation Using LogMiner (Doc ID 300395.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 8.1.7.4 to 10.2.0.5 [Release 8.1.7 to 10.2]
Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Information in this document applies to any platform.
NOTE: In the images and/or the document content below, the user information and data used represents fictitious data. Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner.

GOAL

This article provides guidelines DBAs can use to determine which OPERATION codes are generating lots of redo information.

本文提供了DBA可用来确定哪些 OPERATION 代码正在生成大量 redo 的准则。

This article is intended for DBAs. The article assumes the reader is familiar with LogMiner and has basic skills in mining redo logs.

本文适用于DBA。 本文假定读者熟悉 LogMiner,并且具有挖掘redo日志的基本技能。

SOLUTION

--- How to determine the cause of lots of redo generation using LogMiner ---

--- 如何使用 LogMiner 确定产生大量 redo 的原因 ---

Using OPERATION Codes to Understand Redo Information  使用 OPERATION 了解 Redo 信息

There are multiple operation codes which can generate the redo information, using following guide lines you can identify the operation codes which are causing the high redo generation and you need to take an appropriate action on it to reduce the high redo generation.

有多种操作代码可以生成redo信息,使用以下指南,您可以识别导致高redo生成的操作代码,并且需要对其采取适当的措施以减少高redo生成。

NOTE:
Redo records are not all equally sized. So remember that just because certain statements show up a lot in the LogMiner output, this does not guarantee that you have found the area of functionality generating the excessive redo.
Redo记录的大小并不均等。 因此请记住,仅因为某些语句在LogMiner输出中显示很多,这并不能保证您已经找到了产生过多redo的功能区域。

What are these OPERATION codes ?  这些操作代码是什么?

  • INSERT / UPDATE / DELETE -- Operations are performed on SYS objects are also considered as an Internal Operations. 对SYS对象执行的操作也被视为内部操作。
  • COMMIT -- This is also "Internal" operation, you will get line "commit;" in the column sql_redo.  这也是“内部”操作,您将 在sql_redo列中 获得“ commit;”行 。
  • START -- This is also "Internal" operation, you will get line "set transaction read write;" in sql_redo INTERNAL -- Dictionary updates  这也是“内部”操作,您将在 sql_redo INTERNAL -- Dictionary updates获得"set transaction read write;"
  • SELECT_FOR_UPDATE - This is also an Internal operation and oracle generates the redo information for "select" statements which has "for update" clause. 这也是一个内部操作,并且oracle为具有 "for update" 子句的 "select" 语句生成redo信息。

In general INTERNAL operations are not relevant, so to query the relevant data, use "seg_owner=' in the "where" clause.

通常,INTERNAL操作无关紧要,因此要查询相关数据,请在"where" 子句中使用"seg_owner=' 。

Examples:

How to extract relevant information from the view v$logmnr_contents?

如何从视图 v$logmnr_contents 中提取相关信息

1. This SQL lists operations performed by user SCOTT  该SQL列出了用户SCOTT执行的操作

SQL> select distinct operation,username,seg_owner from v$logmnr_contents where seg_owner='SCOTT';

OPERATION USERNAME SEG_OWNER
-------------------------- ------------------------- ---------------------
DDL SCOTT SCOTT
DELETE SCOTT SCOTT
INSERT SCOTT SCOTT
UPDATE SCOTT SCOTT

2. This SQL lists the undo and redo associated with operations that user SCOTT performed

此SQL列出与用户SCOTT执行的操作相关的undo和redo

SQL> select seg_owner,operation,sql_redo,sql_undo from v$logmnr_contents where SEG_owner='SCOTT';

SCOTT DDL
create table LM1 (c1 number, c2 varchar2(10)); SCOTT INSERT
insert into "SCOTT"."LM1"("C1","C2") values ('101','AAAA');
delete from "SCOTT"."LM1" where "C1" = '101' and "C2" = 'AAAA'
and ROWID = 'AAAHfBAABAAAMUqAAA'; SCOTT UPDATE update "SCOTT"."LM1" set "C2" = 'YYY'
where "C2" = 'EEE' and ROWID = 'AAAHfBAABAAAMUqAAE';
update "SCOTT"."LM1" set "C2" = 'EEE' where "C2" = 'YYY'
and ROWID = 'AAAHfBAABAAAMUqAAE';

INSERT / UPDATE / DELETE -- Operations are performed on SYS objects are also considered as an Internal Operations. 对SYS对象执行的操作也被视为内部操作

3. This SQL lists undo and redo generated for UPDATE statements issues by user SCOTT  此SQL列出了用户SCOTT为UPDATE语句问题生成的undo和redo

SQL> select username, seg_owner,operation,sql_redo,sql_undo from v$logmnr_contents where operation ='UPDATE' and USERNAME='SCOTT';

UNAME SEG_OW OPERATION SQL_REDO SQL_UNDO
---------- ---------- ------------ -----------------------------------
SCOTT SYS UPDATE update "SYS"."OBJ$" set "OBJ#" = '1'..... update ....
SCOTT SYS UPDATE update "SYS"."TSQ$" set "GRANTO..... update .......
SCOTT SYS UPDATE update "SYS"."SEG$" set "TYPE#" = '5'.. update......

As per above result user SCOTT has updated SYS objects so, if you query on USERNAME, you may get incorrect result. So, better to query v$logmnr_contents on SEG_OWNER.
根据上述结果,用户SCOTT已更新了SYS对象,因此,如果您在USERNAME上进行查询,则可能会得到错误的结果。因此,最好在SEG_OWNER上查询 v$logmnr_contents。

4. Identifying Operation Counts 识别操作计数

Run the following query to see the OPERATION code row count from v$logmnr_contents, to understand which OPERATION code has generated lots of redo information.

运行以下查询以查看 v$logmnr_contents 中的 OPERATION 代码行计数,以了解哪个 OPERATION 代码已生成大量redo信息。

SQL> select operation,count(*) from v$logmnr_contents group by operation;

OPERATION COUNT(*)
-------------------- ----------
COMMIT 22236
DDL 2
DELETE 1
INSERT 11
INTERNAL 11
SELECT_FOR_UPDATE 32487
START 22236
UPDATE 480 8 rows selected

5. Identifying User Counts  识别用户数

Run the following query to check user activity and operation counts:  运行以下查询以检查用户活动和操作计数

SQL> select seg_owner,operation,count(*) from v$logmnr_contents group by seg_owner,operation;

SEG_OWNER OPERATION COUNT(*)
-------------------- ---------------- ---------
SCOTT COMMIT 22236
SCOTT DDL 2
SCOTT DELETE 1
...
BILLY COMMIT 12899
BILLY DDL 5
BILLY DELETE 2
...

NOTE: 
Be aware of next known issue:  请注意下一个已知问题

If you are not using "select for update" statements often in your application and yet find a high operation count for operation code "SELECT_FOR_UPDATE" then you might be hitting a known issue.

如果您不经常在应用程序中使用 "select for update" 语句,却发现操作代码 "SELECT_FOR_UPDATE" 的操作计数很高,那么您可能遇到了一个已知问题。

To confirm this check whether SQL_REDO shows select,update statements on AQ$_QUEUE_TABLE_AFFINITIES and AQ$_QUEUE_TABLES.

要确认此检查,SQL_REDO 是否在 AQ$_QUEUE_TABLE_AFFINITIES and AQ$_QUEUE_TABLES 上显示 select,update 语句。

If you see these selects and updates, then check the value of the Init.ora parameter AQ_TM_PROCESSES.  The default value is AQ_TM_PROCESSES = 0 meaning that the queue monitor is not created.

如果看到这些 selects and updates,请检查Init.ora参数AQ_TM_PROCESSES的值。 缺省值为AQ_TM_PROCESSES = 0表示未创建队列监视器。

If you are not using Advanced Queuing, then set AQ_TM_PROCESSES back to zero to avoid lots of redo generation on objects AQ$_QUEUE_TABLE_AFFINITIES and AQ$_QUEUE_TABLES.

如果不使用高级队列,则将AQ_TM_PROCESSES设置回零,以避免在对象 AQ$_QUEUE_TABLE_AFFINITIES and AQ$_QUEUE_TABLES 上产生大量redo。

REFERENCES

NOTE:291686.1 - LogMiner Utility Release 8i - 11g

How To Determine The Cause Of Lots Of Redo Generation Using LogMiner (Doc ID 300395.1)的更多相关文章

  1. How to Determine the Version of Oracle XML Publisher for Oracle E-Business Suite 11i and Release 12 (Doc ID 362496.1)

    Modified: 29-Mar-2014 Type: HOWTO In this DocumentGoal   Solution   1. Based upon an output file gen ...

  2. 如何追踪产生大量REDO的来源

    从10点到12点数据库中对象块变化排名靠前的对象 select to_char(begin_interval_time,'YYYY_MM_DD HH24:MI') snap_time, dhsso.o ...

  3. LogMiner Utility Release 8i - 11g (Doc ID 291686.1)

    LogMiner Utility Release 8i - 11g (Doc ID 291686.1) APPLIES TO: Oracle Database Exadata Cloud Machin ...

  4. Oracle Online Patching报错"This is not a RAC setup. OPatch cannot determine the local node name"

    Oracle Online Patching报错"This is not a RAC setup. OPatch cannot determine the local node name&q ...

  5. Configuring HugePages for Oracle on Linux (x86-64)

    Introduction Configuring HugePages Force Oracle to use HugePages (USE_LARGE_PAGES) Disabling Transpa ...

  6. Click to add to Favorites Troubleshooting: High Version Count Issues (Doc ID 296377.1)

    Copyright (c) 2018, Oracle. All rights reserved. Oracle Confidential. Click to add to Favorites Trou ...

  7. 官方推荐的MySQL参数设置值

    这oracle官方推荐的在OLTP环境下,MySQL参数设置的最佳实践. 下面的参数设置,对系统的性能会很有帮助.但是建议大家还是结合实际情况使用. APPLIES TO: MySQL Server ...

  8. 转 如何诊断和解决high version count 10.2.0.4 and 11.2.0.4

    转自 http://blog.csdn.net/notbaron/article/details/50927492 在Oracle 10g以上的版本,High version count可谓是一个臭名 ...

  9. Master Note: Undo 空间使用率高 (Doc ID 1578639.1)

    Master Note: High Undo Space Usage (Doc ID 1578639.1) APPLIES TO: Oracle Database Cloud Schema Servi ...

随机推荐

  1. 一个经典的代码--Convert char to int in C and C++

    前记 写程序,就像建房子,对于高超的建筑师来说,是要有一些好的素材的.作为一个程序员,见了好用的素材存起来,以备后面需要,也是一门很好的修养. 实例代码 一个char 转int的经典代码,这里分享一下 ...

  2. 基于canvas二次贝塞尔曲线绘制鲜花

    canvas中二次贝塞尔曲线参数说明: cp1x:控制点1横坐标 cp1y:控制点1纵坐标 x: 结束点1横坐标 y:结束点1纵坐标 cp2x:控制点2横坐标 cp2y:控制点2纵坐标 z:结束点2横 ...

  3. 【JS档案揭秘】第三集 深入最底层探秘原型链

    关于这部分我看过大量的文章,数不胜数,包括阮一峰的继承三部曲,还有各种慕课的视频教程,网上无数继承方法的对比.也对很多概念存在长期错误的理解.今天做一个正确的总结,用来给原型链和继承这块知识画上句号, ...

  4. UML简单介绍—类图这么看就懂了

    如何看懂类图 1.类图简介 描述类的内部结构和类与类之间的关系,是一种静态结构图. 在UML类图中,常见的有以下几种关系: 泛化(Generalization),  实现(Realization),关 ...

  5. English:Day-to-day 1014

    Piracy Defy Coordination Essential Globe Silky Threat Supply Haste Ample Correspond Beloved Adjust D ...

  6. npm 使用过程中报错问题-及npm使用

    原文地址:https://blog.csdn.net/u013022210/article/details/77740519 1.以下为报错具体详情:node 8.1.2 版本问题:其他空间安装成功但 ...

  7. ORA-16032和ORA-07286 LOG_ARCHIVE_DEST_1没生效

    主备切换在备库startup时出现归档路径没写到spfile里...注意:修改参数时最好带上scope=spfile或scope=both,以免重启出现异常.SQL> startup mount ...

  8. 字典 dict方法

    字典 student = {'sId': '1101', 'sName': '张三', 'sClass': '软件测试', 'sColl': '信息技术学院'} # 根据键查询 若不存在会报错 pri ...

  9. 线上cpu使用率过高解决方案

    一个应用占用CPU很高,除了确实是计算密集型应用之外,通常原因都是出现了死循环. 下面我们将一步步定位问题,详尽的介绍每一步骤的相关知识. 一.通过top命令定位占用cpu高的进程 执行top命令得到 ...

  10. 如何通过 subprocess 持续获取输出内容

    在实际应用中会用到subprocess的Popen方法执行一些命令,而我们需要通过执行这个命令的来获取输出进行一些信息记录或者分析使用,如果是很快就可以执行完的那还好,有时需要持续跟踪内容的输出,比如 ...