Backup/Restores for Database Mirroring Session

  • Hi, Pls can anyone help me, am setting up Database Mirroring between two server using Developer Edition.

    I did a full backup of the Principal Database and restore it onto the Mirror with no recovery, then did a transaction log back up, but when I try to restore it, I get error message (System.Data.SqlClient.SqlError: The log in this backup set begins at LSN 46000000259700001, which is too recent to apply to the database. An earlier log backup that includes LSN 46000000259200001 can be restored. (Microsoft.SqlServer.Smo)).

    That the transaction log is too recent, to choose an earlier one with a different LSN, see the full error message below.

    I restored the full back with no recovery, will I have to restore the transaction log "with recovery"or "with no recovery"

    ===================================

    Restore failed for Server 'ADESINA\JUMOKE'. (Microsoft.SqlServer.Smo)

    ------------------------------

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

    ------------------------------

    Program Location:

    at Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)

    at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreDatabaseOptions.RunRestore()

    ===================================

    System.Data.SqlClient.SqlError: The log in this backup set begins at LSN 46000000259700001, which is too recent to apply to the database. An earlier log backup that includes LSN 46000000259200001 can be restored. (Microsoft.SqlServer.Smo)

    ------------------------------

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&LinkId=20476

    ------------------------------

    Program Location:

    at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQueryWithMessage(StringCollection queries, ServerMessageEventHandler dbccMessageHandler, Boolean errorsAsMessages)

    at Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)

    at Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)

  • Did you restore your log file in order? If you miss any earlier log file, you will get the error message.

  • Hi, thanks for the reply, the database am using has a job that backs up the transaction log every day, so I guess there will be loads of log files.

    What I did was take the full backup, restored it with "no recovery" then a transaction log backup after that and restored only that transaction log backup. Am doing it as a test not production, would I have to restore all the previous log backup ( there are many of them and from what date).

  • You need to restore the full backup first. Then,

    The very first log backup after the full backup.

    The second log backup after the full backup.

    ...

  • fosco (1/29/2008)


    would I have to restore all the previous log backup ( there are many of them and from what date).

    Yes. You have to restore the log backups, in order, starting with the first one after the full backup that you used.

    If you're setting up database mirroring, all or your transaction log backups, including the last must be restored with no_recovery

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You can make use of these links to configure database mirroring in SQL Server 2005. If you have any queries pls, let us know. The below mentioned has all the screenshots attached and provides a step by step guidance.

    http://sql-articles.com/index.php?page=articles/cng-dbmrr.htm

    http://sql-articles.com/index.php?page=articles/dbmrr.htm

    Hope this Helps

    [font="Verdana"]- Deepak[/font]

  • Thanks

  • i am also getting the same error , while configuring log shipping , I did a full backup in PROD server and restored in COB and then took a log backup backup and while restoring it in COB server Error "which is too recent to apply to the database" (only one log backup is done )

  • Check that there's no automatic log backup job running and that the log hasn't been truncated between the full backup and the log backup you took.

    The error 'too recent...' implies that there are log records missing.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Also ensure that nobody has truncated the log file using Backup log with truncate_only or no_log command. Because the usage of the above commands will break the LSN and hence your log shipping might fail..

    [font="Verdana"]- Deepak[/font]

  • no log trunation happeded , i repeated the steps what i have explained earlier , Log shipping worked successfully

    (still wondering wat went wrong). Thanks for your valauble points

  • GilaMonster,

    Thanks a lot for the tip. I was getting the same error and there was this job which was truncating the logs after the full backup

    Thanks a lot

  • avi27 (10/31/2008)


    GilaMonster,

    Thanks a lot for the tip. I was getting the same error and there was this job which was truncating the logs after the full backup

    Thanks a lot

    You should never be truncating your transaction log. See today's headline article.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply