-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log backups are not working for availability groups with backup preference set to 'Prefer Secondary' #779
Comments
" The full and diff backups are running on the primary but those backups are working only 'LOG' backups are not working." Hi Mitesh checking are you running the backup on the primary or secondary replica? |
Hi,
I am running backups on the primary.
Thanks,
Mitesh
…On Mon, Nov 27, 2023 at 8:00 AM griffitmatt ***@***.***> wrote:
" The full and diff backups are running on the primary but those backups
are working only 'LOG' backups are not working."
Hi Mitesh checking are you running the backup on the primary or secondary
replica?
—
Reply to this email directly, view it on GitHub
<#779 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AITCT3FYHHMHQFGQYDZUB43YGOYJBAVCNFSM6AAAAAA62CLJ6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWHEYDENJWGA>
.
You are receiving this because you authored the thread.Message ID:
<olahallengren/sql-server-maintenance-solution/issues/779/1826902560@
github.com>
|
refer to https://ola.hallengren.com/frequently-asked-questions.html How should I configure DatabaseBackup to back up an Availability Group? Not all backup types are supported on the secondary replica. Here are the backup types that are supported: Copy-only full backups Full backups (non copy-only) and differential backups are only supported on the primary replica. DatabaseBackup will always perform these types of backups on the primary replica. Here are some different backup strategies that you can use: Perform all the backups on the secondary replica. With this strategy you can only perform copy-only full, and log backups (non copy-only). You need to check that the backup preference is set to Prefer Secondary for the availability group. You also need to add @copyonly = 'Y' to the full backup jobs, and disable the differential backup jobs. Perform full (non copy-only) and differential backups on the primary replica, and log backups on the secondary replica. You need to check that the backup preference is set to Prefer Secondary for the availability group. You don't need to add any additional parameters to the full, differential, or log backup jobs. |
I have a similar experience. With standard edition:
Step: DatabaseBackup - USER_DATABASES - LOG Also tried In the commandLog table I only ever see just one AG. The following runs one for each AG on the primary: |
To answer my own question, the reason was not to do with AGs, but the fact that LogShipping was also enabled on some DBs. |
Description of the issue
The log backups are not being taken for the databases which are in availability groups with backup preference set to "Prefer Secondary"
SQL Server version and edition
Microsoft SQL Server 2022 (RTM-CU8) (KB5029666) - 16.0.4075.1 (X64) Aug 23 2023 14:04:50 Copyright (C) 2022 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2022 Standard 10.0 (Build 20348: ) (Hypervisor)
Version of the script
2022-12-03 17:23:44
What command are you executing?
EXECUTE [dbo].[DatabaseBackup] @Databases = 'USER_DATABASES', @Directory = NULL, @BackupType = 'LOG', @Verify = 'Y', @CleanupTime = 72, @CheckSum = 'Y', @LogToTable = 'Y'
What output are you getting?
The log backups are not being taken at all. The backup script is executing on primary. The full and diff backups are running on the primary but those backups are working only 'LOG' backups are not working. The other databases which are not in the availability group are working fine.
I suspect something wrong in the following code block (on line 2809)
The text was updated successfully, but these errors were encountered: