December 15, 2011 at 11:16 am
I'm trying to get mirroring online for a database. I'm taking a full backups:
BACKUP DATABASE mydb
TO DISK = '\\myserver\E$\mydb.BAK'
WITH STATS = 10
GO
BACKUP LOG mydb
TO DISK = '\\myserver\E$\mydb.TRN'
WITH STATS = 10
GO
Followed by this on the mirror:
RESTORE DATABASE mydb
FROM DISK = '\\myserver\E$\mydb.BAK'
WITH NORECOVERY, STATS = 10
GO
RESTORE LOG mydb
FROM DISK = '\\myserver\E$\mdb.TRN'
WITH NORECOVERY, STATS = 10
I receive the following error:
Msg 4312, Level 16, State 1, Line 2
This log cannot be restored because a gap in the log chain was created. Use more recent data backups to bridge the gap.
Msg 3013, Level 16, State 1, Line 2
RESTORE LOG is terminating abnormally.
Edit, Additionally, If I restore the full back up from prod to the mirror with recovery, the mirror DB comes up in simple mode. The prod database is in full recovery.
December 15, 2011 at 10:16 pm
I think you are restoring wrong TLOG backup file. See the difference in the file names in the BACKUP and RESTORE commands.
In BACKUP command it is mydb.TRN. In RESTORE it is mdb.TRN
December 16, 2011 at 5:55 am
Hi, I appreciate the response. That was a typo on my part when creating the post. Additionally, It would have generated a file does not exist error.
December 16, 2011 at 9:38 am
It looks like adding the WITH INIT
option did the trick
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply