AG log backup

Chaitanya Kiran 801 Reputation points
2023-02-14T03:25:30.1733333+00:00

In Availability Group, if I take a log backup on primary replica, does SQL Server take log backup on all the secondary replicas?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,492 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,571 Reputation points
    2023-02-14T07:19:05.26+00:00

    Hi @Chaitanya Kiran ,

    Please refer to this blog:

    https://www.sqlshack.com/sql-server-always-on-availability-group-log-backup-on-secondary-replicas/

    SQL Server ensures consistent log backup chain regardless on which replica we took log backup. It is also independent of the synchronous or asynchronous data commit mode.

    Please read this blog carefully, I am sure it will be useful for you.

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  2. Seeya Xi-MSFT 16,571 Reputation points
    2023-02-15T08:02:13.02+00:00

    Hi @Chaitanya Kiran ,

    Let me update my answer.

    In SQL Server Availability Groups, taking a log backup on the primary replica does not automatically trigger a log backup on all secondary replicas. But its LSN will be updated, as you can see from the test in the link I posted earlier.

    In an Availability Group configuration, each replica maintains its own independent transaction log, which is used for local recovery in case of a failover. When a log backup is taken on the primary replica, it only backs up the transaction log of the primary database on that primary replica.

    However, you can configure secondary replicas to perform automatic backups using the "backup preferences" feature of the Availability Group. When backup preferences are configured, SQL Server can automatically take backups on secondary replicas based on the defined preferences.

    User's image

    It is important to note that the log backups taken on the secondary replicas are independent of the backups taken on the primary replica. However, all backups, including log backups taken on secondary replicas, can be used during a restore operation to bring a database up to the desired point in time.

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

Your answer

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