May 4, 2023 at 8:36 am
EXECUTE dbo.DatabaseBackup
@Databases = 'USER_DATABASES',
@Directory = 'D:\DADOS-LOG',
@BackupType = 'LOG',
@LogSizeSinceLastLogBackup = 1,
@TimeSinceLastLogBackup = 60,
@DirectoryStructure = NULL,
@FileName = '{DatabaseName}_{BackupType}_{Partial}_{CopyOnly}.{FileExtension}',
@AvailabilityGroupDirectoryStructure = NULL
-- How to modify this script to generate 1 log file every 1 hour doing a backup every 1 hour?
May 4, 2023 at 8:51 am
Create a SQL Server Agent job (if using Standard/Enterprise/Developer) or Windows Task Scheduler job (if using any edition), which runs that code every 1 hour.
You may want to also remove the @TimeSinceLastLogBackup parameter in case it is something like 59minutes 58seconds as timings can fluctuate slightly, so you don't want to miss out on having a log backup taken.
May 4, 2023 at 9:14 am
With these changes made, am I able to restore the database to 5 hours ago, for example?
May 4, 2023 at 9:21 am
As long as you have the necessary full backup and an intact log chain yes.
But please make sure you have something backing up the D:\DADOS-LOG folder, if that was to be lost, then you cannot restore.
May 4, 2023 at 9:38 am
Thanks.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply