SQL Server error 1409 means the database cannot be brought online because its transaction log chain is broken: you are trying to restore a data file (or a full backup) without first restoring the log backups that cover the gap. The fix is to restore the missing log backups in sequence with NORECOVERY, or, if you do not need point-in-time recovery, to force the restore with RECOVERY and accept data loss. Before you start, confirm you have the full backup and every log backup taken since, and that you know whether the database uses the full or bulk-logged recovery model. If any log backup is missing, you cannot complete a point-in-time restore.

What You'll Need

  • The full database backup file (.bak) that started the chain.
  • Every transaction log backup (.trn) taken after that full backup, in order, with no gaps.
  • The SQL Server Management Studio (SSMS) or Azure Data Studio connection to the target instance, with sysadmin or dbcreator rights.
  • The logical file names inside the backup (you can list them with RESTORE FILELISTONLY).
  • Enough disk space on the target server for the restored database plus the log growth.

Step-by-Step

  1. Identify the break. Run RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourDb_Full.bak'; and note the DatabaseName, BackupType and FirstLSN/LastLSN. Do the same for each .trn file. The LastLSN of one backup must match the FirstLSN of the next; a mismatch is the gap that triggers error 1409.
  2. Put the database in restoring state. If the database is partially restored, run RESTORE DATABASE YourDb FROM DISK = 'C:\Backups\YourDb_Full.bak' WITH NORECOVERY, REPLACE;. The NORECOVERY option is essential: it keeps the database in RESTORING state so log backups can be applied. Using RECOVERY here closes the chain and causes 1409 on the next log restore.
  3. Restore each log backup in order. For every .trn file from oldest to newest, run RESTORE LOG YourDb FROM DISK = 'C:\Backups\YourDb_Log1.trn' WITH NORECOVERY;. Repeat for Log2, Log3 and so on. Do not skip a file, and do not restore them out of order.
  4. Apply the final log with RECOVERY. For the last log backup in the chain, use RESTORE LOG YourDb FROM DISK = 'C:\Backups\YourDb_LogN.trn' WITH RECOVERY;. This rolls forward committed transactions and brings the database online. If you have a tail-log backup, restore it last with RECOVERY.
  5. Verify the state. Run SELECT name, state_desc FROM sys.databases WHERE name = 'YourDb';. It should show ONLINE. Then run DBCC CHECKDB('YourDb') WITH NO_INFOMSGS; to confirm consistency.
  6. If you cannot find the missing log, force recovery. Only if you accept losing transactions after the last available backup, run RESTORE DATABASE YourDb WITH RECOVERY; while it is in RESTORING state. This discards the incomplete log chain and brings the database online at the last restored point.

Menu labels in SSMS can differ slightly by version, but the RESTORE DATABASE and RESTORE LOG dialog pages (General, Options) use the same wording. On Azure SQL Database and Azure SQL Managed Instance, RESTORE ... WITH NORECOVERY is not available; use point-in-time restore instead.

Common Mistakes

  • Using WITH RECOVERY on the full restore, which closes the chain and makes every later log restore fail with 1409.
  • Restoring log backups out of order or skipping one because the file name looked older than it was.
  • Restoring a differential backup after a log backup; the correct order is full, then latest differential, then logs.
  • Pointing at the wrong copy of a log file (for example, a nightly copy that overwrote the original).
  • Forgetting WITH REPLACE when overwriting an existing database of the same name.
  • Assuming a log backup exists when the database was in SIMPLE recovery model, which does not support log backups.

Tips

  • Script the whole chain into one .sql file with all RESTORE statements in order, then run it as a single batch so no step is missed.
  • Use RESTORE VERIFYONLY FROM DISK = '...'; on each backup before restoring to catch corrupt files early.
  • Keep the full backup and all log backups in the same folder with sortable names (for example, YourDb_Full_20240101.bak, YourDb_Log_20240101_1200.trn) so the order is obvious.
  • Record the LastLSN of each backup in a spreadsheet as part of your backup routine; it makes gaps visible before a restore is needed.
  • Test the restore on a non-production instance first so you do not overwrite a live database while diagnosing the chain.

Troubleshooting

Error 4305 or 4326 appears instead of 1409. These mean the log backup is from a different database or the LSN chain is broken at a different point. Re-check the header information for every file and confirm the DatabaseName and BackupType match.

The restore says the database is in use. Run ALTER DATABASE YourDb SET SINGLE_USER WITH ROLLBACK IMMEDIATE; before the first restore, then set it back to MULTI_USER after recovery. This disconnects other sessions; warn users first.

You cannot find a log backup. Check the backup history tables: SELECT database_name, backup_start_date, type FROM msdb.dbo.backupset WHERE database_name = 'YourDb' ORDER BY backup_start_date;. If no log backup exists after the full backup, you cannot restore to a later point; use WITH RECOVERY and accept the data loss, or restore from a different source such as a snapshot or an older full backup.

The database stays in RESTORING state. That is expected until you run the final RESTORE ... WITH RECOVERY. If you are sure the chain is complete, run RESTORE DATABASE YourDb WITH RECOVERY; to bring it online.

You get a file activation or permission error. The SQL Server service account needs read access to the backup folder and write access to the data and log directories. Grant those rights, then retry the restore.

Frequently Asked Questions

Can I skip a missing log backup and still restore?

No. A missing log breaks the LSN chain, and SQL Server will not let you apply later logs. You must either find the missing file or force recovery and accept losing the transactions it contained.

Does error 1409 mean my backups are corrupt?

Not usually. It means the restore sequence is incomplete or out of order. Corruption shows up as different errors (for example, 3241 or 3242) during RESTORE VERIFYONLY.

Can I use WITH RECOVERY on the full backup and then restore logs?

No. WITH RECOVERY ends the restore sequence. Any later log restore will fail with 1409. Use NORECOVERY for every step except the last.

What if the database was in SIMPLE recovery model?

SIMPLE recovery does not support log backups, so there is no log chain to restore. You can only restore the full and differential backups; error 1409 will not apply.

Does this work on Azure SQL Database?

No. Azure SQL Database and Azure SQL Managed Instance do not support RESTORE ... WITH NORECOVERY. Use the built-in point-in-time restore feature instead.

How do I know the chain is complete before restoring?

Compare the LastLSN of each backup with the FirstLSN of the next. They should match exactly. If they do not, a log backup is missing between them.