DB STARTUP events in AG replica SQL error log

subhash-DBA 155 Reputation points
2025-11-16T22:59:43.8533333+00:00

HI Team,

we got an Availability group with 4 nodes (1 primary, 2 synch nodes, 1 asynch node).

in the secondary replica sql error logs I see frequent messages as below for various secondary databases.

Example:

Buffer Pool scan took 11 seconds: database ID 5, command 'DB STARTUP', operation 'FlushCache', scanned buffers 80175186, total iterated buffers 103125903, wait time 4 ms. See 'https://go.microsoft.com/fwlink/?linkid=2132602' for more information.

I wonder first of all why 'DB STARTUP' events are happening in secondary and what cause it. I understand the fact the buffer pool scan occur when DB Recovery and some of the similar events occur.

SQL Server 2019 :

Microsoft SQL Server 2019 (RTM-CU32-GDR) (KB5063757) - 15.0.4440.1 (X64) Jul 14 2025 12:59:40 Copyright (C) 2019 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2022 Standard 10.0 <X64> (Build 20348: )

SQL Server Database Engine
{count} votes

1 answer

Sort by: Most helpful
  1. Lakshmi Narayana Garikapati 640 Reputation points Microsoft External Staff Moderator
    2025-11-28T10:11:36.2266667+00:00

    Hi @subhash-DBA,

    What you’re seeing in the error log is expected behavior in Availability Groups. Even on secondary replicas, SQL Server runs database recovery phases (redo/undo) to apply log records from the primary. During these transitions, the engine issues a DB STARTUP event and performs a buffer pool scan (FlushCache) to ensure consistency.

    A few points to clarify:

    Why on secondaries: Recovery is required on all replicas, not just the primary. That’s why you see DB STARTUP messages in the secondary logs.

    Buffer pool scan: Large databases can make these scans take several seconds. The message is informational, not an error.

    Frequency: If you notice these messages only after service restarts, patching, or role changes, that’s normal. If they occur very frequently, it may indicate replica instability (network interruptions, sync state changes).

    Reference: Microsoft added more detailed buffer pool scan logging in recent builds, so these entries are more visible now.

    https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/performance/buffer-pool-scan-runs-slowly-large-memory-machines

    Unless you’re seeing repeated recovery cycles every few minutes, these messages don’t indicate a fault. They simply reflect the recovery and synchronization work SQL Server is doing on the secondary.

    Thanks,

    Lakshmi.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.