Explain the function of DBWR, LGWR, SMON, PMON processes.

Explain the function of DBWR, LGWR, SMON, PMON processes.

If the Oracle Instance is a high-functioning engine, the Background Processes are the mechanical parts that keep it from overheating, seizing up, or losing data.

While there are dozens of background processes in a modern Oracle database, four of them—DBWn, LGWR, SMON, and PMON—are the "Big Four." Without them, the database simply cannot function.


1. DBWn (Database Writer)

The Janitor

The Database Writer’s job is to take modified data (called "dirty buffers") from the memory (SGA) and write them onto the physical Data Files on the disk.

  • Why it exists: Writing to disk is slow. To keep the database fast, Oracle makes changes in memory first. DBWn eventually syncs those changes to the disk.

  • The "n" in DBWn: Large databases can have multiple writers (DBW0, DBW1, etc.) to handle heavy workloads.

  • Efficiency: It doesn't write every time you hit "Save." It writes in batches to optimize performance.


2. LGWR (Log Writer)

The Court Reporter

LGWR is arguably the most critical process for data integrity. It records every single change made to the database into the Redo Log Files.

  • The Golden Rule: Oracle follows a "Write-Ahead Logging" protocol. This means LGWR writes the record of the change to the disk before the actual data is updated in the data files.

  • Speed: Unlike the DBWn, which is lazy and waits for a batch, LGWR is fast. It writes the moment you COMMIT a transaction.

  • Safety: If the power goes out, Oracle uses the logs written by LGWR to "replay" the lost changes.


3. SMON (System Monitor)

The Recovery Expert

SMON is the "housekeeping" process that keeps the system healthy. Its most famous role happens during a reboot after a crash.

  • Instance Recovery: If the database crashed unexpectedly, SMON wakes up during the next startup, checks the Redo Logs, and makes sure the data files are consistent.

  • Space Management: It cleans up "temporary segments" that are no longer needed (like the leftovers from a massive sort operation that finished).

  • Coalescing: It merges free space in data files to make it easier for Oracle to find large chunks of contiguous space.


4. PMON (Process Monitor)

The Cleanup Crew

If SMON monitors the system, PMON monitors the users. It watches over the individual user processes connecting to the database.

  • Handling Crashed Users: If a user’s laptop dies or their network connection drops while they have an active transaction, PMON notices. It rolls back their uncommitted changes and releases the "locks" they were holding so other users aren't stuck waiting.

  • Listener Registration: PMON also talks to the Oracle Listener, telling it, "Hey, I'm here and ready to accept new connections!"


The "Big Four" Comparison Table

ProcessFull NamePrimary ResponsibilityCritical Moment
DBWnDatabase WriterWrites data blocks to disk.When the Buffer Cache is full.
LGWRLog WriterWrites transaction logs to disk.Every time you COMMIT.
SMONSystem MonitorCleans up system/Instance recovery.During Database Startup.
PMONProcess MonitorCleans up failed user sessions.When a user disconnects abruptly.

What happens if one dies?

If any of these four processes fail or are "killed" at the OS level, the entire Oracle Instance will usually crash immediately as a safety precaution to prevent data corruption. They are the vital organs of the database!

Looking for servers Rental ?

Call Our Expert :


  • (call for rental enquiries)

Email us :