Sql-server – Restore a point between two full backups

backuprestoresql server

I make two full backups on Oct 1 and Oct 10. I want to restore the server to a state in Oct 5. So I just do as follows:

  1. Perform a transaction log backup on the server on Oct 23. I have never backup transaction log in the past.
  2. Restore the server with Oct 1 full backup with NORECOVERY option.
  3. Try to restore to the point at Oct 5 12:00, with the transaction log.

But the restore fails and SQL Server said the transaction log does not contain the point. The point is too early. Why? Also my .LDF file is about 13G, but the transaction log backup is only 200MB. Why?

Thanks

Best Answer

You can do a point in time recovery to Oct 5th if you have only full backups and a last transction log backup (called a tail log backup). Your transaction log backup contains all transactions back to the last log backup. So that should be sufficient to do a point in time recovery.

That you are getting the message "transaction log does not contain the point" indicates one of the following:

  • There were other transaction log backups taken before your last transaction log backup.
  • The database was in Simple recovery mode somewhere between the 1st and the 23rd of October.

The reason your transaction log is so big is that it was not backed up regurarly. As transactions happen, the log grows. A transaction log backup truncates your transaction log, and then the empty space can be used for new transactions. The reason can also be that there was a big amount of data modified.

Recommendation: regurarly backup your database (for example every day) and your transaction logs (at least every hour or even more often, depending on the activity in the database). Keep those backups in a safe place. Then you will be able to do proper point in time recovery.