Knowledge · Backup & Restore Advanced · Part 2

SQL Server Backup and Restore: Planning for the Real Incident

With backup and restore, the difficult questions often lie between the individual commands. Which full backup does the diff belong to? Where are the logs that were created on another replica? Is the certificate still available when the original server has failed? And how much of the agreed recovery time is left for the actual restore once the files have been retrieved and copied? This part takes a closer look at the path to the right data state, with our own lab tests on SQL Server 2022 and 2025.

Oct 22, 2026 · approx. 18 minutes · Lab run of Oct 22, 2026 · SQL Server 2022 and 2025

Lab SQL Server 2022 · 202513 figures to try outPart 1 Basics ←Play along Quiz ↓

In short

  • Plan a complete route. For every relevant failure scenario, it leads to a specific data state.
  • Check all dependencies: the set of files, base and log relationships, keys and the target environment.
  • Measure the path up to the application being signed off for use, not just the duration of the restore command.
  • Job status and backup age are important signals, but not complete proof.

TakeawayPlan and test a specific recovery path.

MisconceptionFile age or the newest file is enough to choose a restore chain.
CorrectThe newest file may come too late, belong to the wrong base or be only one part of a stripe set. What matters is the base, the log coverage and the specific selection.

How do you get to the right data state?

SQL Server provides powerful native features for backup and restore. Ola Hallengren’s Maintenance Solution automates their use. Dependable operations combine these building blocks with a specific recovery objective, complete dependencies and repeatable tests.

This article assumes you know full, differential and log backups; Part 1 explains these basics. Times and operational objectives in the figures are schematic examples unless they are explicitly marked as lab evidence.

Typical situations

Jump straight to your case:

Along the way, we clear up four common misconceptions:

  1. “An additional full backup breaks the log chain.” A normal full backup resets the differential base. The log backup sequence is separate from that.

    resolved in: Three relationships ↓
  2. “The newest file is the right one.” A full backup taken after the target time cannot be rewound.

    resolved in: Restore to a point in time ↓
  3. “Keeping seven days means being able to restore seven days.” The required full base can be older than seven days.

    resolved in: Retention ↓
  4. “A 35-minute restore fits into a one-hour RTO.” Only if all other phases up to sign-off fit into the remaining time.

    resolved in: RTO ↓

A route has three different relationships

The picture from Part 1 still applies: we look for a starting point, possibly a shortcut, and further sections up to the target. In the advanced case, we distinguish three things.

  1. The differential baseA differential backup belongs to a specific base. A normal full backup resets this base. An older full backup and a diff on a newer base therefore do not fit together.
  2. Log coverageThe required logs must cover the needed range without gaps. An additional normal full backup does not break the log backup chain. At most, it can create another entry point for other restore paths.
  3. The specific selectionFor the target time, we choose a combination that is actually available. The newest file may come too late, belong to the wrong base or be only one part of a stripe set.
Figure 1Diagram

Three tracks, one timeline

An additional full backup is taken in the middle of the sequence. Switch between the two: what changes, what stays the same?

Normal full backup F1: Later diffs refer to F1. The log chain L1 to L4 continues unchanged. Route to the target: F1 + D1 + L4.Copy-only full backup C1: The base of D1 remains F0; C1 itself is not a differential base. The log chain continues unchanged. Route to the target: F0 + D1 + L4.

With COPY_ONLY instead of a normal full backup: The base line would stay at F0 and the log track would be unchanged; route to the target F0 + D1 + L4.

FFullCCopy-only fullDDiffLLogTarget
Diagram. Differential base, log sequence and file selection are different relationships: the additional normal full backup only moves the base line. That it does not break the log chain is documented by Microsoft; it was not a separate test in the lab.

To track this, SQL Server manages log sequence numbers (LSNs), base information and recovery fork references, among other things. These are technical relationships, not clock times. An inventory includes the backup headers, the available media families and, if needed, the history in msdb. In a disaster, it must be possible to select the files even when the original msdb is not available (Microsoft: Restore Sequences).

A practical inventory provides the following for each backup set: database identity, type, start and end, copy-only flag, relevant LSNs, differential base, media position, all required files and any encryption dependency. Names and file dates help with orientation. They do not replace the technical mapping.

COPY_ONLY: additional backups without a new differential base

A developer needs a current copy. The regular plan uses a full backup on Sunday and daily diffs. If an additional normal full backup is taken on Tuesday, later diffs are based on this new full backup. Anyone who still considers only the Sunday full backup during the restore may fail.

For the additional copy, a deliberately chosen COPY_ONLY full backup is often the right choice:

Additional full backup without a new differential baseT-SQL
BACKUP DATABASE [BackupDemo]
  TO DISK = N'D:\SQLBackup\BackupDemo_extra_copy_01.bak'
  WITH COPY_ONLY, CHECKSUM, COMPRESSION;

This full backup leaves the existing differential base unchanged. It can be restored like any full backup, but it does not itself become a new differential base. A diff taken afterwards therefore cannot be applied to this copy just because the copy was taken shortly before it (Microsoft: Copy-only Backups).

Lab question Does a copy-only full backup change the base of the next diff?

Setup Create full backup F0, change data, create an additional copy-only full backup C0, change data again and back up diff D2. Later, a normal full backup F1 and a new diff D3 follow.

Figure 2LabSQL Server 2022 and 2025 identical

The copy-only lab

The backups in the order of the experiment. Arcs at the top: which full backup a diff belongs to.

CombinationResult (SQL Server 2022 and 2025)
F0 + D24 markers
C0 + D2Error 3136
F0 + D3Error 3136
F1 + D35 markers
Lab, SQL Server 2022 and 2025 with identical results. Copy-only leaves the differential base in place; a normal full backup resets it. Marker count after restore and full CHECKDB. D1 comes from the basics experiment in Part 1.

Observation On SQL Server 2022 and 2025, F0 plus D2 can be restored. C0 plus D2 is rejected with error 3136. After a later normal full backup F1, the new diff D3 needs F1 as its base; F0 plus D3 fails as well.

Conclusion Additional backups belong in the operating rules. State their purpose and decide deliberately whether they should change the differential base. That is a different question from continuing the log chain.

When a log backup is missing

Full F0, log L1, log L2, log L3: the intended restore path needs complete coverage. If L2 is missing, L3 cannot simply stand in for the log ranges that are missing with it. SQL Server can reject the restore with error 4305.

In the lab, we create exactly this gap by leaving out L2 when applying the logs. Once the existing L2 is provided and applied, the sequence can continue. In the experiment, we do not delete any unknown production files and do not simulate a complete server loss.

Figure 3Lab

The gap before L3

L3 is intact. Apply the sequence, then provide L2 from another storage location.

Ready. The sequence has not been applied yet.

L1 → L3: Error 4305

Original message (SQL Server 2022; 2025 identical, with different LSN values)

Msg 4305, Level 16, State 1, Server …, Line 1
The log in this backup set begins at LSN 42000000053600001, which is too recent to apply to the database. An earlier log backup that includes LSN 42000000049600001 can be restored.

The database is at the state after L1. L3 starts later; the range in between is in L2. The newer file cannot replace this section.

F0 → L1 → L2 → L3 applied completely

The result is the latest log state with three markers, the same state as on the right in Figure 0.

With L2 provided, the sequence F0 → L1 → L2 → L3 can be applied completely confirmed in the lab

Diagram And a later full backup?

A later full backup can make later recovery targets reachable. It does not reconstruct the missing history.

Lab, SQL Server 2022 and 2025. A missing required section blocks this path; the newest file does not help here. In the experiment, L2 was left out when applying the logs, not deleted.

In practice, this means: first take inventory of all storage locations, copies and the jobs that create them. Check whether a file that exists elsewhere closes the gap or whether another suitable base opens up a new restore path.

Another regular log backup job can also be relevant: if logs are backed up to other storage, the required sections may be there. Multiple tools must fit into one common plan. Copy-only log backups affect the regular log archive point differently and need to be assessed specifically.

@ChangeBackupType='Y' in Ola looks for a backup type that can be performed when prerequisites are missing. It does not repair a lost historical file. The backup type actually created must therefore be part of monitoring.

Restoring to a specific point in time

An accidental delete at 14:07 is a different case from a hardware failure in which you want the latest reachable state. For the state immediately before the delete, you need a suitable base before the target and the required logs up to that point in time.

A full backup that only ends after the desired point in time cannot be played backward to it. If necessary, choose an older full backup. A diff must not already have passed the desired point in time either.

Figure 4DiagramTimes: planning example

Which route reaches the target?

Full backup at 00:00, diff at 12:00, an additional full backup at 15:00, logs every two hours. Move the target time.

Target 14:06:50. Route: F 00:00 → D 12:00 → L7 (12:00–14:00) → L8 (14:00–16:00) with STOPAT. The full backup from 15:00 ends after the target and cannot be rewound to it.

FselectedLnot needed for this targetFafter the target: lockedTarget
Diagram, times as a planning example. A later full backup cannot be rewound to an earlier target; an older full backup with matching log coverage reaches it. A diff only counts if it lies before the target and belongs to the chosen base.

A schematic sequence under a new test name looks like this:

Point-in-time restore under a new name (example)T-SQL
DECLARE @TargetTime datetime = '2026-10-22T14:06:50';

RESTORE DATABASE [BackupDemo_PointTest]
  FROM DISK = N'D:\SQLBackup\BackupDemo_full_01.bak'
  WITH MOVE N'BackupDemo'
         TO N'D:\SQLData\BackupDemo_PointTest.mdf',
       MOVE N'BackupDemo_log'
         TO N'D:\SQLLog\BackupDemo_PointTest.ldf',
       NORECOVERY, CHECKSUM;

RESTORE LOG [BackupDemo_PointTest]
  FROM DISK = N'D:\SQLBackup\BackupDemo_log_01.trn'
  WITH NORECOVERY, CHECKSUM, STOPAT = @TargetTime;

RESTORE LOG [BackupDemo_PointTest]
  FROM DISK = N'D:\SQLBackup\BackupDemo_log_02.trn'
  WITH NORECOVERY, CHECKSUM, STOPAT = @TargetTime;

-- Only after the required logs up to the target have been applied:
RESTORE DATABASE [BackupDemo_PointTest] WITH RECOVERY;

Files, logical file names and the point in time are examples. The required list of logs must be determined for the actual backup sets. Microsoft recommends specifying the same target time in every log restore. Afterwards, check that the intended data state was reached. Time zone, server time, application timestamps and a possible daylight saving time change are part of the mapping (Microsoft: Point-in-time Restore).

In the lab Before a targeted delete, the SQL Server time is recorded. The STOPAT restore contains the record that existed before and not the change inserted afterwards. The restore to the latest log state, by contrast, contains the later change. That is why we do not just count rows; we check the specific markers.

Figure 5Lab

STOPAT versus the latest log state

Order as in the lab, spacing schematic. Two seconds passed between the recorded target time and the change.

  1. F0with marker 1
  2. + 2INSERT
  3. L1Log
  4. + 3INSERT
  5. L2Log
  6. Targettime recorded
  7. − 3DELETE · 2 s later
  8. + 4INSERT
  9. L3Log

Restore up to the target STOPAT

123

3 rows · marker 3 present, marker 4 missing

Restore up to the latest log state

124

3 rows · after DELETE of 3 and INSERT of 4

Lab, SQL Server 2022 and 2025. The same row count can mean different data states: before the target, marker 3 exists; after the delete, marker 4 exists instead. We checked the specific markers, not just the count.

With BULK_LOGGED, a log backup that contains minimally logged changes cannot provide an arbitrary STOPAT within that backup. The restriction applies to that section. Include planned bulk operations in your recovery decision.

Tail-log: capturing changes that are not yet backed up

After the last regular log backup, further changes may exist. If the necessary prerequisites are met, a tail-log backup captures the remaining part of the log that has not yet been backed up. When you restore to the latest possible state, this can prevent data loss.

For a database that is still online, the following example shows a deliberate recovery intervention.

Tail-log backup (recovery intervention)T-SQL
-- CAUTION: deliberate recovery intervention, not a job.
-- NORECOVERY puts the source into RESTORING; normal use is interrupted afterwards.
-- Run only as part of a coordinated recovery procedure.
BACKUP LOG [BackupDemo]
  TO DISK = N'D:\SQLBackup\BackupDemo_tail_01.trn'
  WITH NORECOVERY, CHECKSUM;
Figure 6Lab

The rest of the log is backed up

After the last regular log backup, one more change follows. The tail-log backup captures it.

Source ONLINERESTORING

  1. L3last regular log backup
  2. +Change, not yet in any backup
  3. TailBACKUP LOG … WITH NORECOVERY

Separate target

F0 L1 L2 L3 Tail

4 markers, including the change from the tail

Lab, SQL Server 2022 and 2025. Here, NORECOVERY preserves the rest of the log and ends normal use of the source. The restore went to a separate target; afterwards, the source was brought back into service in the lab.

In the lab, a change that exists only in the tail is backed up and restored on a separate target together with the earlier backups. In a real incident, whether this is possible depends on which log files and database components are still usable. A lost or unusable log can block this path as well (Microsoft: Tail-log Backups).

For a target time that is already covered by existing backups, a tail-log backup is not required to reach that older state. Whether you additionally need to preserve the current remainder before further interventions remains a question of the specific case.

Ola in operation: keep selection, execution and result apart

A robust setup describes four levels:

LevelQuestion to answer
SelectionWhich databases and replicas should this run cover?
ExecutionWhich backup type and which options are actually executed?
File and copyWhich complete backup sets can be reached at the intended restore location?
RestoreWhich targets were most recently tested successfully with them?

For a traceable start, explicit options make sense: @Checksum='Y', @Verify='Y', @LogToTable='Y', compression suited to edition and load, and a deliberately defined type change. @Execute='N' helps you check the generated commands. It does not produce any evidence of a backup or restore.

A controlled ad hoc full backup can be prepared like this, for example:

Ad hoc full backup with Ola, as a preview firstT-SQL
DECLARE @ReturnCode int;
EXEC @ReturnCode = [DBA].dbo.DatabaseBackup
  @Databases = N'BackupDemo',
  @Directory = N'D:\SQLBackup',
  @BackupType = 'FULL',
  @CopyOnly = 'Y',
  @Compress = 'Y',
  @Checksum = 'Y',
  @Verify = 'Y',
  @ChangeBackupType = 'N',
  @CleanupTime = NULL,
  @LogToTable = 'Y',
  @Execute = 'N';
IF @ReturnCode <> 0
  THROW 50002, N'Ad hoc backup failed.', 1;

Before running it, check selection and target, and then use @Execute='Y'. Here, too, @Verify='Y' does not replace a full restore.

Important for monitoring: databases can be skipped because of their recovery model, state, a missing base or AG preference. In the lab, the LOG call for a SIMPLE database completes successfully without creating a log backup. An alert only on failed jobs would not detect this coverage gap.

Figure 7Diagramwith lab note

Six green commands, seven databases

On the left, the log of the runs; on the right, the expected inventory. Compare the two.

CommandLog 6 entries

DatabaseNameCommandTypeErrorNumber
DB 1BACKUP_DATABASE0
DB 2BACKUP_DATABASE0
DB 3BACKUP_DATABASE0
DB 4BACKUP_DATABASE0
DB 5BACKUP_DATABASE0
DB 6BACKUP_DATABASE0

Expected inventory 7 databases

  • DB 1Backup set ✓
  • DB 2Backup set ✓
  • DB 3Backup set ✓
  • DB 4Backup set ✓
  • DB 5Backup set ✓
  • DB 6Backup set ✓
  • DB 7no backup set ✕
  1. SelectionWhich databases?6 of 7 coverednot checked
  2. ExecutionWhat actually ran?6 × no errors
  3. File and copyReachable at the restore location?separate check
  4. RestoreLast tested successfully?separate proof

Compared: All six commands ran without errors. Even so, the seventh expected database was not backed up.The log alone shows six error-free commands.

Lab SimpleLab · Recovery SIMPLE

Ola’s call with @BackupType='LOG' ends with return code 0; new LOG backup sets: 0. For the same database, SQL Server rejects a native BACKUP LOG with error 4208:

Msg 4208, Level 16, State 1, Server …, Line 1
The statement BACKUP LOG is not allowed while the recovery model is SIMPLE. Use BACKUP DATABASE or change the recovery model using ALTER DATABASE.

SIMPLE has no regular log backup path. The successful Ola call does not show a defect in the Maintenance Solution; it shows why the expected coverage needs a check of its own.

Diagram with lab note. The log and the expected coverage complement each other: successful CommandLog rows cover only part of the expected databases. Names and rows on the left are an example; lab values appear only in the marked strip.

Therefore, compare the expected database inventory with the backup sets actually created, the required types, their age, and their file and copy status. Run restore tests as separate evidence. A CommandLog with six successful commands does not yet answer whether the seventh expected database was backed up (Ola: parameters and behavior, reviewed original code).

Retention: think backward from the oldest committed restore point

“Keep seven days” is ambiguous as a file rule. Should all files disappear after seven days? Or must every agreed point in time in the past seven days be reachable? For the latter, the required full base can be older than seven days.

Schematic example: the restore window begins on a Wednesday at noon. The full backup it requires is from the previous Sunday. If you delete this base purely by age, the oldest committed Wednesday can become unreachable despite newer logs. A later full backup does not help for an earlier target.

Figure 8DiagramPlanning example

Seven days of files or seven days of recovery?

Full backup on Sundays, diff daily, logs continuously. Committed: every point in time in the last seven days is reachable.

Oldest committed target: Wed, week 2, 12:00. Required for it: the full backup from Sun, week 2, 10.5 days old. Deleted by age: This full backup is gone. Targets from Wed, week 2, 12:00 up to the full backup from Sun, week 3 are unreachable, even though newer diffs and logs exist.

With the rule “keep the dependent set”, the full backup from Sun, week 2, the diff from Wed, week 2, and the logs from there on are kept; the whole window is reachable.

FFullDDiffLogsFdeleted

The figure explains the requirement. It does not simulate the cleanup algorithm of Ola’s Maintenance Solution; its @CleanupTime also counts in hours, not days. Whether your window holds must be shown by a test of the oldest committed point in time.

Diagram, weekdays and plan as a planning example. The required base can be older than the committed restore window. The deletion boundary for files and the recovery window are two different things.

For each committed target range, therefore, plan the complete set of base, any diff, required logs, all stripes and keys. Take successful external copies and their own lifecycle rules into account. Capacity planning needs headroom for a new generation before an old one is removed.

Ola’s @CleanupTime works in hours, not days. @CleanupMode='AFTER_BACKUP' is the default; the solution has protective logic for dependent backups. That is helpful, but it is not an acceptance test of your individual historical restore window. Switching to BEFORE_BACKUP just because space is tight can reduce exactly the protection that still exists (Ola: CleanupTime).

Deleting backup files, cleaning up msdb history and maintaining the CommandLog are separate tasks. sp_delete_backuphistory removes history, not backup files. For URL targets, Ola does not support a corresponding file cleanup; the storage lifecycle rules must be matched separately to the restore dependencies.

The most effective cross-check is a test of the oldest committed recovery point. If you only ever restore the most recent full backup, you never test the difficult edge of the retention window.

Deep dive Keys, storage and replicas

When the backup path gets longer

For environments with encryption, object storage or availability groups. You do not need these parts for the RTO section. Jump to RTO ↓

Encryption: the backup alone may not be enough

With native backup encryption, the target needs the matching certificate or asymmetric key. TDE-protected databases also have a key dependency. TDE and an additional backup encryption certificate are different layers.

The recovery inventory therefore includes certificates, private keys or the required access to external keys, and the associated secrets. They must be protected, reachable and retained long enough. Rotating a certificate does not automatically make old backups independent of the old certificate.

Figure 9Documented conceptnot run in the lab

Backup present, key missing

A fresh target instance and an encrypted backup. Load the key material.

Secured key store kept separately

  • Certificate
  • Private key
  • Associated secrets

Fresh target instance

  • Backup filepresent
  • Certificatemissingloaded
  • Private keymissingloaded

Restore not possibleRestore possible

After loading the certificate and private key from the secured store, the restore is possible according to the documentation.

Concept based on the Microsoft documentation, not run in the lab, not a lab result. The fresh target instance must meet all required key dependencies, and only from the secured store.

A meaningful test uses a fresh target instance on which the material is initially missing, and sets it up only from the secured store. A restore on the original server tests this loss scenario only to a limited extent. In our lab series, this key loss scenario is described as an extension, but has not been run yet (Microsoft: Backup Encryption, Move a TDE-protected database).

Stripes, copies and protected storage

Multiple files after TO DISK split a backup into media families. These stripes are parts that are needed together. They are not multiple complete backups. In the lab, verification fails with only one of two stripe files; with both, the database can be restored.

Figure 10Labright: diagram

Two stripes are one backup

On the left, one backup in two media families; on the right, two independent copies. Which files are available?

One backup, two stripes

Two independent copies Diagram

Only S1: verify fails

Original message (SQL Server)

Msg 3132, Level 16, State 1, Server …, Line 1
The media set has 2 media families but only 1 are provided. All members must be provided.

The backup consists of two media families. One alone is not a complete backup.

S1 + S2: restore with 5 markers, CHECKDB without errors

Only both files together make up the backup.

Lab, SQL Server 2022 and 2025; the right half is a diagram. Two stripes together form one backup. An independent copy, by contrast, contains the complete set.

Multiple independent copies are a different safeguard. Native media mirrors and Ola’s @MirrorDirectory have their own requirements, including edition limits. Multiple @Directory targets or @NumberOfFiles must therefore not simply be described as a number of copies (Microsoft: backup devices and stripes).

Separate copies, separate permissions and, where appropriate, immutable retention should match the failure and attack scenario. A URL target is not immutable just because of its address. Storage policy, write method, delete permissions and identities are what decide.

according to Microsoft documentation · not tested in the lab Version example: Microsoft documents direct backups to Azure container-level immutable storage for SQL Server 2025; older engines and version-level immutability are not generally covered by this. This is not a general statement about arbitrary S3, Azure or appliance targets. We did not test this storage path in our lab (Microsoft: Backup to URL, Immutable Storage).

Availability groups: a preference alone does not run a job

Jobs must exist on the intended replicas, evaluate the role and backup preference, and be able to access the required targets. A failover does not automatically redistribute your jobs and files.

Figure 11Diagram

After the role change

Two replicas, one backup job, two storage locations. Trigger the failover.

Check separately

  • Jobs present on the intended replicas?
  • Role and backup preference evaluated in the job?
  • Required targets reachable from there?
  • Restore from all involved storage locations rehearsed?
Diagram, not a lab result. A failover redistributes neither your jobs nor the files automatically. The backup preference is a rule that the job has to evaluate.

according to Microsoft documentation · not tested in the lab Up to SQL Server 2022, the familiar options of copy-only full backups and regular log backups apply to supported Enterprise AG secondaries. SQL Server 2025 extends native support to normal full and differential backups on secondaries. Basic AGs have separate restrictions; the extension must not be carried over unchecked to a Standard Edition topology (Microsoft: Backups on Secondary Replicas).

In the version of Ola’s solution we reviewed, there are @AvailabilityGroups, the database selection AVAILABILITY_GROUP_DATABASES and @OverrideBackupPreference; a parameter @AvailabilityGroupBackup does not exist there. @AvailabilityGroups and @Databases are not set at the same time. Actual support still depends on engine, edition, role and state.

For acceptance, a planned role change, the backups actually created afterwards and their restore from all involved storage locations belong together. This AG failover test is a proposed follow-up lab and not a result of the present single-instance tests.

Improving RTO: measure the entire process

The RTO (recovery time objective) is the agreed maximum time until the application can be used again. The right optimization starts with a breakdown of the time: provisioning, access to files and keys, transfer, full, differential and log restore, recovery, consistency check, instance objects and application sign-off.

Figure 12Planning example

A 35-minute restore. Is one hour enough?

An RTO of 60 minutes, a restore of 35 minutes. The other phase durations are freely chosen examples. Change them.

  1. 110 min
  2. 215 min
  3. 335 min
  4. 410 min
  5. 510 min

Total 80 min RTO of 60 min exceeded by 20 min

Planning example, not a measurement. The SQL restore time is one part of the recovery time. Only when provisioning, access, checks and application sign-off fit into the remaining time is the RTO met.

Compression can reduce transfer and I/O effort, but it costs CPU. Stripes can make better use of suitable I/O resources; on the same bottleneck, they do not create additional physical throughput. BUFFERCOUNT, MAXTRANSFERSIZE or additional parallelism are targeted variables to measure, not universal recipes for speed.

A different mix of full, differential and log backups can change the set of files to be restored. A smaller backup can still take longer to create, and a fast backup job can leave behind a complex restore path. Therefore, compare the whole procedure under representative load and size. The small synthetic lab data in this series does not support a general RTO or throughput recommendation.

An application that is ready for use often requires more than user databases: logins and SIDs, Agent jobs, credentials, certificates, interfaces and coordinated states across several databases. The same STOPAT time and an error-free CHECKDB alone do not prove that the application as a whole is consistent from a business perspective. For related databases, marked transactions planned in advance can be part of a suitable procedure (Microsoft: Related Databases Consistently Recover).

Best practices for advanced operations

  1. Name every failure scenario. An accidental change, database loss, server loss and loss of the backup target need different evidence.
  2. Take inventory of restore paths. Bring together base, log coverage, recovery forks, media positions, stripes and keys.
  3. Coordinate additional backups. Deliberately fit normal full backups, copy-only full backups and additional log jobs into the existing plan.
  4. Test the oldest target. Do not judge retention only by the newest successful backup.
  5. Check keys independently. Restore a fresh instance from secured material; actually test access and decryption.
  6. Make sure errors reach the person responsible. Check procedure, scheduler, job and notification together; detect skipped databases through the coverage check.
  7. Keep type changes and exceptions visible. @ChangeBackupType, minimum sizes and intervals, and replica preferences can change the expected set.
  8. Measure RTO completely. A restore command is one segment of recovery. Include business sign-off and dependencies in the measurement.
  9. Adopt updates in a controlled way. Record engine and Ola versions, compare options and repeat the core tests.
  10. Involve a second team member. A documented procedure that has been successfully handed over is more dependable than knowledge held by one person alone.

To-do lists

One list for ongoing operations, one for a specific problem. Your check marks are stored only in your browser.

Operations and regular testing

For a specific restore problem

Frequently asked questions

Does an additional full backup break the log chain?

No. A normal full backup changes the differential base. The log backup sequence is separate from that. Figure 1

What does error 3136 mean?

Often, a diff does not match the base that was restored before it. Check headers, base and the restore sequence so far. A file name or the same database name does not prove that they belong together. Figure 2

What does error 4305 mean?

The log to be applied starts too late for the current restore state. Look for the required earlier coverage and check whether you have chosen the right recovery path. Figure 3

Can Ola take over the restore completely?

DatabaseBackup creates backups and can verify them. That does not include a general restore plan with arbitrary file search, target time, key provisioning and application sign-off.

Does @CleanupTime = 168 reliably keep seven days of point-in-time recovery?

That has to follow from the dependencies that are retained and from a test. A rule in hours alone is not proof of a complete restore window. Figure 8

Are identical times across several databases enough?

They do not yet prove a common transactional state from a business perspective. Dependencies and suitable coordination must be part of the procedure.

Do encryption and immutable storage make backups secure automatically?

They address important risks. Available keys, correct storage policies, complete restore paths and tests are still required.

How often should we test?

Derive the frequency from risk and rate of change, and make it a binding part of your schedule. New versions, new targets, key rotations, topology changes or a changed retention procedure are concrete reasons for additional tests. A blanket frequency does not replace this assessment.

Check your understanding

Two questions from everyday practice. Think for a moment, then turn the card over.

  • Question 1 · Differential base

    You have a full backup from Sunday, an additional copy-only full backup from Tuesday and a diff from Wednesday. Which full backup does the diff belong to, provided no other normal full backup was taken in between?

    Answer

    To the full backup from Sunday.

    It is the matching normal full base. The copy-only full backup did not change it and is not a differential base itself. The actual identity is checked with the metadata and the restore.

    Reproduced in the lab: Figure 2 ↑

  • Question 2 · RTO

    All files are available, and the restore takes 35 minutes. Does that meet an RTO of one hour?

    Answer

    Not decided yet.

    Only if the other agreed phases, including provisioning, access, checks and application sign-off, are completed within the remaining time. The SQL duration alone is not enough to tell.

    To the phase calculator: Figure 12 ↑

Quiz

Can you find the right route?

Each answer is explained right away, with a link to the relevant part of the article. No cookies.

Origins and thanks

Ola Hallengren’s SQL Server Maintenance Solution automates backups with SQL Server’s native features and logs what it does. Source code and documentation are freely available under the MIT license (repository). Thank you to Ola Hallengren and to the community that uses the solution, tests it and carries it forward.

Where this article describes limits, they are limits of scope, not shortcomings: DatabaseBackup backs up and verifies; you build the restore plan, the expected inventory and the tests around it. It is exactly this division of tasks that makes the solution easy to understand and verify.

This article is our own text, with our own lab tests. Ola Hallengren has neither reviewed nor approved it; the conclusions and any errors are ours. For parameters and behavior, Ola’s own documentation is authoritative. We reviewed the state at commit 41617578 (source timestamp Sep 12, 2026); newer versions may behave differently.

Method and limits

Facts as of Oct 22, 2026. Ola’s original code frozen at commit 41617578643e722b790ea4d57ef80f8de38ae747. Our own lab tests selected native restore paths and Ola calls on SQL Server 2022 and 2025 on Linux.

Setup and checks in detail

Engines: SQL Server 2022 CU27 (16.0.4295.3, Developer Edition) and SQL Server 2025 CU9 (17.0.5005.3, Enterprise Developer Edition), each in a Linux container, one after the other with identical limits: 2 CPUs, 3 GiB container memory, max server memory 1,536 MB, no network access. Default compatibility level of each engine.

Data: purely synthetic, a few numbered markers per test database, including one database with recovery model SIMPLE. Every restore test counts the markers and runs a full DBCC CHECKDB; for STOPAT, we also check which markers are present.

Ola: individual installation of CommandLog.sql, CommandExecute.sql and DatabaseBackup.sql in a dedicated database; no full installer run, no scheduled jobs.

Result: 26 data-based checks per engine, all passed (52 of 52). In the selected cases, both versions show the same functional behavior. Measured run times are execution evidence from small functional tests, not benchmarks and not RTO measurements.

Not tested: no production Windows integration, no server or site loss, no availability group, no object storage, no real retention window, no key loss scenario. Also based only on the documentation: BULK_LOGGED, system databases, scheduler and complete application recovery. That a normal full backup does not break the log chain is documented by Microsoft; we did not run a separate test for it. The affected figures are therefore labeled “Diagram” or “Documented concept”.

Further reading