sql-server-maintenance-solution icon indicating copy to clipboard operation
sql-server-maintenance-solution copied to clipboard

Parallel execution will not restart until all executions are finished

Open wfvdijk opened this issue 3 years ago • 3 comments

I have 150 databases in full recovery, 1 database is extremely large and it's constantly under pressure, resulting in a large logfile. I've created 2 logbackupjobs running constantly, every 6 minutes, 3 minutes after each other. These jobs are executing the same statement for logbackup. I use parameters @LogSizeSinceLastLogBackup = 128, @TimeSinceLastLogBackup =1800, @DatabasesInParallel = 'Y' When logbackupjob 1 starts it processes alle the databases. 3 minutes later, the 2nd job starts the logbackup. The first job hits the large database, resulting in a logbackup for 40 minutes. The 2nd job finishes the remaining databases and ends normally. The first job is waiting to complete the large database for 40 minutes. During these 40 minutes the 2nd logbackupjob restarts several times but does not recognize new logbackup candidates. It looks like new logbackups are only added after the first job is completed. If I run the logbackup manually during these 40 minutes (without @databasesinparallel but with the other parameters) I get new logbackup actions. To my opinion, new logbackupcandidates should be added regardless of running logbackups in parallel

SQL Server version and edition SQL2019 Enterprise CU16

Version of the script Version: 2022-01-02 13:58:13

What command are you executing? exec databasebackup
@databases = 'ALL_DATABASES', @backupType = 'Log', @Cleanuptime = 36, @Verify = 'N', @Checksum = 'Y', @ChangeBackupType = 'Y', @LogtoTable = 'Y', @LogSizeSinceLastLogBackup = 128, @TimeSinceLastLogBackup =1800, @DatabasesInParallel = 'Y'

What output are you getting? (from 2nd job): Date and time: 2022-06-14 09:12:20 Server: DB4 Version: 15.0.4223.1 Edition: Enterprise Edition: Core-based Licensing (64-bit) Platform: Windows Procedure: [DBAtools].[dbo].[DatabaseBackup] Parameters: @Databases = 'ALL_DATABASES', @Directory = NULL, @BackupType = 'Log', @Verify = 'N', @CleanupTime = 36, @CleanupMode = 'AFTER_BACKUP', @Compress = NULL, @CopyOnly = 'N', @ChangeBackupType = 'Y', @BackupSoftware = NULL, @CheckSum = 'Y', @BlockSize = NULL, @BufferCount = NULL, @MaxTransferSize = NULL, @NumberOfFiles = NULL, @MinBackupSizeForMultipleFiles = NULL, @MaxFileSize = NULL, @CompressionLevel = NULL, @Description = NULL, @Threads = NULL, @Throttle = NULL, @Encrypt = 'N', @EncryptionAlgorithm = NULL, @ServerCertificate = NULL, @ServerAsymmetricKey = NULL, @EncryptionKey = NULL, @ReadWriteFileGroups = 'N', @OverrideBackupPreference = 'N', @NoRecovery = 'N', @URL = NULL, @Credential = NULL, @MirrorDirectory = NULL, @MirrorCleanupTime = NULL, @MirrorCleanupMode = 'AFTER_BACKUP', @MirrorURL = NULL, @AvailabilityGroups = NULL, @Updateability = 'ALL', @AdaptiveCompression = NULL, @ModificationLevel = NULL, @LogSizeSinceLastLogBackup = 128, @TimeSinceLastLogBackup = 1800, @DataDomainBoostHost = NULL, @DataDomainBoostUser = NULL, @DataDomainBoostDevicePath = NULL, @DataDomainBoostLockboxPath = NULL, @DirectoryStructure = '{ServerName}${InstanceName}{DirectorySeparator}{DatabaseName}{DirectorySeparator}{BackupType}{Partial}{CopyOnly}', @AvailabilityGroupDirectoryStructure = '{ClusterName}${AvailabilityGroupName}{DirectorySeparator}{DatabaseName}{DirectorySeparator}{BackupType}{Partial}{CopyOnly}', @FileName = '{ServerName}${InstanceName}{DatabaseName}{BackupType}{Partial}{CopyOnly}{Year}{Month}{Day}{Hour}{Minute}{Second}{FileNumber}.{FileExtension}', @AvailabilityGroupFileName = '{ClusterName}${AvailabilityGroupName}{DatabaseName}{BackupType}{Partial}{CopyOnly}{Year}{Month}{Day}{Hour}{Minute}{Second}{FileNumber}.{FileExtension}', @FileExtensionFull = NULL, @FileExtensionDiff = NULL, @FileExtensionLog = NULL, @Init = 'N', @Format = 'N', @ObjectLevelRecoveryMap = 'N', @ExcludeLogShippedFromLogBackup = 'Y', @DirectoryCheck = 'Y', @StringDelimiter = ',', @DatabaseOrder = NULL, @Databases... Version: 2022-01-02 13:58:13 Source: https://ola.hallengren.com

Date and time: 2022-06-14 09:12:22

wfvdijk avatar Jun 14 '22 07:06 wfvdijk

Hey wfvdijk I know it's not entirely what you're asking for, but why not have the two log backup jobs run in parallel but exclude that extremely large database and give it its own job? Also just curious how large of a database it is if you're seeing 40 minute log backups.. Got some terribly large databases here, but don't have a single log backup here that takes that long.

bwiggin10 avatar Sep 28 '22 16:09 bwiggin10

I already implemented your suggestion so the logbackup for the large database runs in a separate job. This database is 4TB in size and is heavily used by several customers with actions like queued operations, select into temp tables, XML shredding and CLR operations. TDE also enabled

wfvdijk avatar Sep 29 '22 10:09 wfvdijk