In the backups I'm doing in my database, the first LOG backup I do after the FULL backup is taking too much space, even more than the full backup.
For example:
4:50 AM: FULL BACKUP - .bak 7.2GB
6:30 AM: LOG BACKUP - .trn 9.3GB
7:00 AM: LOG BACKUP - .trn 2mb
7:30 AM: LOG BACKUP - .trn 150mb
8:00 AM: LOG BACKUP - .trn 1mb
8:30 AM: LOG BACKUP - .trn 50mb
Note that the first LOG backup is in GB, while the others are in MB.
What I'm doing is the following:
- 4:50 am: (using multiple steps in the same job, not running all of them in parallel)
- Index optimize
- DB integrity check
- FULL backup
- 6:30am and every 30 minutes after that:
- LOG backup
Also, another job called PurgeOldImportData
is executed every hour and it deletes old information, but it's currently deleting very little information (if any). In fact, it takes only 2 seconds to execute.
Can anyone tell me why is this happening? Besides the space it takes, it takes longer to do the RESTORE
. Thank you!
UPDATE:
I'm using Ola Hallengren's scripts for backup. This is what each job/step does:
JOB: DatabaseBackup - FULL
- IndexOptimize:
[dbo].[IndexOptimize] @Databases = 'USER_DATABASES'
- Database Integrity Check:
[dbo].[DatabaseIntegrityCheck] @Databases = 'USER_DATABASES'
- Full Backup:
[dbo].[DatabaseBackup] @Databases = 'USER_DATABASES', @Directory = N'D:\SQLServer\Backups', @BackupType = 'FULL', @Verify = 'Y', @CleanupTime = 24, @CheckSum = 'Y'
- BackupToS3: (executes a .bat which moves the file, does not touch the SQL Server)
JOB: DatabaseBackup - LOG
[dbo].[DatabaseBackup] @Databases = 'USER_DATABASES', @Directory = N'D:\SQLServer\Backups', @BackupType = 'LOG', @Verify = 'Y', @CleanupTime = 24, @CheckSum = 'Y'
- BackupToS3: (executes a .bat which moves the file, does not touch the SQL Server)
At night users run some import data files, but they are not running nothing that produces 9GB of changes AFAIK. Even more, the biggest data imports are not run from 4:50am to 6:30am.