olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

AG backups fail when using the Data Domain Boost #760

Open JoeVizcaino opened 1 year ago

JoeVizcaino commented 1 year ago

Description of the issue Using the DataDomainBoost (DDB) option, all backups for databases that are part of an AG fail.

The DDB command created by the DatabaseBackup script, for the -c parameter (line 3718) is as follows: SET @CurrentCommand += ' -c ' + CASE WHEN @CurrentAvailabilityGroup IS NOT NULL THEN @Cluster ELSE CAST(SERVERPROPERTY('MachineName') AS nvarchar) END

In our case, the issue is @Cluster, this is the cause of the failure.

If we change the code to use MachineName instead, to mimic the command DDBMA (Data Domain Boost for Microsoft Applications) creates, it works every time on every server we have tested it on.

SQL Server version and edition

Microsoft SQL Server 2019 (RTM-CU21) (KB5025808) - 15.0.4316.3 (X64) Jun 1 2023 16:32:31 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2019 Standard 10.0 (Build 17763: ) (Hypervisor)

Version of the script

2022-01-02 13:58:13

What command are you executing?

sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d master -Q "EXECUTE [dbo].[DatabaseBackup] @Databases = 'AVAILABILITY_GROUP_DATABASES',@BackupType = 'FULL',@CopyOnly= 'Y',@Compress='Y',@Verify = 'N',@CheckSum = 'Y',@LogToTable = 'Y',@BackupSoftware = 'DATA_DOMAIN_BOOST',@DataDomainBoostHost = '',@DataDomainBoostUser = 'DD-SQL',@DataDomainBoostDevicePath = '/NonProd_SQL',@DataDomainBoostLockboxPath = 'C:\Program Files\DPSAPPS\common\lockbox',@CleanupTime = 1" -b

What output are you getting?

Date and time: 2023-08-15 21:16:34 Database: [TESTDB] State: ONLINE Standby: No Updateability: READ_WRITE User access: MULTI_USER Recovery model: FULL Encrypted: No Is accessible: Yes Availability group: Availability group role: SECONDARY Availability group backup preference: SECONDARY Is preferred backup replica: Yes Differential base LSN: 53000002197300001 Last log backup LSN: 53000002171400001 Allocated extent page count: N/A Modified extent page count: N/A

Date and time: 2023-08-15 21:16:34 Database context: [master] Command: DECLARE @ReturnCode int EXECUTE @ReturnCode = dbo.emc_run_backup ' -c -l full -y +1d -k -S 1 -a "NSR_DFA_SI_DD_HOST=" -a "NSR_DFA_SI_DD_USER=DD-SQL" -a "NSR_DFA_SI_DEVICE_PATH=/NonProd_SQL" -a "NSR_DFA_SI_DD_LOCKBOX_PATH=C:\Program Files\DPSAPPS\common\lockbox" -a "NSR_SKIP_NON_BACKUPABLE_STATE_DB=TRUE" -a "BACKUP_PROMOTION=NONE" -a "NSR_COPY_ONLY=TRUE" "MSSQL:TESTDB"' IF @ReturnCode <> 0 RAISERROR('Error performing Data Domain Boost backup.', 16, 1) 2023-08-16T02:16:37.401Z 1692152197 28848 1 5 0 1284 5812 0 ddbmsqlsv PowerProtect Data Manager notice 15 Unknown host %s 1 12 14 2023-08-16T02:16:37.401Z 1692152197 43709 1 0 0 1284 5812 0 ddbmsqlsv PowerProtect Data Manager notice 13 Stop time: %s 1 35 24 Tue Aug 15 21:16:37 2023 Msg 50000, Level 16, State 1, Line 1 Error performing Data Domain Boost backup. Outcome: Failed Duration: 00:00:03 Date and time: 2023-08-15 21:16:37

JoeVizcaino commented 1 year ago

Changing line 3718 to this, works for us. SET @CurrentCommand += ' -c ' + CAST(SERVERPROPERTY('MachineName') AS nvarchar)