locked
issues with restore when setting up mirroring RRS feed

  • Question

  •  

    I'm witnessing a very strange restore issue when trying to set up mirroring.  I'm using very simple statements:

    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
    

    and the restore on the standby server:
    RESTORE DATABASE mydb
    FROM DISK = '\\myserver\E$\mydb.BAK'
    WITH NORECOVERY, STATS = 10
    GO
    RESTORE LOG mydb
    FROM DISK = '\\myserver\E$\mydb.TRN'
    WITH NORECOVERY, STATS = 10
    

    I'm getting a broken log chain 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.


    This is strange because the transaction log backup is taken immediately following the full back up.

     

    Doing some experiments, I restored the full backup completely (with recovery), just to check the state of the database after the full restore.  Interestingly, the database comes back online in Simple Recovery Mode.   This is really strange because the source database is in Full recovery mode.  Any thoughts why this may happen?  I've never seen this before.

     

    Friday, December 16, 2011 3:47 PM

Answers

  • Can you re-create the backup with INIT ( or with different name? )- I believe you might choice the wrong backup files?

    http://uk.linkedin.com/in/ramjaddu
    • Marked as answer by jshuraktjuh Friday, December 16, 2011 4:36 PM
    Friday, December 16, 2011 3:54 PM

All replies

  • Can you re-create the backup with INIT ( or with different name? )- I believe you might choice the wrong backup files?

    http://uk.linkedin.com/in/ramjaddu
    • Marked as answer by jshuraktjuh Friday, December 16, 2011 4:36 PM
    Friday, December 16, 2011 3:54 PM
  • edit:  That worked.  Thanks.  
    • Edited by jshuraktjuh Friday, December 16, 2011 4:12 PM
    • Marked as answer by jshuraktjuh Friday, December 16, 2011 4:35 PM
    • Unmarked as answer by jshuraktjuh Friday, December 16, 2011 4:36 PM
    Friday, December 16, 2011 4:09 PM
  • If it answer your question please mark it as answer to help others to find the solution

    http://uk.linkedin.com/in/ramjaddu
    Friday, December 16, 2011 4:24 PM
  • the location of ldf anf mdf file are collating, i think you are trying to confogure mirroring in the same machine, change the location path of mdf and ldf filesALTER DATABASE AdventureWorks
    SET SINGLE_USER WITH
    ROLLBACK
    IMMEDIATE

    RESTORE DATABASE AdventureWorks
    FROM DISK = 'C\:BackupAdventureworks.bak'
    WITH MOVE 'AdventureWorks_Data' TO 'C:\Data\datafile.mdf',
    MOVE 'AdventureWorks_Log' TO 'C:\Data\logfile.ldf',
    REPLACE
    Wednesday, December 28, 2011 11:06 AM