| Lesson 7 | Size the online redo log files |
| Objective | Determine sizes for online redo logs in Oracle. |
Yes—if you manage the database (on-premises or co-managed cloud such as OCI Base Database Service / Exadata Database Service), online redo log sizing is still a DBA responsibility because log switch rate and redo I/O directly affect throughput and recovery behavior. In Oracle’s multitenant architecture, redo is managed at the CDB level (not per PDB), so sizing decisions apply to the whole container database workload.
Right-sizing is not a single number. The goal is to choose a redo log size that:
In modern environments you will typically see ASM/OMF locations (for example +DATA), rather than manual file system paths.
Use the following query to list redo log groups, members, size, and status:
SELECT
l.group#,
l.thread#,
l.bytes/1024/1024 AS size_mb,
l.members,
l.status,
lf.member
FROM v$log l
JOIN v$logfile lf
ON lf.group# = l.group#
ORDER BY l.thread#, l.group#, lf.member;
The most practical way to size logs is to observe how often switches occur, then adjust sizes to reach a stable operational cadence. The following query summarizes switches per hour (recent history):
SELECT
TRUNC(first_time, 'HH24') AS hour_start,
COUNT(*) AS switches
FROM v$loghist
WHERE first_time > SYSDATE - 1
GROUP BY TRUNC(first_time, 'HH24')
ORDER BY hour_start;
If switches are occurring very frequently during peak periods, increase redo log size (or review workload/redo generation drivers). If switches are very rare, you may be able to reduce size—provided you do not introduce other risks for your recovery objectives.
Oracle does not “resize in place” for online redo logs. The standard approach is:
-- Example: add a new group (adjust thread# for RAC)
ALTER DATABASE ADD LOGFILE GROUP 4 ('+DATA') SIZE 1024M;
-- Switch to advance log usage (repeat as needed)
ALTER SYSTEM SWITCH LOGFILE;
-- When the old group is INACTIVE, drop it
ALTER DATABASE DROP LOGFILE GROUP 1;
Redo contention is usually diagnosed by wait events and I/O latency, not by legacy-era parameter tweaking.
If commit performance is poor, focus on redo-related waits (for example log file sync) and the storage path for redo.
Use AWR/ASH (or cloud metrics) to confirm whether the bottleneck is LGWR, I/O latency, or application commit behavior.