BACKUP LOG Cannot Be Performed Because There Is No Current Database Backup (Error 4214)

🚨Part of the SQL Server Errors series, the exact messages and what actually causes them.In: Backup & Recovery

Your log backup job has started failing on one database with Msg 4214. Nothing is broken. The database is in the FULL recovery model, but SQL Server has no full backup to start a log chain from, usually because the database is new or was switched from SIMPLE to FULL. Take one full backup and the next log backup works.

Msg 4214  ·  Level 16  ·  State 1
BACKUP LOG cannot be performed because there is no current database backup.

It is followed by Msg 3013, BACKUP LOG is terminating abnormally, which adds nothing.

⚡Check last_log_backup_lsn in sys.database_recovery_status for the failing database. NULL means the log chain has not started. Take a full backup (not COPY_ONLY) and run the log backup again. If it keeps coming back, something keeps switching the database to SIMPLE.

Check Whether the Log Chain Has Started

Run this on the instance. It lists every database in FULL or BULK_LOGGED, and the ones with a NULL in the last column are the ones that will fail with 4214:

SELECT d.name,
       d.recovery_model_desc,
       rs.last_log_backup_lsn   -- NULL = no log chain yet, BACKUP LOG fails with 4214
FROM sys.databases AS d
JOIN sys.database_recovery_status AS rs ON rs.database_id = d.database_id
WHERE d.recovery_model_desc <> 'SIMPLE'
ORDER BY rs.last_log_backup_lsn, d.name;
A new database in FULL with no full backup yetexample output, not something to copy
name recovery_model_desc last_log_backup_lsn Lab1006_4214_new FULL NULL

Despite its name, last_log_backup_lsn is not about the last log backup that ran. It is the point the next log backup would start from, and a full backup is what sets it. The column is described on sys.database_recovery_status on MS Docs.


Take a Full Backup, Then the Log Backup

-- Change the database name and paths to yours
BACKUP DATABASE YourDatabase TO DISK = 'D:\Backup\YourDatabase_full.bak' WITH CHECKSUM, INIT;
BACKUP LOG YourDatabase TO DISK = 'D:\Backup\YourDatabase_log.trn' WITH CHECKSUM, INIT;
The same database after one full backupexample output, not something to copy
Processed 376 pages for database 'Lab1006_4214_new', file 'Lab1006_4214_new' on file 1. Processed 2 pages for database 'Lab1006_4214_new', file 'Lab1006_4214_new_log' on file 1. BACKUP DATABASE successfully processed 378 pages in 0.037 seconds (79.708 MB/sec). Processed 3 pages for database 'Lab1006_4214_new', file 'Lab1006_4214_new_log' on file 1. BACKUP LOG successfully processed 3 pages in 0.004 seconds (5.859 MB/sec).

After that, last_log_backup_lsn has a value and the log backup job runs normally. On a large database you can let the next scheduled full backup do this instead, as long as you accept no log backups, and no point-in-time restore, until it finishes.


What Leaves a Database Without a Log Chain

  • A new database. It takes its recovery model from model, which is FULL by default, and the log backup job picks it up before the first full backup has run.
  • A switch from SIMPLE to FULL. Switching to SIMPLE breaks the log chain, and switching back does not restore it. A database with a working chain a minute earlier still failed.
  • A COPY_ONLY full backup. It does not start a log chain. A new database with only a COPY_ONLY full backup still gave 4214 on the next log backup.

The switch is the one that comes back, because something keeps doing it: a maintenance job that shrinks the log, a deployment script, or a person clearing a full transaction log. Here the database had a full and a log backup, was switched to SIMPLE and back, and the next log backup failed:

BACKUP LOG after SET RECOVERY SIMPLE, then FULLexample output, not something to copy
Msg 4214, Level 16, State 1, Server HPAI01, Line 1 BACKUP LOG cannot be performed because there is no current database backup. Msg 3013, Level 16, State 1, Server HPAI01, Line 1 BACKUP LOG is terminating abnormally.

After a switch from SIMPLE, a differential backup is enough to restart the chain, because a full backup already exists. That worked here, and MS Docs on changing the recovery model recommends it.


Frequently Asked Questions

I took a full backup and the log backup still fails. Why?
Check whether it was taken WITH COPY_ONLY. A copy-only full backup does not start the log chain, so last_log_backup_lsn stays NULL and the log backup fails with the same 4214. Take a normal full backup (copy-only backups on MS Docs).
I restored a database WITH RECOVERY. Will its log backups fail?
Not from the restore itself. A database restored from a full backup into FULL recovery took a log backup straight after with no error. If a restored database then fails with 4214, check whether it was switched from SIMPLE to FULL afterwards: that is the switch, and it needs a full or differential backup.
Can I switch the database to SIMPLE to stop the job failing?
Only if nobody needs a point-in-time restore of it. In SIMPLE there are no log backups at all, so you can only restore to your last full or differential backup. If the database is meant to be in FULL, take the full backup instead. SQL Server Recovery Models Explained covers the choice.
Is the database at risk while the log backups fail?
You cannot restore it to a point in time until a full backup has run, and if it has never had one you cannot restore it at all. That is the risk worth fixing today. The message itself does not mean anything is damaged (MSSQLSERVER_4214 on MS Docs).

Where To Go Next

Log backups fail at the chain, at the recovery model, or at a full log. The neighbours:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *