I'm trying to restore a full database backup plus transaction logs to the most recent transaction log. I've set up transaction logs to ship out every 15 minutes. This setup was performed via the SMSS GUI. The full database backup starts at 12 AM daily, and usually finishes before 2 AM.
First, I restore the full backup with NORECOVERY.:
USE [master]
RESTORE DATABASE [DBNAME] FROM DISK = N'X:\path\to\DBNAME.bak' WITH FILE = 1, NORECOVERY, NOUNLOAD, REPLACE, STATS = 5
GO
This completes successfully.
Then, I grab the oldest transaction log and run the following:
RESTORE LOG DBNAME FROM DISK = 'X:\path\to\OldestTransactionLog.trn' WITH NORECOVERY;
However, I get the following error:
Msg 4305, Level 16, State 1, Line 10
The log in this backup set begins at LSN 421814812000000025600001, which is too recent to apply to the database. An earlier log backup that includes LSN 421787067000000013800001 can be restored.
Msg 3013, Level 16, State 1, Line 10
RESTORE LOG is terminating abnormally.
I don't understand why this is too recent!
My backup takes place at 12 AM and finishes by 2 AM.
At first I tried the transaction log from 12 AM, then seeing the "too recent" message, tried the oldest one I have, from 11:30 AM yesterday.
So this transaction log should be half a day older than the most recent full database backup.
Am I missing something here? How can this be too recent?
Any help is appreciated - and this is not on a production system, don't worry!