olahallengren / sql-server-maintenance-solution

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

Backups logs only when the log file is 75% full #505

Closed Tyrell66 closed 3 weeks ago

Tyrell66 commented 3 years ago

When a log backup is scheduled, only to run it if the log file is above a certain percentage (75% as an example).

olahallengren commented 2 years ago

Have you looked at the parameters @LogSizeSinceLastLogBackup and @TimeSinceLastLogBackup (to be used together)?

Here's how it can be used to perform a transaction log backup if 1 GB of log has been generated since the last log backup, or if it has not been backed up for 300 seconds. This enables you to do more frequent log backups of databases with high activity, and in periods of high activity.

EXECUTE dbo.DatabaseBackup
@Databases = 'USER_DATABASES',
@Directory = 'C:\Backup',
@BackupType = 'LOG',
@LogSizeSinceLastLogBackup = 1024,
@TimeSinceLastLogBackup = 300