Saturday, January 26, 2013

SQL2008R2 Error: The remote copy of database "XXXXX" has not been rolled forward to a point in time that is encompassed in the local copy of the database log. (Microsoft SQL Server, Error: 1412)


An error occurred while starting mirroring.
Alter failed for Database 'XXXXX'.  (Microsoft.SqlServer.Smo)
The remote copy of database "XXXXX" has not been rolled forward to a point in time that is encompassed in the local copy of the database log. (Microsoft SQL Server, Error: 1412)



Solution:
Log backup is not close enough to the mirror server database log. So restore is getting failing in the database mirroring session initiation.

  1. Take latest principal database full and log backup with NO RECOVERY mode and copy the backups to the mirror server to restore it by the below order.
  2. Restore the full backup with no recovery mode.
  3. Then Restore the log backup with no recovery mode.
  4. Then start your database mirroring session.

If you are trying to restore the log backup before full backup, you will get the below error.

So the order of backup in the restore is very important. Full backup first and then Log backup to restore.

3 comments:

  1. Thanks for the post

    ReplyDelete
  2. Awesome. Thank you

    ReplyDelete
  3. This did not work for me. I've restored from Full backup first and then restored from t-log the results being the error. I have created a principle backup several times and restored to the mirror with the same error each time.

    ReplyDelete

MYSQL:::Seamless Data Archiving: Exporting, Importing, and Pruning MySQL Tables

  Seamless Data Archiving: Exporting, Importing, and Pruning MySQL Tables Introduction: In the dynamic landscape of database management...