개발 공부

(Oracle, dataguard) sync remote write event 본문

DB, SQL

(Oracle, dataguard) sync remote write event

아이셩짱셩 2025. 5. 19. 14:31
728x90

"sync remote write" means:

A foreground session is waiting for redo to be written to a remote destination (typically a Data Guard standby database) in synchronous mode.

 

📦 When Does It Happen?

  • When you're using Oracle Data Guard in SYNC mode (i.e., SYNC AFFIRM or SYNC NOAFFIRM).
  • The primary database must wait until the redo is written to the standby's standby redo log (SRL).
  • This happens during commits, DML, or other redo-generating operations.

Why the Wait?

Oracle ensures zero data loss in SYNC mode — so:

  1. Primary sends redo to the standby.
  2. Primary waits for acknowledgment:
    • AFFIRM: Waits until redo is flushed to disk on the standby.
    • NOAFFIRM: Waits until redo is received in memory on the standby.

Only after that, the primary proceeds — which causes the "sync remote write" wait event.

 

✅ "sync remote write" Is Associated with LGWR

🔍 Why?

When you're using Data Guard in SYNC mode, Oracle uses the Log Writer (LGWR) process on the primary database to transmit redo to the standby.

  • This is different from ASYNC mode, which uses LNS (Log Network Server).
  • In SYNC mode, LGWR is responsible for writing to both:
    • The local online redo log
    • The remote standby redo log (over the network)

That’s why:

  • The wait event is "sync remote write"the foreground session (e.g., a user COMMIT) waits until LGWR confirms that the redo was flushed to the standby (or at least acknowledged).
  • You see the wait event tied to a foreground session, but the action being waited on is performed by LGWR.
728x90
Comments