Oracle wait events are statistics that a server process or thread increments when it waits for an operation to complete in order to continue its processing.
Here are some of the most common Oracle wait events explained.
Table of Contents
Buffer busy waits
This event occurs when a session wants to access a database block in the buffer cache but it cannot because the buffer is busy.
In simple terms: Imagine you have one special video game console that only one person can use at a time.
If you want to play and someone else is already using it, you have to wait until they finish.
In Oracle, the “buffer” is like that video game console—it holds important data in memory.
When a task wants to use a piece of that data (a database block) but it’s already busy being used by someone else, the task has to wait.
This waiting is called a “buffer busy wait.”
Thank you—that’s much clearer. Let’s focus specifically on buffer busy waits
and how to solve them.
🔍 What is buffer busy waits
?
- This wait event occurs when multiple sessions are trying to access the same data block in the buffer cache, but the block is currently busy (either being read into the cache or modified by another session).
- It’s a contention issue at the buffer cache layer, not a disk problem.
🛠 Causes and Solutions for buffer busy waits
1️⃣ Hot Block Contention (Too Many Sessions on the Same Block)
- Example: Many sessions update or read the same small set of blocks (e.g., inserts into the same table block or updates to same rows).
- Fixes:
- Increase FREELISTS / FREELIST GROUPS (for non-ASSM tablespaces) to spread inserts over more blocks.
- Move to ASSM (Automatic Segment Space Management) tablespace to avoid freelist bottlenecks.
- Partition the table or use hash partitioning to distribute data across multiple blocks.
- Rebuild indexes or spread data more evenly.
2️⃣ Undo Segment Contention
- Cause: Multiple users updating data using the same undo segment blocks.
- Fixes:
- Increase the number of undo segments (set a higher value for
_undo_autotune
or adjust undo tablespace sizing). - Review undo retention settings.
- Increase the number of undo segments (set a higher value for
3️⃣ Sequence and Index Contention
- Cause: Rapid inserts into tables with sequential keys (like ID fields) can cause index hot blocks.
- Fixes:
- Use reverse key indexes.
- Use hash partitioned indexes or global indexes.
- Implement cached sequences (
CREATE SEQUENCE … CACHE 1000
).
4️⃣ Direct Path Loads or High DML
- Cause: Concurrent Direct Path Inserts or frequent bulk operations.
- Fixes:
- Use APPEND hints wisely.
- Stagger batch jobs to avoid concurrency.
- Ensure parallelism is not too aggressive.
5️⃣ Inadequate Buffer Cache
- Cause: Insufficient SGA leading to frequent block replacement and re-reading from disk.
- Fixes:
- Increase DB_CACHE_SIZE.
- Use Automatic Memory Management (AMM) or Automatic Shared Memory Management (ASMM) properly tuned.
📝 How to Diagnose the Exact Cause
SELECT event, p1 "File#", p2 "Block#", p3 "Class#",
COUNT(*) AS waits
FROM v$session_wait
WHERE event = 'buffer busy waits'
GROUP BY event, p1, p2, p3
ORDER BY waits DESC;
👉 Use this to find the file# and block# causing the wait, then:
SELECT segment_name, segment_type
FROM dba_extents
WHERE file_id = &File#
AND &Block# BETWEEN block_id AND block_id + blocks - 1;
This tells you which object (table/index) is responsible.
✅ Summary of Actions:
Cause | Solution |
---|---|
Hot table/index block | Spread data (FREELISTS, ASSM, partitioning) |
Undo segment contention | More undo segments, undo tuning |
Sequence/index hot blocks | Reverse key, sequence cache, hash partitioning |
Bulk loads/DML | Stagger jobs, tune parallelism |
Cache too small | Increase DB_CACHE_SIZE |
Free buffer waits
This event occurs mainly when a server process is trying to read a new buffer into the buffer cache but too many buffers are either pinned or dirty and thus unavailable for reuse.
The session posts to DBWR then waits for DBWR to create free buffers by writing out dirty buffers to disk.
In simple terms: Imagine you have a toy shelf that’s completely full.
Now, you want to put a new toy on it, but there’s no room because all the spots are taken by toys that are either being played with or need to be cleaned up first.
Perfect—let’s dive into free buffer waits
specifically, based on the wait event you mentioned from the article.
🔍 What is free buffer waits
?
- This event occurs when a session needs a free buffer in the buffer cache, but none is available because:
- The DBWR (Database Writer) has not yet written dirty buffers to disk to free space.
- The system is generating dirty blocks faster than DBWR can flush them.
It indicates a write bottleneck: the database wants to reuse buffers, but they’re not free yet.
🛠 Causes and Solutions for free buffer waits
1️⃣ Slow Disk I/O
- Cause: DBWR is unable to write dirty blocks fast enough to free buffers due to slow disk performance.
- Fixes:
- Move data files to faster disks (e.g., SSDs).
- Balance I/O by spreading data across multiple disks or ASM diskgroups.
- Review and optimize the I/O subsystem (SAN/NAS tuning).
2️⃣ Insufficient Database Writer Throughput
- Cause: Too few DBWR processes to handle the volume of dirty blocks.
- Fixes:
- Increase the number of DB Writer processes using:
DB_WRITER_PROCESSES = <value>
(In OLTP systems, multiple DBWRs help spread the write load.)
- Increase the number of DB Writer processes using:
3️⃣ Too Small Buffer Cache
- Cause: The buffer cache (SGA) is too small to handle workload, causing frequent dirty buffer accumulation.
- Fixes:
- Increase DB_CACHE_SIZE (or use Automatic Memory Management (AMM/ASMM)).
- Review buffer cache hit ratios using:
SELECT name, value FROM v$sysstat WHERE name LIKE '%buffer cache%';
4️⃣ High Volume of Dirty Buffers
- Cause: Sudden spikes in DML (bulk updates/inserts) fill the cache with dirty blocks faster than they can be written.
- Fixes:
- Optimize DML statements to reduce block changes.
- Use Direct Path Loads (APPEND hint) for large inserts to bypass the buffer cache.
- Spread heavy DML over time or schedule during off-peak hours.
5️⃣ Check Checkpointing & Redo
- Cause: Inefficient checkpoint tuning can delay buffer recycling.
- Fixes:
- Tune checkpoint parameters: FAST_START_MTTR_TARGET.
- Increase log file size to avoid too-frequent checkpoints.
- Check for redo log file I/O bottlenecks.
📝 How to Diagnose free buffer waits
- Check current sessions:
SELECT * FROM v$session_wait WHERE event = 'free buffer waits';
- Check I/O performance (average write times):
SELECT file#, avg_time, writes FROM v$filestat;
- Check dirty buffer statistics:
SELECT * FROM v$sysstat WHERE name LIKE '%dirty%';
✅ Summary Table:
Cause | Solution |
---|---|
Slow disk writes | Faster disks, spread datafiles |
DBWR can’t keep up | Increase DB_WRITER_PROCESSES |
Small buffer cache | Increase DB_CACHE_SIZE |
Heavy DML | Optimize or schedule better, use direct path |
Poor checkpointing | Tune FAST_START_MTTR_TARGET , redo size |
👉 This is a system-level bottleneck—the solution often involves both hardware (disks, memory) and configuration (DBWR, cache, redo).
Db file sequential read
This event shows a wait for a foreground process while doing a sequential read from the database.
The I/O is generally issued as a single I/O request to the OS; the wait blocks until the I/O request completes.
In simple terms: Imagine you have a favorite picture book, but it’s kept on a high shelf.
When you want to look at a specific page, you ask a friend to grab it for you.
While your friend fetches the page, you sit and wait until they come back with it.
Great—let’s focus now on db file sequential read
, which is one of the most common Oracle wait events.
🔍 What is db file sequential read
?
- This wait occurs when Oracle performs single-block reads from disk into memory.
- It’s typical of:
- Index lookups (especially B-tree indexes)
- Row-by-row access via table access by ROWID
- Nested loops joins
It is called “sequential” because Oracle reads one block at a time (not in multi-block chunks).
🛠 Causes and Solutions for db file sequential read
1️⃣ Inefficient SQL (Bad Execution Plans)
- Cause: Queries using indexes inefficiently or accessing data row by row unnecessarily.
- Fixes:
- Use EXPLAIN PLAN to review query paths.
- Consider adding missing indexes or rewriting SQL to improve access paths.
- Use join methods wisely: avoid unnecessary nested loops.
👉 Check execution plan:
EXPLAIN PLAN FOR <your SQL>;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
2️⃣ Unselective Indexes
- Cause: Indexes that retrieve too many rows (low cardinality) are still being used.
- Fixes:
- Drop or avoid using indexes that don’t filter well.
- Consider bitmap indexes for low-cardinality columns (OLAP/DSS systems).
3️⃣ Missing Indexes
- Cause: Full table scans are avoided, but without proper indexes Oracle falls back to slow single-block reads.
- Fixes:
- Add appropriate indexes to reduce table access by ROWID.
- Implement composite indexes for multiple filter conditions.
4️⃣ Slow Storage (Disk I/O Bottleneck)
- Cause: Even if queries are efficient, slow storage can cause high wait times.
- Fixes:
- Move data to faster disks (SSD).
- Use ASM striping or proper disk distribution.
👉 Check file I/O:
SELECT file#, avg_time, reads, writes
FROM v$filestat
ORDER BY avg_time DESC;
5️⃣ Insufficient Buffer Cache (Too Much Physical I/O)
- Cause: Buffer cache misses lead to more disk reads.
- Fixes:
- Increase DB_CACHE_SIZE.
- Review and tune Automatic Memory Management (AMM/ASMM).
👉 Check cache efficiency:
SELECT name, value FROM v$sysstat
WHERE name IN ('physical reads', 'consistent gets', 'db block gets');
6️⃣ Hot Objects (Frequent Access to Same Blocks)
- Cause: Certain objects (indexes or small tables) are accessed repeatedly, causing buffer churn.
- Fixes:
- Use KEEP buffer pool for small, frequently used tables or indexes:
ALTER TABLE your_table STORAGE (BUFFER_POOL KEEP);
- Use KEEP buffer pool for small, frequently used tables or indexes:
📝 Quick Diagnosis Queries
- Find sessions waiting:
SELECT sid, p1 file#, p2 block#, p3 blocks
FROM v$session_wait
WHERE event = 'db file sequential read';
- Map file# and block# to the object:
SELECT owner, segment_name, segment_type
FROM dba_extents
WHERE file_id = &file#
AND &block# BETWEEN block_id AND block_id + blocks - 1;
✅ Summary Table:
Cause | Solution |
---|---|
Bad SQL execution plans | Tune SQL, review access paths, gather stats |
Missing/unhelpful indexes | Add or tune indexes (consider bitmap/index skip) |
Slow disks | Use faster storage (SSD), ASM, I/O tuning |
Small buffer cache | Increase DB_CACHE_SIZE , review memory usage |
Hot small tables/indexes | Use KEEP buffer pool |
👉 This wait is normal for OLTP systems but excessive values signal problems.
Db file scattered read
This is the same type of event as “db file sequential read”, except that Oracle will read multiple data blocks.
Multi-block reads are typically used on full table scans.
The name “scattered read” refers to the fact that multiple blocks are read into database block buffers that are ‘scattered’ throughout memory.
In simple terms: Imagine you have a huge picture book and you want to look through many pages quickly.
Instead of asking for one page at a time (like in a sequential read), you ask for a whole bunch of pages at once.
These pages might come from different parts of the book, so when they arrive, they’re spread out or “scattered” all over your reading table.
Excellent—let’s tackle db file scattered read
now.
🔍 What is db file scattered read
?
- This wait event occurs when Oracle performs multiblock reads, typically associated with:
- Full Table Scans
- Fast Full Index Scans
- It’s called “scattered” because the blocks read from disk are scattered across memory buffers rather than being placed sequentially (hence, data is scattered in the buffer cache).
It’s common in Data Warehouse (DSS) environments but should be minimized in OLTP systems.
🛠 Causes and Solutions for db file scattered read
1️⃣ Unnecessary Full Table Scans
- Cause: Queries access entire tables instead of using indexes.
- Fixes:
- Add appropriate indexes (B-tree or bitmap).
- Use EXPLAIN PLAN to ensure the index is actually used.
- Check for missing or stale optimizer statistics and gather them:
EXEC DBMS_STATS.GATHER_TABLE_STATS(ownname => 'SCOTT', tabname => 'EMP');
2️⃣ Small Table Full Scans
- Cause: Oracle often chooses full scans for very small tables, which is usually fine.
- Fixes:
- This is normal and typically not a problem unless the frequency is extreme.
3️⃣ Parallel Query Execution
- Cause: Parallel queries on large tables cause multiple sessions to read scattered blocks concurrently.
- Fixes:
- Optimize parallelism degree using
PARALLEL_DEGREE_POLICY
andPARALLEL_DEGREE_LIMIT
. - Consider partitioning large tables to minimize the need for parallel full scans.
- Optimize parallelism degree using
4️⃣ Inefficient Query Design (Poor Filtering)
- Cause: Queries retrieve large result sets without selective WHERE clauses.
- Fixes:
- Refine WHERE conditions to reduce rows returned.
- Avoid **unnecessary SELECT *** queries.
- Review application logic that triggers these reads.
5️⃣ System or Storage Performance
- Cause: Even when full scans are necessary (e.g., batch jobs), slow disk I/O can exacerbate this wait.
- Fixes:
- Ensure disk subsystem is fast (consider SSDs, parallel I/O, ASM striping).
- Increase
DB_FILE_MULTIBLOCK_READ_COUNT
(though Oracle auto-tunes this in modern versions).
📝 Quick Diagnosis Queries
- Identify sessions waiting:
SELECT sid, p1 file#, p2 block#, p3 blocks
FROM v$session_wait
WHERE event = 'db file scattered read';
- Map to object:
SELECT owner, segment_name, segment_type
FROM dba_extents
WHERE file_id = &file#
AND &block# BETWEEN block_id AND block_id + blocks - 1;
- Find top SQL causing full scans:
SELECT sql_id, executions, buffer_gets, disk_reads
FROM v$sql
WHERE sql_id IN (SELECT sql_id FROM v$session WHERE event = 'db file scattered read')
ORDER BY disk_reads DESC;
✅ Summary Table:
Cause | Solution |
---|---|
Unnecessary full table scans | Add/tune indexes, rewrite SQL, gather stats |
Parallel query overhead | Tune parallel settings, partition tables |
Poor filtering in queries | Add WHERE clauses, avoid SELECT * |
Storage slowness | Improve I/O subsystem, check multiblock read settings |
Small tables (harmless) | Usually no action needed |
👉 Key Tip:
- db file scattered read in an OLTP system is often a red flag → focus on indexing and query tuning.
- In DSS/BI environments, it is often expected behavior but still needs to be efficient.
Enqueue waits
This metric represents the total number of waits per second that occurred during an enqueue convert or get because the enqueue get was deferred.
In simple terms: Imagine you have one special slide at the playground that everyone wants to use.
When you get to the slide and find someone else is already on it, you have to wait your turn.
Each time you wait because the slide is busy, that’s like an “enqueue wait.”
Perfect—let’s break down enqueue
waits in Oracle and how to solve them.
🔍 What are enqueue
Waits?
- An enqueue is a type of lock Oracle uses to control concurrent access to resources (like rows, tables, indexes, or internal structures).
- When a session cannot obtain a required lock immediately, it waits on an enqueue wait event.
👉 Enqueue waits are usually seen as:
enqueue: <type> - <details>
Example:
enq: TX - row lock contention
enq: TM - contention
enq: UL - contention
🛠 Common Enqueue Types and Solutions
1️⃣ enq: TX - row lock contention
(Most Common)
- Cause: One session is modifying a row and another tries to access the same row → leads to TX (transaction) locks.
- Fixes:
- Identify and eliminate application-level contention (same row updated too frequently).
- Implement short transactions: commit early and avoid long idle transactions holding locks.
- Consider application logic changes to serialize access to sensitive data (queues, counters).
👉 Diagnosis:
SELECT * FROM v$lock WHERE type = 'TX';
Find blocking session:
SELECT blocking_session, sid, serial#, wait_class, seconds_in_wait
FROM v$session
WHERE blocking_session IS NOT NULL;
2️⃣ enq: TM - contention
(DML on Objects)
- Cause: Typically seen with foreign key issues or metadata locks.
- Fixes:
- Make sure foreign keys are indexed (to avoid table locks on parent-child deletes/updates).
- Avoid unnecessary DDL while DML is running.
3️⃣ enq: TX - index contention
(Hot Index Blocks)
- Cause: High-concurrency inserts into the same index leaf block (e.g., sequential IDs).
- Fixes:
- Use reverse key indexes.
- Use hash partitioned global indexes to spread inserts.
4️⃣ enq: SQ
(Sequence Contention)
- Cause: Multiple sessions using the same sequence without caching → hotspot.
- Fixes:
- Define sequences with CACHE and/or NOORDER:
CREATE SEQUENCE my_seq CACHE 1000 NOORDER;
- Define sequences with CACHE and/or NOORDER:
5️⃣ enq: UL
(User-defined Locks)
- Cause: Application using DBMS_LOCK or custom enqueues.
- Fixes:
- Review and optimize application logic using these locks.
6️⃣ enq: HW
(High Water Mark Contention)
- Cause: High frequency of inserts causing segment growth.
- Fixes:
- Preallocate space using:
ALTER TABLE my_table ALLOCATE EXTENT;
- Consider parallel inserts or spreading data.
- Preallocate space using:
📝 Diagnosis Queries for Enqueue Waits
- Sessions waiting on enqueues:
SELECT sid, event, p1raw, p2, p3
FROM v$session
WHERE event LIKE 'enq%';
- Blocker vs. waiter:
SELECT sid, blocking_session, event, wait_class
FROM v$session
WHERE blocking_session IS NOT NULL;
- Detailed enqueue decoding (optional):
SELECT chr(bitand(p1, -16777216) / 16777215) ||
chr(bitand(p1, 16711680) / 65536) "Lock Type"
FROM v$session
WHERE event LIKE 'enq%';
✅ Summary Table:
Enqueue Type | Cause | Solution |
---|---|---|
TX - row lock | Row-level contention | Shorten transactions, app logic fix |
TM | Unindexed foreign keys | Add indexes to foreign keys |
TX - index | Hot index block | Reverse key or partitioned index |
SQ | Sequence contention | Use sequence cache, noorder |
UL | User locks | Review app usage |
HW | High water mark | Preallocate extents |
👉 General Tip:
- In most cases, enqueue waits are due to inefficient application design or missing indexes.
- System-level tuning (SGA, I/O) has little effect—it’s mostly SQL and logic fixes.
Log buffer space
Wait for space in the log buffer because we are writing into the log buffer faster than lgwr can write it out.
In simple terms: Imagine you have a special notepad where you quickly jot down notes.
There’s a helper, LGWR, whose job is to take your notes and write them into a big, safe book.
If you write notes too fast and the notepad fills up before your helper can clear some space, you have to pause and wait until there’s room again.
This waiting time is called a “log buffer space” wait.
Excellent choice—let’s focus on log buffer space
waits in Oracle, which are less common but critical when they appear.
🔍 What is log buffer space
?
- This wait event happens when:
- Oracle tries to copy redo entries from the log buffer (SGA) to the online redo logs, but there’s no free space in the log buffer because the redo data hasn’t been written to disk yet.
It signals a bottleneck between user processes generating redo and LGWR (Log Writer) flushing it to the redo logs.
🛠 Causes and Solutions for log buffer space
1️⃣ Redo Logs on Slow Disk
- Cause: The LGWR cannot write redo data to disk fast enough.
- Fixes:
- Place redo logs on the fastest storage available (preferably SSD or dedicated disks).
- Use ASM with proper disk group configuration for redo logs.
- Check for storage latency.
👉 Check log file I/O:
SELECT * FROM v$logfile;
2️⃣ Small Redo Log Buffer (LOG_BUFFER
)
- Cause: The in-memory log buffer is too small, causing frequent waits when many sessions generate redo.
- Fixes:
- Increase the LOG_BUFFER size in the SPFILE or PFILE.
ALTER SYSTEM SET LOG_BUFFER = <larger_value> SCOPE=SPFILE;
- Modern versions of Oracle auto-tune this, but manual adjustment may still help for redo-intensive systems.
- Increase the LOG_BUFFER size in the SPFILE or PFILE.
👉 Check current log buffer size:
SHOW PARAMETER log_buffer;
3️⃣ LGWR Undersized or Slow
- Cause: The LGWR process is not keeping up with the volume of redo.
- Fixes:
- Ensure LGWR is not contending with other processes for CPU.
- In RAC: verify that LGWR and I/O channels are correctly distributed.
4️⃣ High Redo Generation (Too Much COMMIT or DML)
- Cause: Very high rate of commits, DML, or batch jobs generating large volumes of redo.
- Fixes:
- Use batch commits instead of frequent per-row commits.
- Optimize DML operations to reduce redo (bulk operations, direct path loads where feasible).
- Consider NOLOGGING options for data loads when recoverability is not required.
👉 Identify sessions generating redo:
SELECT sid, serial#, value
FROM v$sesstat s, v$statname n
WHERE s.statistic# = n.statistic#
AND n.name = 'redo size'
ORDER BY value DESC;
5️⃣ Redo Log Files Too Small (Frequent Log Switches)
- Cause: Small redo log files → frequent log switches → increased LGWR pressure → buffer contention.
- Fixes:
- Increase redo log file size:
ALTER DATABASE ADD LOGFILE SIZE 1G;
- Aim for log switches no more than 10-15 times per hour in OLTP.
- Increase redo log file size:
👉 Check log switch frequency:
SELECT TO_CHAR(first_time, 'YYYY-MM-DD HH24') AS hour, COUNT(*)
FROM v$log_history
GROUP BY TO_CHAR(first_time, 'YYYY-MM-DD HH24')
ORDER BY hour DESC;
📝 Quick Diagnosis Steps
- Check sessions waiting on log buffer:
SELECT sid, event, wait_time, seconds_in_wait
FROM v$session
WHERE event = 'log buffer space';
- Check redo size and commit rate:
SELECT name, value FROM v$sysstat
WHERE name IN ('redo size', 'user commits');
- Check LGWR write performance:
SELECT name, value FROM v$sysstat
WHERE name LIKE '%log file%';
✅ Summary Table:
Cause | Solution |
---|---|
Slow redo log disk | Move redo logs to faster storage |
Small log buffer (LOG_BUFFER ) | Increase LOG_BUFFER size |
LGWR not keeping up | Check CPU, I/O, LGWR process |
Too much redo (frequent commits/DML) | Optimize application, batch commits |
Small redo log files | Increase redo log size |
👉 Key Notes:
- log buffer space waits are rare in well-configured systems.
- The fixes almost always involve hardware (faster disks), configuration (log sizes, buffer), and application tuning (DML/commit patterns).
Log file sync
It is the wait for LGWR to write to the redo log files.
In simple terms: Imagine you’re playing a game where every move you make needs to be written down in a special diary to remember it.
There’s a friend called LGWR whose job is to write down each move.
If you make a move and then have to wait because your friend is still writing the previous move in the diary, that’s a “log file sync” wait.
It means you’re pausing until LGWR finishes writing your move down in the log files.
Great choice—log file sync
is one of the most common and important wait events in Oracle databases, especially in OLTP systems. Let’s break it down fully.
🔍 What is log file sync
?
- This wait event occurs when a session commits a transaction and must wait for the LGWR (Log Writer) to write the redo data to the redo log file and confirm that it’s safely stored.
- Only after this write is confirmed can the commit be acknowledged to the user.
👉 In short:
Commit → LGWR writes → User waits → log file sync
🛠 Causes and Solutions for log file sync
1️⃣ Frequent Commits (Commit Flooding)
- Cause: Application commits after every single row or too frequently.
- Fixes:
- Implement batch commits: commit after processing multiple rows instead of after every row.
- Revise application logic to reduce unnecessary commits.
👉 Diagnosis:
SELECT name, value FROM v$sysstat WHERE name = 'user commits';
2️⃣ Slow Redo Log Writes (Disk I/O Bottleneck)
- Cause: The disks holding the redo log files are slow or overloaded, delaying LGWR writes.
- Fixes:
- Place redo logs on high-speed storage (SSD, Flash).
- Isolate redo logs from datafiles and other busy disks.
- Use ASM with redundancy and striping.
👉 Check redo log performance:
SELECT name, value FROM v$sysstat WHERE name LIKE 'redo writes%';
3️⃣ Small Redo Log Files (Too Many Switches)
- Cause: Frequent log switches causing delays and higher LGWR activity.
- Fixes:
- Increase redo log file size to reduce the number of switches per hour.
- Check for log switch storms during busy hours.
👉 Check log switch history:
SELECT TO_CHAR(first_time, 'YYYY-MM-DD HH24') AS hour, COUNT(*)
FROM v$log_history
GROUP BY TO_CHAR(first_time, 'YYYY-MM-DD HH24')
ORDER BY hour DESC;
4️⃣ CPU Bottleneck Affecting LGWR
- Cause: LGWR competes for CPU with other processes, leading to commit delays.
- Fixes:
- Check CPU usage and ensure LGWR is not starved.
- On highly concurrent systems, consider adding more CPU or optimizing application concurrency.
👉 Check top background process waits:
SELECT p.spid, s.sid, s.event, s.wait_time
FROM v$session s, v$process p
WHERE s.paddr = p.addr AND s.sid IN (SELECT blocking_session FROM v$session WHERE blocking_session IS NOT NULL);
5️⃣ High Redo Generation (Too Much DML)
- Cause: Large volumes of DML generating excessive redo, overwhelming LGWR.
- Fixes:
- Optimize DML: use bulk processing, minimize unnecessary redo.
- Use NOLOGGING where safe (ETL loads, indexes).
👉 Check redo generated per transaction:
SELECT name, value FROM v$sysstat WHERE name LIKE '%redo%';
📝 Quick Diagnosis for log file sync
- Check sessions waiting:
SELECT sid, event, seconds_in_wait, state
FROM v$session
WHERE event = 'log file sync';
- Review system-level commit and redo stats:
SELECT name, value FROM v$sysstat
WHERE name IN ('user commits', 'redo size', 'log file sync waits');
- If using AWR or Statspack, look for:
log file sync
average wait time (should be ideally < 1 ms, problematic if > 10 ms).
✅ Summary Table of Solutions:
Cause | Solution |
---|---|
Too many commits | Batch commits, application change |
Slow redo log disks | Move redo to faster storage |
Small redo logs | Increase redo log file size |
CPU contention | Add CPU, reduce process concurrency |
Excessive redo generation | Tune DML, consider NOLOGGING for bulk |
👉 Key Takeaways:
- High
log file sync
→ indicates commit response time problems, often noticeable to end-users. - It’s tightly linked to LGWR performance, redo subsystem, and application commit patterns.
I hope this was helpful.