How to identify the causes of High Redo Generation (Doc ID 2265722.1)
@[TOC](In this Document)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 9.2.0.1 and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.
PURPOSE
Purpose of this document is to show how to identify the causes of excessive redo generation and what we can do to mitigate the problem
TROUBLESHOOTING STEPS
First of all, we need to remark that high redo generation is always a consequence of certain activity in the database and it is expected behavior, oracle is optimized for redo generation and there are no bugs regarding the issue.
The main cause of high redo generation is usually a high DML activity during a certain period of time and it’s a good practice to first examine modifications on either database level (parameters, any maintenance operations,…) and application level (deployment of new application, modification in the code, increase in the users,..).
What we need to examine:
- Is supplemental logging enabled? The amount of redo generated when supplemental logging is enabled is quite high when compared to when supplemental logging is disabled.
What Causes High Redo When Supplemental Logging is Enabled (Doc ID 1349037.1)
Are a lot of indexes being used?, reducing the number of indexes or using the attribute NOLOGGING will reduce the redo considerably
Are all the operation really in need of the use of LOGGING? From application we can reduce redo by making use of the clause NOLOGGING. Note that only the following operations can make use of NOLOGGING mode:
- direct load (SQL*Loader)
- direct-load INSERT
- CREATE TABLE … AS SELECT
- CREATE INDEX
- ALTER TABLE … MOVE PARTITION
- ALTER TABLE … SPLIT PARTITION
- ALTER INDEX … SPLIT PARTITION
- ALTER INDEX … REBUILD
- ALTER INDEX … REBUILD PARTITION
- INSERT, UPDATE, and DELETE on LOBs in NOCACHE NOLOGGING mode stored out of line
To confirm if the table or index has “NOLOGGING” set.
Issue the following statement.
select table_name,logging from all_tables where table_name =
1 | select lg.group#,lg.bytes/1024/1024 mb, lg.status, lg.archived,lf.member |
1 | select to_char(first_time,'YYYY-MON-DD') "Date", to_char(first_time,'DY') day, |
This will give us an idea of the times when the high peaks of redo are happening
- Examine AWR report:
Next step will be examining the AWR from the hour where we have had the highest number of log switches, and confirm with the redo size that these log switches are actually caused by a lot of redo generation.
In the AWR we can also see the sql with most of the gets/executions to have an idea of the activity that is happening in the database and generating redo and we can also see the segments with the biggest number of block changes and the sessions performing these changes.
Another way to find these sessions is described in SQL: How to Find Sessions Generating Lots of Redo or Archive logs (Doc ID 167492.1)
To find these segments we can also use queries:
1 | SELECT to_char(begin_interval_time,'YY-MM-DD HH24') snap_time, |
- Finally, to troubleshoot further the issue and know the exact commands are being recorded at that particular time frame we can use log miner and mine the archivelog from the concerned time frame. We can look on v$archived_log and find the archived log generated at that particular time frame.
How To Determine The Cause Of Lots Of Redo Generation Using LogMiner (Doc ID 300395.1)
REFERENCES
NOTE:782935.1 - Troubleshooting High Redo Generation Issues
NOTE:1504755.1 - Simple Steps to use Log Miner for finding high redo log generation
NOTE:167492.1 - SQL: How to Find Sessions Generating Lots of Redo or Archive logs